Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[do-not-merge]: storage-vm lvm (DEBUG) #355

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
c313bda
tests/storage-vm: support lvm-external (fake) driver (DEBUG)
simondeziel Nov 20, 2024
dbc870b
github: only run storage-vm lvm{,-external} for {5.21,latest}/edge on…
simondeziel Nov 20, 2024
21c5590
tests/storage-vm: load core24's libc6 onto core2x's
simondeziel Nov 22, 2024
3bc6dae
tests/storage-vm: load core22's libbpf.so.0
simondeziel Nov 22, 2024
23a264b
tests/storage-vm: make sgdisk not executable
simondeziel Nov 22, 2024
a113485
tests/storage-vm: load core22's libpcre and libprocps .so
simondeziel Nov 22, 2024
ff4c44e
tests/storage-vm: early abort before creating different pool
simondeziel Nov 22, 2024
9e49aee
tests/storage-vm: debug
simondeziel Nov 22, 2024
caeb722
tests/storage-vm: abort earlier debug
simondeziel Nov 22, 2024
eb43b40
github: faster test matrix
simondeziel Nov 22, 2024
6e0d85d
github: stop testing with lvm-external
simondeziel Nov 25, 2024
a1ad59e
tests/storage-vm: add time calculation
simondeziel Nov 23, 2024
325e5d4
tests/storage-vm: load core24's libc on core22
simondeziel Nov 23, 2024
ea54a46
tests/storage-vm: use lxd snap with dd timing
simondeziel Nov 25, 2024
2979798
tests/storage-vm: use dd from core22 on core24
simondeziel Nov 25, 2024
bdb03cf
tests/storage-vm: sideload losetup from core22 on core24
simondeziel Nov 26, 2024
6aad8a5
tests/storage-vm: early abort
simondeziel Nov 26, 2024
efcc757
tests/storage-vm: don't abort early
simondeziel Nov 26, 2024
d2d461a
tests/storage-vm: drop support for lvm-external
simondeziel Nov 26, 2024
bc2040b
tests/storage-vm: debug
simondeziel Nov 30, 2024
f077519
bin/helpers: don't install/remove LXD (DEBUG)
simondeziel Dec 16, 2024
be18457
tests/storage-vm: strace losetup calls (DEBUG)
simondeziel Dec 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
146 changes: 2 additions & 144 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,157 +81,15 @@ jobs:
strategy:
fail-fast: false
matrix:
os: ${{ fromJSON(inputs.ubuntu-releases || '["20.04", "22.04", "24.04"]') }}
track: ${{ fromJSON(inputs.snap-tracks || '["latest/edge", "5.21/edge", "5.0/edge", "4.0/edge"]') }}
os: ${{ fromJSON(inputs.ubuntu-releases || '["22.04"]') }}
track: ${{ fromJSON(inputs.snap-tracks || '["latest/edge", "5.21/edge"]') }}
test:
- cgroup
- cluster
- container
- container-copy
- conversion
- cpu-vm
- devlxd-container
- devlxd-vm
- docker
- efi-vars-editor-vm
- interception
- network-bridge-firewall
- network-ovn
- network-routed
- pylxd
- snapd
- storage-buckets
- storage-disks-vm
- storage-vm btrfs
- storage-vm ceph
- storage-vm dir
- storage-vm lvm
- storage-vm lvm-thin
- storage-vm zfs
- storage-volumes-vm
- tpm-vm
- vm
- vm-migration
- vm-nesting
include:
- test: qemu-external-vm
track: "latest/edge"
os: 24.04
exclude:
# not compatible with 4.0/*
- test: container-copy
track: "4.0/candidate"
- test: conversion
track: "4.0/candidate"
- test: cpu-vm
track: "4.0/candidate"
- test: devlxd-vm
track: "4.0/candidate"
- test: efi-vars-editor-vm
track: "4.0/candidate"
- test: network-bridge-firewall
track: "4.0/candidate"
os: 20.04
- test: network-ovn
track: "4.0/candidate"
- test: storage-buckets
track: "4.0/candidate"
- test: storage-disks-vm
track: "4.0/candidate"
- test: storage-vm btrfs
track: "4.0/candidate"
- test: storage-vm ceph
track: "4.0/candidate"
- test: storage-vm dir
track: "4.0/candidate"
- test: storage-vm lvm
track: "4.0/candidate"
- test: storage-vm lvm-thin
track: "4.0/candidate"
- test: storage-vm zfs
track: "4.0/candidate"
- test: storage-volumes-vm
track: "4.0/candidate"
- test: tpm-vm
track: "4.0/candidate"
- test: vm-migration
track: "4.0/candidate"
- test: container-copy
track: "4.0/edge"
- test: conversion
track: "4.0/edge"
- test: cpu-vm
track: "4.0/edge"
- test: devlxd-vm
track: "4.0/edge"
- test: efi-vars-editor-vm
track: "4.0/edge"
- test: network-bridge-firewall
track: "4.0/edge"
os: 20.04
- test: network-ovn
track: "4.0/edge"
- test: storage-buckets
track: "4.0/edge"
- test: storage-disks-vm
track: "4.0/edge"
- test: storage-vm btrfs
track: "4.0/edge"
- test: storage-vm ceph
track: "4.0/edge"
- test: storage-vm dir
track: "4.0/edge"
- test: storage-vm lvm
track: "4.0/edge"
- test: storage-vm lvm-thin
track: "4.0/edge"
- test: storage-vm zfs
track: "4.0/edge"
- test: storage-volumes-vm
track: "4.0/edge"
- test: tpm-vm
track: "4.0/edge"
- test: vm-migration
track: "4.0/edge"
# not compatible with 5.0/*
- test: efi-vars-editor-vm
track: "5.0/candidate"
- test: efi-vars-editor-vm
track: "5.0/edge"
- test: vm-migration
track: "5.0/candidate"
- test: vm-migration
track: "5.0/edge"
# skip track/os combinations that are too far appart
- os: 24.04
track: "4.0/candidate"
- os: 24.04
track: "4.0/edge"
- os: 24.04
track: "5.0/candidate"
- os: 24.04
track: "5.0/edge"
- os: 20.04
track: "5.0/candidate"
- os: 20.04
track: "5.0/edge"
- os: 20.04
track: "5.21/candidate"
- os: 20.04
track: "5.21/edge"
- os: 20.04
track: "latest/candidate"
- os: 20.04
track: "latest/edge"

