Skip to content

Latest commit

 

History

History
291 lines (216 loc) · 7.73 KB

18-lxc_demo.md

File metadata and controls

291 lines (216 loc) · 7.73 KB
SPDX-FileCopyrightText SPDX-License-Identifier title author footer description keywords color class style
© 2023 Menacit AB <foss@menacit.se>
CC-BY-SA-4.0
Virtualisation course: LXC/LXD demo
Joel Rangsmo <joel@menacit.se>
© Course authors (CC BY-SA 4.0)
Demonstration of LXC/LXD for OS-level virtualisation
virtualisation
os
lxc
lxd
incus
demo
demonstration
devops
#ffffff
invert
section.center { text-align: center; }

LXC/LXD demonstration

A peak into OS-level virtualisation

bg right:30%


$ sudo snap install lxd

lxd 5.9-9879096 from Canonical✓ installed
$ sudo lxd init --minimal

bg right:30%


$ sudo lxc image list images: | shuf

centos/8-Stream(3more)
openwrt/21.02(3more)
fedora/36(3more)
almalinux/9(3more)
opensuse/15.4/desktop-kde(1more)
mint/tina(3more)
alpine/3.17(3more)
[...]

bg right:30%


$ sudo lxc launch images:almalinux/9 srv-1

Creating srv-1
Retrieving image: Unpack: 100% (3.81GB/s)
Starting srv-1

bg right:30%


$ cat /etc/os-release | grep -F PRETTY_NAME
PRETTY_NAME="Ubuntu 22.04.1 LTS"

$ sudo lxc exec -t srv-1 -- /bin/bash

[root@srv-1 ~]# cat /etc/os-release | grep -F PRETTY_NAME
PRETTY_NAME="AlmaLinux 9.1 (Lime Lynx)"

$ sudo lxc info srv-1 --resources

Name: srv-1
Status: RUNNING

Resources:
  Processes: 15
  Disk usage:
    root: 2.62MiB
  Memory usage:
    Memory (current): 54.58MiB
[...]

bg right:30%


$ sudo lxc exec -t srv-2 -- /bin/ash

~ # apk add fortune
(1/3) Installing libmd (1.0.4-r0)
(3/3) Installing fortune (0.1-r1)

~ # fortune 

Matter cannot be created or destroyed,
nor can it be returned without a receipt.

bg right:30%


$ sudo lxc snapshot srv-2 pre_upgrade
$ sudo lxc restore srv-2 pre_upgrade

bg right:30%


$ sudo lxc cluster list

node-1
node-2
node-3
$ sudo lxc info srv-1 | grep Location

Location: node-1
$ sudo lxc cluster evacuate node-1
$ sudo lxc info srv-1 | grep Location

Location: node-2

bg right:30%


Other neat features

bg right:30%


Recent drama in the development community has caused several contributors to leave the LXD project.

Checkout the community-driven fork called Incus.

bg right:30%