LXD configuration for OSM Release TWO: Difference between revisions

From OSM Public Wiki
Jump to: navigation, search
(Created page with "In order to run LXD containers, you need to install lxd (if not installed by default) and zfs package (to be used as storage backend) sudo apt-get update sudo apt-get instal...")
 
No edit summary
Line 4: Line 4:
  newgrp lxd                  # required to log the user in the lxd group if lxd was just installed
  newgrp lxd                  # required to log the user in the lxd group if lxd was just installed


Then, just run the following command to configure lxd and answer the questions accordingly:
Then, just run the following command to configure lxd and answer the questions accordingly. Default options for ZFS will work:
  sudo lxd init
  sudo lxd init
   Name of the storage backend to use (dir or zfs): zfs
   Name of the storage backend to use (dir or zfs) [default=zfs]:
   Create a new ZFS pool (yes/no)?: yes
   Create a new ZFS pool (yes/no) [default=yes]?
   Name of the (existing/new) ZFS pool or dataset: lxdpool
   Name of the new ZFS pool [default=lxd]:
   Would you like to use an existing block device (yes/no)? no
   Would you like to use an existing block device (yes/no) [default=no]?
   Size in GB of the new loop device (1GB minimum): 50
   Size in GB of the new loop device (1GB minimum) [default=15]:
   Would you like LXD to be available over the network (yes/no)? no
   Would you like LXD to be available over the network (yes/no) [default=no]?
   Do you want to configure the LXD bridge (yes/no)? yes
   Do you want to configure the LXD bridge (yes/no) [default=yes]?


Although further customization is possible, default options for LXD bridge configuration will work in all cases.
Although further customization is possible, default options for LXD bridge configuration will work.
 
Check the MTU of the LXD bridge (lxdbr0) and the MTU of the default interface. If they are different, adjust the MTU of the LXD bridge accordingly to have the same MTU:
lxc list                        # This will drive initialization of lxdbr0
ip adddress show ens3            # In case ens3 is the default interface
ip adddress show lxdbr0
sudo ifconfig lxdbr0 mtu 1446    # Use the appropriate MTU value
sed -i '/ifconfig lxdbr0 mtu/d' /etc/rc.local    # To make MTU change persistent between reboots
sed -i "$ i ifconfig lxdbr0 mtu 1446" /etc/rc.local    # To make MTU change persistent between reboots. Use the appropriate MTU value

Revision as of 15:27, 8 May 2017

In order to run LXD containers, you need to install lxd (if not installed by default) and zfs package (to be used as storage backend)

sudo apt-get update
sudo apt-get install zfs lxd
newgrp lxd                   # required to log the user in the lxd group if lxd was just installed

Then, just run the following command to configure lxd and answer the questions accordingly. Default options for ZFS will work:

sudo lxd init
 Name of the storage backend to use (dir or zfs) [default=zfs]:
 Create a new ZFS pool (yes/no) [default=yes]?
 Name of the new ZFS pool [default=lxd]:
 Would you like to use an existing block device (yes/no) [default=no]?
 Size in GB of the new loop device (1GB minimum) [default=15]:
 Would you like LXD to be available over the network (yes/no) [default=no]?
 Do you want to configure the LXD bridge (yes/no) [default=yes]?

Although further customization is possible, default options for LXD bridge configuration will work.

Check the MTU of the LXD bridge (lxdbr0) and the MTU of the default interface. If they are different, adjust the MTU of the LXD bridge accordingly to have the same MTU:

lxc list                         # This will drive initialization of lxdbr0
ip adddress show ens3            # In case ens3 is the default interface
ip adddress show lxdbr0
sudo ifconfig lxdbr0 mtu 1446    # Use the appropriate MTU value
sed -i '/ifconfig lxdbr0 mtu/d' /etc/rc.local     # To make MTU change persistent between reboots
sed -i "$ i ifconfig lxdbr0 mtu 1446" /etc/rc.local    # To make MTU change persistent between reboots. Use the appropriate MTU value