steps:
- name: Performance tuning
uses: canonical/lxd/.github/actions/tune-disk-performance@main

- name: Reclaim disk space
if: ${{ matrix.test == 'conversion' || startsWith(matrix.test, 'storage-') || matrix.test == 'vm-nesting' }}
uses: canonical/lxd/.github/actions/reclaim-disk-space@main

- name: Disable Docker
uses: canonical/lxd/.github/actions/disable-docker@main

Expand Down
1 change: 1 addition & 0 deletions bin/helpers
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ install_deps() (
# install_lxd: install LXD from a specific channel or `latest/edge` if none is provided.
# Optional argument: boolean which indicates whether to start the daemon. Default is true.
install_lxd() (
return 0
local start_daemon="${1:-true}"

# Wait for snapd seeding
Expand Down
33 changes: 31 additions & 2 deletions tests/storage-vm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,28 @@ IMAGE="${TEST_IMG:-ubuntu-minimal-daily:24.04}"

poolDriverList="${1:-ceph dir btrfs lvm lvm-thin zfs}"

if [ "${LXD_SNAP_CHANNEL}" = "latest/edge" ]; then
echo "Installing core22"
snap install core22

umount -l /snap/core22/current/usr/sbin/losetup || true
umount -l /snap/core24/current/usr/sbin/losetup || true
rm -rf patch/
mkdir patch/
cp /snap/core22/current/usr/sbin/losetup patch/losetup.core22
cat << EOF > patch/losetup
#!/bin/sh
mkdir -p /var/lib/snapd/hostfs/root/\$\$/
echo "\$0" "\$@" > /var/lib/snapd/hostfs/root/\$\$/args
exec /var/lib/snapd/hostfs/snap/strace-static/current/bin/strace -f -o /var/lib/snapd/hostfs/root/\$\$/losetup.trace "/var/lib/snapd/hostfs/root/lxd-ci/patch/losetup.core22" "\$@"
EOF
chmod +x patch/losetup
mount -o ro,bind patch/losetup /snap/core24/current/usr/sbin/losetup

echo "restarting LXD"
systemctl restart snap.lxd.daemon.service
fi

# Configure LXD
lxc network create lxdbr0
lxc profile device add default eth0 nic network=lxdbr0
Expand Down Expand Up @@ -132,15 +154,22 @@ for poolDriver in $poolDriverList; do
nsenter --mount=/run/snapd/ns/lxd.mnt rm "/var/snap/lxd/common/lxd/storage-pools/${poolName}/virtual-machines/v1/foo"

echo "==> Checking restore VM snapshot"
lxc restore v1 snap0
time lxc restore v1 snap0
continue
waitInstanceReady v1
[ "$(lxc exec v1 -- cat /root/foo.txt)" = "foo" ]

continue
lxc delete -f v1 v2
echo "==> Deleting storage pool"
lxc storage delete "${poolName}"
continue

echo "==> Checking VM filesystem volume was restored too"
nsenter --mount=/run/snapd/ns/lxd.mnt [ -f "/var/snap/lxd/common/lxd/storage-pools/${poolName}/virtual-machines/v1/foo" ]

echo "==> Checking VM can be copied with snapshots"
lxc copy v1 v2
time lxc copy v1 v2
Fixed Show fixed Hide fixed
[ "$(lxc query /1.0/instances/v2?recursion=1 | jq '.snapshots | length')" -eq "1" ]
lxc start v2
waitInstanceReady v2
Expand Down