libvitで以下のような感じで起動に失敗する場合の対処法
1
2
| error: Failed to start domain dns
error: internal error: backing store for /var/lib/libvirt/images/dns.latest (/var/lib/libvirt/images/dns.20201226050002-snap) is self-referential
|
対象VMのスナップショット一覧を確認
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
| root@mks-m75q-1:~# ll /var/lib/libvirt/images/dns.*
-rw------- 1 libvirt-qemu kvm 2721972224 12月 18 11:00 /var/lib/libvirt/images/dns.20201212001502-snap
-rw------- 1 libvirt-qemu kvm 24838144 12月 18 11:00 /var/lib/libvirt/images/dns.20201218050002-snap
-rw------- 1 libvirt-qemu kvm 3407872 12月 18 09:48 /var/lib/libvirt/images/dns.20201218093744-snap
-rw------- 1 libvirt-qemu kvm 4521984 12月 18 09:59 /var/lib/libvirt/images/dns.20201218094746-snap
-rw------- 1 libvirt-qemu kvm 45416448 12月 18 10:16 /var/lib/libvirt/images/dns.20201218095908-snap
-rw------- 1 libvirt-qemu kvm 8781824 12月 18 10:36 /var/lib/libvirt/images/dns.20201218101540-snap
-rw------- 1 libvirt-qemu kvm 3670016 12月 18 10:39 /var/lib/libvirt/images/dns.20201218103530-snap
-rw------- 1 libvirt-qemu kvm 33816576 12月 18 10:48 /var/lib/libvirt/images/dns.20201218103837-snap
-rw------- 1 libvirt-qemu kvm 4194304 12月 18 10:51 /var/lib/libvirt/images/dns.20201218104836-snap
-rw------- 1 libvirt-qemu kvm 4259840 12月 18 10:56 /var/lib/libvirt/images/dns.20201218105121-snap
-rw------- 1 libvirt-qemu kvm 3735552 12月 18 11:00 /var/lib/libvirt/images/dns.20201218105635-snap
-rw------- 1 libvirt-qemu kvm 288358400 12月 19 05:00 /var/lib/libvirt/images/dns.20201218110021-snap
-rw------- 1 libvirt-qemu kvm 591462400 12月 20 05:00 /var/lib/libvirt/images/dns.20201219050001-snap
-rw------- 1 libvirt-qemu kvm 252968960 12月 21 05:00 /var/lib/libvirt/images/dns.20201220050001-snap
-rw------- 1 libvirt-qemu kvm 283901952 12月 22 05:00 /var/lib/libvirt/images/dns.20201221050001-snap
-rw------- 1 libvirt-qemu kvm 83034112 12月 23 05:00 /var/lib/libvirt/images/dns.20201222050001-snap
-rw------- 1 libvirt-qemu kvm 243269632 12月 24 05:00 /var/lib/libvirt/images/dns.20201223050001-snap
-rw------- 1 libvirt-qemu kvm 261750784 12月 25 05:00 /var/lib/libvirt/images/dns.20201224050002-snap
-rw------- 1 libvirt-qemu kvm 246022144 12月 26 05:00 /var/lib/libvirt/images/dns.20201225050001-snap
-rw------- 1 root root 225443840 12月 26 18:40 /var/lib/libvirt/images/dns.20201226050002-snap
lrwxrwxrwx 1 root root 47 12月 26 05:00 /var/lib/libvirt/images/dns.latest -> /var/lib/libvirt/images/dns.20201226050002-snap
-rw-rw-r-- 1 libvirt-qemu kvm 13776781312 12月 12 10:07 /var/lib/libvirt/images/dns.qcow2
|
各スナップショットのbacking fileを確認
何故か/var/lib/libvirt/images/dns.20201218104836-snapが/var/lib/libvirt/images/dns.latestを指してる
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
| root@mks-m75q-1:~# ls /var/lib/libvirt/images/dns.* | while read line;do qemu-img info $line;done | grep "backing file:"
image: /var/lib/libvirt/images/dns.20201212001502-snap
backing file: /var/lib/libvirt/images/dns.qcow2
image: /var/lib/libvirt/images/dns.20201218050002-snap
backing file: /var/lib/libvirt/images/dns.20201212001502-snap
image: /var/lib/libvirt/images/dns.20201218093744-snap
backing file: /var/lib/libvirt/images/dns.20201218050002-snap
image: /var/lib/libvirt/images/dns.20201218094746-snap
backing file: /var/lib/libvirt/images/dns.20201218093744-snap
image: /var/lib/libvirt/images/dns.20201218095908-snap
backing file: /var/lib/libvirt/images/dns.20201218094746-snap
image: /var/lib/libvirt/images/dns.20201218101540-snap
backing file: /var/lib/libvirt/images/dns.20201218095908-snap
image: /var/lib/libvirt/images/dns.20201218103530-snap
backing file: /var/lib/libvirt/images/dns.20201218101540-snap
image: /var/lib/libvirt/images/dns.20201218103837-snap
backing file: /var/lib/libvirt/images/dns.20201218103530-snap
image: /var/lib/libvirt/images/dns.20201218104836-snap
backing file: /var/lib/libvirt/images/dns.latest
image: /var/lib/libvirt/images/dns.20201218105121-snap
backing file: /var/lib/libvirt/images/dns.20201218104836-snap
image: /var/lib/libvirt/images/dns.20201218105635-snap
backing file: /var/lib/libvirt/images/dns.20201218105121-snap
image: /var/lib/libvirt/images/dns.20201218110021-snap
backing file: /var/lib/libvirt/images/dns.20201218105635-snap
image: /var/lib/libvirt/images/dns.20201219050001-snap
backing file: /var/lib/libvirt/images/dns.20201218110021-snap
image: /var/lib/libvirt/images/dns.20201220050001-snap
backing file: /var/lib/libvirt/images/dns.20201219050001-snap
image: /var/lib/libvirt/images/dns.20201221050001-snap
backing file: /var/lib/libvirt/images/dns.20201220050001-snap
image: /var/lib/libvirt/images/dns.20201222050001-snap
backing file: /var/lib/libvirt/images/dns.20201221050001-snap
image: /var/lib/libvirt/images/dns.20201223050001-snap
backing file: /var/lib/libvirt/images/dns.20201222050001-snap
image: /var/lib/libvirt/images/dns.20201224050002-snap
backing file: /var/lib/libvirt/images/dns.20201223050001-snap
image: /var/lib/libvirt/images/dns.20201225050001-snap
backing file: /var/lib/libvirt/images/dns.20201224050002-snap
image: /var/lib/libvirt/images/dns.20201226050002-snap
backing file: /var/lib/libvirt/images/dns.20201225050001-snap
image: /var/lib/libvirt/images/dns.latest
backing file: /var/lib/libvirt/images/dns.20201225050001-snap
image: /var/lib/libvirt/images/dns.qcow2
|
backing fileを正しいスナップショットに修正
1
| qemu-img rebase -u -f qcow2 -F qcow2 -b /var/lib/libvirt/images/dns.20201218103837-snap /var/lib/libvirt/images/dns.20201218104836-snap
|
backing fileが正しくなったのを確認
1
2
3
4
5
6
7
8
9
10
11
12
13
| root@mks-m75q-1:~# qemu-img info /var/lib/libvirt/images/dns.20201218104836-snap
image: /var/lib/libvirt/images/dns.20201218104836-snap
file format: qcow2
virtual size: 25 GiB (26843545600 bytes)
disk size: 3.95 MiB
cluster_size: 65536
backing file: /var/lib/libvirt/images/dns.20201218103837-snap
backing file format: qcow2
Format specific information:
compat: 1.1
lazy refcounts: false
refcount bits: 16
corrupt: false
|
参考情報
https://blog.programster.org/qemu-img-cheatsheet