Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

LXD init will configure a bridge. In order to say yes to this you must have the bridge utils installed. In this article we covered that so say yes and then you will be prompted with a "text ui" interface,

Code Block
languagebash
Do you want to configure the LXD bridge (yes/no) [default=yes]?

 You will be prompted with a "text ui" interface. ...

Pretty much first set are defaults. Will add notes about ZFS. Should explain loop device here too. Note Roderick using Azure Ubuntu 16.10 has simpler following screens,

Code Block
languagebash
Name of the storage backend to use (dir or zfs) [default=zfs]: zfs
Create a new ZFS pool (yes/no) [default=yes]? yes
Name of the new ZFS pool [default=lxd]: lxd
Would you like to use an existing block device (yes/no) [default=no]? no
Size in GB of the new loop device (1GB minimum) [default=15]: 15
Would you like LXD to be available over the network (yes/no) [default=no]? no
Would you like stale cached images to be updated automatically (yes/no) [default=yes]? yes
Would you like to create a new network bridge (yes/no) [default=yes]? yes
What should the new bridge be called [default=lxdbr0]? lxdbr0
What IPv4 subnet should be used (CIDR notation, "auto" or "none") [default=auto]? auto
What IPv6 subnet should be used (CIDR notation, "auto" or "none") [default=auto]? auto
LXD has been successfully configured.

Tin using Ubuntu 16.04.1

Code Block
languagebash
Name of the new ZFS pool [default=lxd]: lxd
Would you like to use an existing block device (yes/no) [default=no]? no
Size in GB of the new loop device (1GB minimum) [default=15]: 15
Would you like LXD to be available over the network (yes/no) [default=no]? no
Would you like stale cached images to be updated automatically (yes/no) [default=yes]? yes
Would you like to create a new network bridge (yes/no) [default=yes]? yes
What should the new bridge be called [default=lxdbr0]? lxdbr0
What IPv4 subnet should be used (CIDR notation, "auto" or "none") [default=auto]? auto
What IPv6 subnet should be used (CIDR notation, "auto" or "none") [default=auto]? auto
LXD has been successfully configured.

After saying yes to the new network bridge here are the answers to the texts graphical sub prompts,

Code Block
languagebash
Would you like to create a new network bridge (yes/no) [default=yes]? <yes>
What should the new bridge be called [default=lxdbr0]? <Ok>
Do you want to setup an IPv4 subnet? <yes>

This subnet was selected for your convenience and next questions have been pre-answered accodingly. Please make sure this subnet isn't already in use somewhere on your network, if it is, change it to one which isn't. If you later notice network connectivity issues, re-configure lxd and pick a different subnet.
<Ok>

# resulting IPv4 address will vary in this example using VMWare fusion it is 10.232.27.1
<Ok>
... all sorts of things... need to redo this.

Use your arrow keys to pick the buttons.

Introduction,

Panel

Conifiguring lxd

Containers need a bridge to connect them together and to the host for outside network connectivity. Choosing this option will let you configure the default LXD bridge to your liking. If you would rather not have LXD do this for you, then you will be asked whether you want to use an existing bridge or just do everything manually. Would you like to setup a network bridge for LXD containers now? 

Yes

The default bridge name is lxdbr0. It's just a name but suggest you leave as default. To get to the button, use the down arrow key,

Panel

Conifiguring lxd

A valid network interface name (e.g. lxdbr0).

Bridge interface name: lxdbr0

Ok

Go with IPv4 unless you have some special need to use IPv6,

Panel

This is needed to provide IPv4 connectivity for your containers. Do you want to setup an IPv4 subnet?


Yes

You will be assigned a random subnet. For the purposes of this article, think of a subnet as a way of naming your postal code. It's the difference between Canada and US postal code. When given time I'll provide more description and write or link to a good article on subnets,

Panel

A random subnet was selected for you. This subnet was selected for your convenience and the next questions have been pre-answered accordingly. Please make sure this subnet isn't already in use somewhere on your network, if it is, change it to one which isn't. If you later notice network connectivity issues, re-configure lxd and pick a different subnet.

Yes

IPv4 address. This prompt is not very clear. Going to go back and check shortly. It is either reserving this IP address or asking you for a sample to determine the subnet.

Panel

A valid IPv4 address. (e.g. 10.0.8.1): 10.139.135.1

Ok

A valid CIDR mask. (e.g. 24),

Panel

IPv4 CIDR mask:: 24

Ok

Initial IP Address Range does not matter unless you want to use a lot of static IP addresses. I need to think about this a bit more... the idealism behind cloud is not require static, but reality (at least for now), I still find static useful and in some application designs (stateful apps, older PKI's... ect...) absolutely necessary.

Panel

The first address to be handed out over DHCP (e.g. 10.0.8.2)

First DHCP address: 10.139.135.2

Ok

Pick default for the last address,

Panel

The last address to be handed out over DHCP (e.g. 10.0.8.254)

Last DHCP address: 10.139.135.254

Ok

The DHCP leas number should be default unless you went and changed the range. If so you should adjust to match. Yeah I know the numbers do not add up (254 - 2 = 252) but I believe there is some fancy math for that... look up and link to my LXC articles.

Panel

 The maximum number of DHCP leases that can be obtained. (e.g. 250)

Max number of DHCP clients: 250

Ok

For almost all networks this will be Yes. Tin google or to talk to Dickson or Andrew though at some point to put explanations here.

Panel

This is needed unless you are using a routed IPv4 subnet.

Do you want to NAT the IPv4 traffic? 

Yes

Unless you really need IPv6 say no,

Panel

This is needed to provide IPv6 connectivity for your containers.

Do you want to setup an IPv6 subnet?   

No

After this you will be taken out of the Text UI. The warning message is due to network bridge setup,

Code Block
languagebash
Warning: Stopping lxd.service, but it can still be activated by:
  lxd.socket
LXD has been successfully configured.

I hate doing this in Linux, but let's reboot to make sure the lxd service is ok,

Code Block
languagebash
sudo reboot

Reconfigure

If you need to reconfigure the bridge you can by using this command.

Code Block
languagebash
sudo dpkg-reconfigure -p medium lxd

Basic LXD Commands

You no longer need root, but users must be added to the lxd group to run the lxc commands.

...