O comando info block
monitor mostrará os dispositivos de bloco conectados ao convidado.
[root@makrura ~]# virsh qemu-monitor-command hyperv-server-2016 --hmp "info block"
drive-scsi0-0-0-0 (#block118): /var/lib/libvirt/images/hyperv-server-2016.qcow2 (qcow2)
Attached to: scsi0-0-0-0
Cache mode: writeback
drive-sata0-0-1 (#block396): /var/lib/libvirt/isos/14393.0.160916-1106.RS1_REFRESH_SERVERHYPERCORE_OEM_X64FRE_EN-US.ISO (raw, read-only)
Attached to: sata0-0-1
Removable device: not locked, tray closed
Cache mode: writeback
drive-sata0-0-2 (#block542): /usr/share/virtio-win/virtio-win-0.1.141.iso (raw, read-only)
Attached to: sata0-0-2
Removable device: not locked, tray closed
Cache mode: writeback
Aqui, o nome do dispositivo de disco é drive-scsi0-0-0-0
. (Os outros dispositivos de bloco são dispositivos de CDROM virtuais.) Mas o que drive_backup
espera é o node_name, que aparece entre parênteses, ou seja, #block118
.
Também parece que você não tem a sintaxe bem correta. Da ajuda:
drive_backup [-n] [-f] [-c] device target [format] -- initiates a point-in-time
copy for a device. The device's contents are
copied to the new image file, excluding data that
is written after the command is started.
The -n flag requests QEMU to reuse the image found
in new-image-file, instead of recreating it from scratch.
The -f flag requests QEMU to copy the whole disk,
so that the result does not need a backing file.
The -c flag requests QEMU to compress backup data
(if the target format supports it).
Então você faria algo como:
[root@makrura ~]# virsh qemu-monitor-command hyperv-server-2016 --hmp "drive_backup -f #block118 /tmp/test.qcow2 qcow2"
[root@makrura ~]# ls -l /tmp/test.qcow2
-rw-r--r--. 1 qemu qemu 982712320 Aug 7 11:19 /tmp/test.qcow2