[SOLVED] Snapshots of one LXC disappeared

TechQI

Member
Feb 20, 2021
6
0
6
34
Mayday! Mayday! Mayday!
Snapshots of one LXC disappeared, The others are OK, only this one.
1633848103175.png
 
Last edited:
hi,

Snapshots of one LXC disappeared, The others are OK, only this one.
how did that happen?

you can check if the snapshot still exists or if it's really deleted.

check your container configuration in /etc/pve/lxc/CTID.conf (CTID = 301 for you)

see which storage is rootfs pointing to, that's where the snapshots are saved.
afterwards go to the mountpoint of your storage and look for disks belonging to that CT, for example find /path/to/storage -name '*301*' 2>/dev/null should give you the files that have "301" in it, if you find a disk named like vm-301-disk-0@snapshotname that is your snapshot.

if the disk is still there you can add the missing snapshot into the configuration.

example container configuration with snapshot foo:
Code:
$ cat /etc/pve/lxc/111.conf
#fedora-33-default_20201115_amd64.tar.xz
arch: amd64
cores: 1
hostname: CT111
memory: 512
net0: name=eth0,bridge=vmbr0,firewall=1,hwaddr=DA:18:16:2B:D5:16,ip=dhcp,type=veth
ostype: fedora
parent: foo
rootfs: local-btrfs:111/vm-111-disk-0.raw,size=4G
swap: 512
unprivileged: 1

[foo]
arch: amd64
cores: 1
hostname: CT111
memory: 512
net0: name=eth0,bridge=vmbr0,firewall=1,hwaddr=DA:18:16:2B:D5:16,ip=dhcp,type=veth
ostype: unmanaged
rootfs: local-btrfs:111/vm-111-disk-0.raw,size=4G
snaptime: 1633942577
swap: 512
unprivileged: 1

if anything is unclear you can post your container and storage configuration here
 
hi,


how did that happen?

you can check if the snapshot still exists or if it's really deleted.

check your container configuration in /etc/pve/lxc/CTID.conf (CTID = 301 for you)

see which storage is rootfs pointing to, that's where the snapshots are saved.
afterwards go to the mountpoint of your storage and look for disks belonging to that CT, for example find /path/to/storage -name '*301*' 2>/dev/null should give you the files that have "301" in it, if you find a disk named like vm-301-disk-0@snapshotname that is your snapshot.

if the disk is still there you can add the missing snapshot into the configuration.

example container configuration with snapshot foo:
Code:
$ cat /etc/pve/lxc/111.conf
#fedora-33-default_20201115_amd64.tar.xz
arch: amd64
cores: 1
hostname: CT111
memory: 512
net0: name=eth0,bridge=vmbr0,firewall=1,hwaddr=DA:18:16:2B:D5:16,ip=dhcp,type=veth
ostype: fedora
parent: foo
rootfs: local-btrfs:111/vm-111-disk-0.raw,size=4G
swap: 512
unprivileged: 1

[foo]
arch: amd64
cores: 1
hostname: CT111
memory: 512
net0: name=eth0,bridge=vmbr0,firewall=1,hwaddr=DA:18:16:2B:D5:16,ip=dhcp,type=veth
ostype: unmanaged
rootfs: local-btrfs:111/vm-111-disk-0.raw,size=4G
snaptime: 1633942577
swap: 512
unprivileged: 1

if anything is unclear you can post your container and storage configuration here

It was just happened after I created the snapshot "installed". This is my output, all my snapshots are still exists.

And maybe I know how this problem happened:
1. I create snapshots "init -> base -> installed" on this CT "ds"(CTID: 301)
2. And this CT "ds"(CTID: 301) is cloned from "z-Rocky-8"(CTID: 188)
3. The last snapshot's name of "z-Rocky-8"(CTID: 188) is also named "base"
4. When I delete "parent: base" in init section of 301.conf, It shows up!
5. It is reappeared if I create a snapshot named "base" and the new CT is cloned from "z-Rocky-8"(CTID: 188)

Code:
$ cat /etc/pve/lxc/301.conf
arch: amd64
cores: 1
hostname: ds
memory: 512
net0: name=eth0,bridge=vmbr10,firewall=1,hwaddr=32:34:7C:94:C6:C9,ip=dhcp,ip6=dhcp,type=veth
ostype: centos
parent: installed
rootfs: vmlvm:vm-301-disk-0,size=1536M
snaptime: 1633845860
swap: 512
unprivileged: 1

[base]
arch: amd64
cores: 1
hostname: DirSrv-1
memory: 512
net0: name=eth0,bridge=vmbr10,firewall=1,hwaddr=32:34:7C:94:C6:C9,ip=dhcp,ip6=dhcp,type=veth
ostype: centos
parent: init
rootfs: vmlvm:vm-301-disk-0,size=1536M
snaptime: 1633847503
swap: 512
unprivileged: 1

[init]
arch: amd64
cores: 1
hostname: z-Rocky-8
memory: 512
net0: name=eth0,bridge=vmbr10,firewall=1,hwaddr=32:34:7C:94:C6:C9,ip=dhcp,ip6=dhcp,type=veth
ostype: centos
parent: base
rootfs: vmlvm:vm-301-disk-0,size=1G
snaptime: 1633846645
swap: 512
unprivileged: 1

[installed]
arch: amd64
cores: 1
hostname: ds
memory: 512
net0: name=eth0,bridge=vmbr10,firewall=1,hwaddr=32:34:7C:94:C6:C9,ip=dhcp,ip6=dhcp,type=veth
ostype: centos
parent: base
rootfs: vmlvm:vm-301-disk-0,size=1536M
snaptime: 1633867522
swap: 512
unprivileged: 1

---

I checked other *.conf files, There are also some incorrect "parent" property in the first snapshot section, if the CT is cloned from others, and the cloned source have any snapshots.
 
Last edited:
  • Like
Reactions: TechQI

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!