lxd

warning: Creating default object from empty value in /data/web/1/000/027/003/273448/htdocs/panticz.de/modules/taxonomy/taxonomy.pages.inc on line 33.

LXD: Create container with profile (connect to VLAN)

create profile
lxc profile copy default mgmt-dev
# lxc profile list
lxc profile device set mgmt-dev eth0 nictype macvlan
lxc profile device set mgmt-dev eth0 parent mgmt-dev-v4432
lxc profile show mgmt-dev

create container with profile
lxc launch ubuntu:18.04 bionic-mgmt-dev -p mgmt-dev
lxc ls

Enable container nesting
lxc config set bionic-mgmt-dev security.nesting true

Configure IP
cat < /var/lib/lxd/containers/bionic-mgmt-dev/rootfs/etc/netplan/50-cloud-init.yaml
network:
version: 2

LXD

lxc profile delete default
lxc storage delete default
lxc profile device add default root disk path=/ pool=default

lxc profile create default
lxd init
--auto

# lxd init
Would you like to use LXD clustering? (yes/no) [default=no]:
Do you want to configure a new storage pool? (yes/no) [default=yes]:
Name of the new storage pool [default=default]:
Name of the storage backend to use (dir, lvm, zfs) [default=zfs]:
Create a new ZFS pool? (yes/no) [default=yes]:
Would you like to use an existing block device? (yes/no) [default=no]:

Install LXD

wget https://raw.githubusercontent.com/panticz/installit/master/install.lxd.sh -O - | bash -

#!/bin/bash

RELEASE=$(lsb_release -rs | tr -d ".")
if [ ${RELEASE} -lt 1804 ]; then
    # add LXD PPA repository
    sudo apt-get install -y software-properties-common
    sudo add-apt-repository -y ppa:ubuntu-lxc/lxd-stable
    sudo apt-get update
fi

# install LXD
sudo apt-get install -y lxd

# initialize LXD
sudo lxd init --auto

Links
https://linuxcontainers.org/lxd/getting-started-cli/

Syndicate content