Hello all,
I find out that my lxd server can launch/start/stop/snapshot the virtual machine, but when I try to delete the snapshot, it throws a error:
oot@dev-physical-0-19:~# lxc list
+------------------------------+---------+---------------------------------+------+-----------------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+------------------------------+---------+---------------------------------+------+-----------------+-----------+
| centos-7-base | STOPPED | | | CONTAINER | 1 |
+------------------------------+---------+---------------------------------+------+-----------------+-----------+
| centos-7-kvm-base | STOPPED | | | VIRTUAL-MACHINE | 1 |
+------------------------------+---------+---------------------------------+------+-----------------+-----------+
| centos-8-base | STOPPED | | | CONTAINER | 1 |
+------------------------------+---------+---------------------------------+------+-----------------+-----------+
| centos-8-kvm-base | STOPPED | | | VIRTUAL-MACHINE | 2 |
root@dev-physical-0-19:~# ll /data/lxc/virtual-machines-snapshots/centos-8-kvm-base/
total 0
drwx------ 4 root root 40 Mar 9 10:25 ./
drwx--x--x 4 root root 68 Mar 9 03:39 ../
d--x------ 4 root root 237 Mar 8 05:19 1.0/
d--x------ 4 root root 237 Mar 8 05:19 2.0/
root@dev-physical-0-19:~# lxc delete centos-8-kvm-base/1.0
Error: Failed to remove '/var/snap/lxd/common/lxd/storage-pools/lxc-storage/virtual-machines-snapshots/centos-8-kvm-base/1.0': unlinkat /var/snap/lxd/common/lxd/storage-pools/lxc-storage/virtual-machines-snapshots/centos-8-kvm-base/1.0/config: read-only file system
root@dev-physical-0-19:~# lxc delete centos-8-kvm-base/2.0
Error: Failed to remove '/var/snap/lxd/common/lxd/storage-pools/lxc-storage/virtual-machines-snapshots/centos-8-kvm-base/2.0': unlinkat /var/snap/lxd/common/lxd/storage-pools/lxc-storage/virtual-machines-snapshots/centos-8-kvm-base/2.0/config: read-only file system
I try to solve the problem, but the directory is very strange:
root@dev-physical-0-19:~# ll /var/snap/lxd/common/lxd/storage-pools/lxc-storage/virtual-machines-snapshots/
ls: cannot access '/var/snap/lxd/common/lxd/storage-pools/lxc-storage/virtual-machines-snapshots/': No such file or directory
root@dev-physical-0-19:~# ll /var/snap/lxd/common/lxd/storage-pools/lxc-storage
total 8
drwx--x--x 2 root root 4096 Mar 8 04:25 ./
drwx--x--x 3 root root 4096 Mar 8 05:37 ../
The directory is not exist. I am failing to understand this issue and how to fix it.
Env Information:
root@dev-physical-0-19:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 21.10
Release: 21.10
Codename: impish
root@dev-physical-0-19:~# lxc version
Client version: 4.23
Server version: 4.23
root@dev-physical-0-19:~# snap services
Service Startup Current Notes
lxd.activate enabled inactive -
lxd.daemon enabled active socket-activated
lxd.user-daemon enabled inactive socket-activated
root@dev-physical-0-19:~# snap logs lxd
2022-03-08T07:50:06Z lxd.daemon[2738]: - loadavg_daemon
2022-03-08T07:50:06Z lxd.daemon[2738]: - pidfds
2022-03-08T07:50:07Z lxd.daemon[2477]: => Starting LXD
2022-03-08T07:50:07Z lxd.daemon[2757]: t=2022-03-08T07:50:07+0000 lvl=warn msg=" - Couldn't find the CGroup blkio.weight, disk priority will be ignored"
2022-03-08T07:50:08Z systemd[1]: snap.lxd.activate.service: Deactivated successfully.
2022-03-08T07:50:08Z systemd[1]: Finished Service for snap application lxd.activate.
2022-03-08T07:50:09Z lxd.daemon[2477]: => LXD is ready
2022-03-09T02:35:55Z lxd.daemon[2757]: t=2022-03-09T02:35:55+0000 lvl=warn msg="Detected poll(POLLNVAL) event."
2022-03-09T10:39:49Z lxd.daemon[2757]: t=2022-03-09T10:39:49+0000 lvl=eror msg="DeleteSnapshots: Failed to delete the snapshot" err="Failed to remove '/var/snap/lxd/common/lxd/storage-pools/lxc-storage/virtual-machines-snapshots/centos-8-kvm-base/1.0': unlinkat /var/snap/lxd/common/lxd/storage-pools/lxc-storage/virtual-machines-snapshots/centos-8-kvm-base/1.0/config: read-only file system" instance=centos-8-kvm-base project=default snapshot=centos-8-kvm-base/1.0
2022-03-09T10:39:49Z lxd.daemon[2757]: t=2022-03-09T10:39:49+0000 lvl=eror msg="DeleteSnapshots: Failed to delete the snapshot" err="Failed to remove '/var/snap/lxd/common/lxd/storage-pools/lxc-storage/virtual-machines-snapshots/centos-8-kvm-base/2.0': unlinkat /var/snap/lxd/common/lxd/storage-pools/lxc-storage/virtual-machines-snapshots/centos-8-kvm-base/2.0/config: read-only file system" instance=centos-8-kvm-base project=default snapshot=centos-8-kvm-base/2.0