does the guest have a snapshot ?
by Lentes, Bernd
Hi,
i'm cuurently a bit confused if a guest does have a valid snapshot or not.
This is the xml:
...
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='/var/lib/libvirt/images/crispor_1604/crispor_1604.sn'/>
<backingStore type='file' index='1'>
<format type='raw'/>
<source file='/var/lib/libvirt/images/crispor_1604/crispor_1604.img'/>
<backingStore/>
</backingStore>
<target dev='vda' bus='virtio'/>
<alias name='virtio-disk0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</disk>
...
both files are currently in access by the respective qemu process.
lsof:
qemu-kvm 19533 root 13u REG 253,0 29761732608 12091393 /var/lib/libvirt/images/crispor_1604/crispor_1604.sn
qemu-kvm 19533 root 14r REG 253,0 111561775513 44793857 /var/lib/libvirt/images/crispor_1604/crispor_1604.img
Here are both files:
pc60181:/var/lib/libvirt/images/crispor_1604 # ll
...
-rw------- 1 root root 111561775513 Oct 22 15:23 crispor_1604.img
-rw-r--r-- 1 root root 29761732608 Feb 7 15:13 crispor_1604.sn
crispor_1604.sn has a recent timestamp.
The snapshot is currently in use:
virsh # domblklist crispor_1604
Target Source
------------------------------------------------
vda /var/lib/libvirt/images/crispor_1604/crispor_1604.sn
But virsh does not show any snapshot:
virsh # snapshot-list crispor_1604
Name Creation Time State
------------------------------------------------------------
So i'm a bit confused. Does it have a valid snapshot or not. How can i find out and how can i get rid of it ?
Thanks.
Bernd
--
Bernd Lentes
Systemadministration
Institute for Metabolism and Cell Death (MCD)
Building 35.34 - Raum 208
HelmholtzZentrum münchen
bernd.lentes(a)helmholtz-muenchen.de
phone: +49 89 3187 1241
phone: +49 89 3187 3827
fax: +49 89 3187 2294
http://www.helmholtz-muenchen.de/mcd
Perfekt ist wer keine Fehler macht
Also sind Tote perfekt
Helmholtz Zentrum München
Helmholtz Zentrum Muenchen
Deutsches Forschungszentrum fuer Gesundheit und Umwelt (GmbH)
Ingolstaedter Landstr. 1
85764 Neuherberg
www.helmholtz-muenchen.de
Aufsichtsratsvorsitzende: MinDir.in Prof. Dr. Veronika von Messling
Geschaeftsfuehrung: Prof. Dr. med. Dr. h.c. Matthias Tschoep, Kerstin Guenther
Registergericht: Amtsgericht Muenchen HRB 6466
USt-IdNr: DE 129521671
4 years, 10 months
No DHCP on default network when guest has multiple interfaces
by Patrick O'Neill
Hello,
I am trying to boot a VM in libvirt that has 2 interfaces. The first
interface is connected to the default network and the second connects to a
bridge interface on the host. When the VM boots the first interface doesn't
receive an IP address from DHCP. It works when the VM only has one
interface though.
If I login to the VM using virsh console I noticed that in NetworkManager
the connection name and device are mixed
[root@localhost ~]# nmcli con show
NAME UUID TYPE DEVICE
eth0 cc31f368-0a43-4c85-bd15-6aaa3ca23b3d ethernet eth1
If I run 'dhclient eth0' the interface gets an IP address from the default
network as expected.
[root@localhost ~]# dhclient eth0
[root@localhost ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group
default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state
UP group default qlen 1000
link/ether 52:54:00:00:01:00 brd ff:ff:ff:ff:ff:ff
inet 192.168.122.10/24 brd 192.168.122.255 scope global dynamic eth0
valid_lft 3599sec preferred_lft 3599sec
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state
UP group default qlen 1000
link/ether 52:54:00:48:e3:b8 brd ff:ff:ff:ff:ff:ff
inet6 fe80::5054:ff:fe48:e3b8/64 scope link noprefixroute
valid_lft forever preferred_lft forever
The VM is created using the following command
virt-install --import --name ${VM_HOST_NAME} \
--memory 2048 --vcpus 2 --cpu host \
--disk
path=/var/lib/libvirt/images/${VM_HOST_NAME}.qcow2,format=qcow2,bus=virtio \
--network network=default \
--network bridge=bridge0,model=virtio \
--os-type=linux \
--os-variant=rhel7.6 \
--graphics none
Any ideas what could cause this problem? The guest OS is CentOS 7.7 and the
host is CentOS 8, but I have the same problem with a CentOS 7 hypervisor.
4 years, 10 months
Does Libvirt's json parser support single quoted string in qmp json string?
by Peter Luo
Hi All,
I’m using qmp command via “virsh qemu-monitor-command” to perform block related jobs.
And in my case, I execute block-commit to commit the changes in the top image to the base image which is encrypted.
So in the base parameter, I need a json string which is single quoted to support the encryption parameters.
However, the virsh is failed to parse the whole json qmp command.
Attempt 1: Single quote without backflash, failed
root@host:~# virsh qemu-monitor-command i-9wdfw2x8 "{\"execute\": \"block-commit\", \"arguments\": { \"device\": \"drive-virtio-disk2\", \"job-id\": \"job100\", \"base\":'json:{\"encrypt.key-secret\":\"vol-38973xjl.secret\",\"driver\":\"qcow2\",\"file\":{\"driver\":\"file\",\"filename\":\"/pitrix/data/container/vol-38973xjl.img\"}}', \"top\": \"/pitrix/data/container/vol-38973xjl_ss-2tw7v0mm.img\"}}"
error: internal error: cannot parse json {"execute": "block-commit", "arguments": { "device": "drive-virtio-disk2", "job-id": "job100", "base":'json:{"encrypt.key-secret":"vol-38973xjl.secret","driver":"qcow2","file":{"driver":"file","filename":"/pitrix/data/container/vol-38973xjl.img"}}', "top": "/pitrix/data/container/vol-38973xjl_ss-2tw7v0mm.img"}}: lexical error: invalid char in json text.
, "job-id": "job100", "base":'json:{"encrypt.key-secret":"vo
(right here) ------^
Attempt 2: Single quote with backflash, failed
root@host:~# virsh qemu-monitor-command i-9wdfw2x8 "{\"execute\": \"block-commit\", \"arguments\": { \"device\": \"drive-virtio-disk2\", \"job-id\": \"job100\", \"base\":\'json:{\"encrypt.key-secret\":\"vol-38973xjl.secret\",\"driver\":\"qcow2\",\"file\":{\"driver\":\"file\",\"filename\":\"/pitrix/data/container/vol-38973xjl.img\"}}\', \"top\": \"/pitrix/data/container/vol-38973xjl_ss-2tw7v0mm.img\"}}"
error: internal error: cannot parse json {"execute": "block-commit", "arguments": { "device": "drive-virtio-disk2", "job-id": "job100", "base":\'json:{"encrypt.key-secret":"vol-38973xjl.secret","driver":"qcow2","file":{"driver":"file","filename":"/pitrix/data/container/vol-38973xjl.img"}}\', "top": "/pitrix/data/container/vol-38973xjl_ss-2tw7v0mm.img"}}: lexical error: invalid char in json text.
, "job-id": "job100", "base":\'json:{"encrypt.key-secret":"v
(right here) ------^
My libvirt version is 5.7.0, libyajl is 2.1.0.
Thanks,
Peter Luo
4 years, 10 months
USB devices with same vendor:product id
by Maxime Accadia
Hi,
We have a VM with several USB devices attached. Everything works well, but sometimes, after a reboot of the host, some usb device get a different bus/device number and that prevent the reboot of the VM :
-------
error: Failed to start domain xxx
error: internal error: Did not find USB device 04b9:0300 bus:1 device:5
-------
I guess this is because we have multiple usb devices with the same vendor/product ID :
-------
<hostdev mode='subsystem' type='usb' managed='yes'>
<source>
<vendor id='0x04b9'/>
<product id='0x0300'/>
<address bus='2' device='4'/>
</source>
<alias name='hostdev0'/>
<address type='usb' bus='0' port='2'/>
</hostdev>
<hostdev mode='subsystem' type='usb' managed='yes'>
<source>
<vendor id='0x0529'/>
<product id='0x0001'/>
<address bus='1' device='7'/>
</source>
<alias name='hostdev1'/>
<address type='usb' bus='0' port='1.2'/>
</hostdev>
<hostdev mode='subsystem' type='usb' managed='yes'>
<source>
<vendor id='0x0529'/>
<product id='0x0001'/>
<address bus='2' device='3'/>
</source>
<alias name='hostdev2'/>
<address type='usb' bus='0' port='1.4'/>
</hostdev>
<hostdev mode='subsystem' type='usb' managed='yes'>
<source>
<vendor id='0x04b9'/>
<product id='0x0300'/>
<address bus='1' device='6'/>
</source>
<alias name='hostdev3'/>
<address type='usb' bus='0' port='1.1'/>
</hostdev>
-------
Any idea on how to handle this case ?
We were thinking about using udev, but it seems that libvirt only supports vendor/id (not unique in our case) and bus/device (not predictable) to identify usb devices.
Thanks,
Maxime Accadia
P.S. We use libvirt 4.0.0 on Ubuntu 18.04
4 years, 10 months