LXD - Non-persistent drive empty after server's power off

Hello Guys,

We’ve LXC VM hosted on our LXD node. The client requested to increase RAM and CPU, so we powered off the server, resized resources and boot the server back. But, after it’s booted, the non-persistent drive becomes completely empty:

On the server it was mounted to /media/2, folder shows only lost+found

I’ve accessed /var/lib/one/datastores/107/1442 and found out the image with 92 GB size:

I tried to readd it as persistent and mount to another VM but it’s still empty.

We always thought that non-persistent drives are stored until the VM is terminated and we just powerred off the machine.

Could someone please suggest what could be the case?

Can you post the VM log, it should be at /var/log/one/1442.log ?

Hello @dclavijo Sure, I’m attaching the log when I powerred off the instance to increase RAM and CPU and then boot it back:

Wed Mar 3 11:45:20 2021 [Z0][VM][I]: New LCM state is SHUTDOWN_POWEROFF
Wed Mar 3 11:45:37 2021 [Z0][VMM][I]: shutdown: — Stopping container —
Wed Mar 3 11:45:37 2021 [Z0][VMM][I]: shutdown: Processing disk 0
Wed Mar 3 11:45:37 2021 [Z0][VMM][I]: shutdown: Using qcow2 mapper for /var/lib/one/datastores/107/1442/disk.0
Wed Mar 3 11:45:37 2021 [Z0][VMM][I]: shutdown: Unmapping disk at /var/snap/lxd/common/lxd/storage-pools/default/containers/one-1442/rootfs
Wed Mar 3 11:45:37 2021 [Z0][VMM][I]: shutdown: Umounting disk mapped at /dev/nbd1p1
Wed Mar 3 11:45:37 2021 [Z0][VMM][I]: shutdown: Processing disk 2
Wed Mar 3 11:45:37 2021 [Z0][VMM][I]: shutdown: Using qcow2 mapper for /var/lib/one/datastores/107/1442/disk.2
Wed Mar 3 11:45:37 2021 [Z0][VMM][I]: shutdown: Unmapping disk at /var/lib/one/datastores/107/1442/mapper/disk.2
Wed Mar 3 11:45:37 2021 [Z0][VMM][I]: shutdown: Umounting disk mapped at /dev/nbd21
Wed Mar 3 11:45:37 2021 [Z0][VMM][I]: shutdown: Unmapping disk at /var/lib/one/datastores/107/1442/mapper/disk.1
Wed Mar 3 11:45:37 2021 [Z0][VMM][I]: shutdown: Umounting disk mapped at /dev/loop8
Wed Mar 3 11:45:37 2021 [Z0][VMM][I]: ExitCode: 0
Wed Mar 3 11:45:37 2021 [Z0][VMM][I]: Successfully execute virtualization driver operation: shutdown.
Wed Mar 3 11:45:38 2021 [Z0][VMM][I]: ExitCode: 0
Wed Mar 3 11:45:38 2021 [Z0][VMM][I]: Successfully execute network driver operation: clean.
Wed Mar 3 11:45:38 2021 [Z0][VM][I]: New state is POWEROFF
Wed Mar 3 11:45:38 2021 [Z0][VM][I]: New LCM state is LCM_INIT
Wed Mar 3 11:46:46 2021 [Z0][VM][I]: New state is ACTIVE
Wed Mar 3 11:46:46 2021 [Z0][VM][I]: New LCM state is BOOT_POWEROFF
Wed Mar 3 11:46:46 2021 [Z0][VMM][I]: Generating deployment file: /var/lib/one/vms/1442/deployment.4
Wed Mar 3 11:46:48 2021 [Z0][VMM][I]: Successfully execute transfer manager driver operation: tm_context.
Wed Mar 3 11:46:49 2021 [Z0][VMM][I]: ExitCode: 0
Wed Mar 3 11:46:49 2021 [Z0][VMM][I]: Successfully execute network driver operation: pre.
Wed Mar 3 11:47:11 2021 [Z0][VMM][I]: deploy: Processing disk 0
Wed Mar 3 11:47:11 2021 [Z0][VMM][I]: deploy: Using qcow2 mapper for /var/lib/one/datastores/107/1442/disk.0
Wed Mar 3 11:47:11 2021 [Z0][VMM][I]: deploy: Mapping disk at /var/snap/lxd/common/lxd/storage-pools/default/containers/one-1442/rootfs using device /dev/nbd1
Wed Mar 3 11:47:11 2021 [Z0][VMM][I]: deploy: Mounting /dev/nbd1p1 at /var/snap/lxd/common/lxd/storage-pools/default/containers/one-1442/rootfs
Wed Mar 3 11:47:11 2021 [Z0][VMM][I]: deploy: Processing disk 2
Wed Mar 3 11:47:11 2021 [Z0][VMM][I]: deploy: Using qcow2 mapper for /var/lib/one/datastores/107/1442/disk.2
Wed Mar 3 11:47:11 2021 [Z0][VMM][I]: deploy: Mapping disk at /var/lib/one/datastores/107/1442/mapper/disk.2 using device /dev/nbd9
Wed Mar 3 11:47:11 2021 [Z0][VMM][I]: deploy: Resizing filesystem ext4 on /dev/nbd9
Wed Mar 3 11:47:12 2021 [Z0][VMM][I]: deploy: Mounting /dev/nbd9 at /var/lib/one/datastores/107/1442/mapper/disk.2
Wed Mar 3 11:47:12 2021 [Z0][VMM][I]: deploy: Mapping disk at /var/lib/one/datastores/107/1442/mapper/disk.1 using device /dev/loop8
Wed Mar 3 11:47:12 2021 [Z0][VMM][I]: deploy: Mounting /dev/loop8 at /var/lib/one/datastores/107/1442/mapper/disk.1
Wed Mar 3 11:47:12 2021 [Z0][VMM][I]: deploy: — Starting container —
Wed Mar 3 11:47:12 2021 [Z0][VMM][I]: ExitCode: 0
Wed Mar 3 11:47:12 2021 [Z0][VMM][I]: Successfully execute virtualization driver operation: deploy.
Wed Mar 3 11:47:13 2021 [Z0][VMM][I]: ExitCode: 0
Wed Mar 3 11:47:13 2021 [Z0][VMM][I]: Successfully execute network driver operation: post.
Wed Mar 3 11:47:13 2021 [Z0][VM][I]: New LCM state is RUNNING

The driver shouldn’t wipe the non-persistent drive. If you can manage to reproduce this issue, please open a bug with all the details required.

@dclavijo yes, I’ve managed to reproduce it on test instance. will report as you suggested