Bug 1792088 - error: internal error: unable to execute QEMU command 'blockdev-mirror': Cannot find device= nor node_name=
Summary: error: internal error: unable to execute QEMU command 'blockdev-mirror': Cann...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: libvirt
Version: 31
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Peter Krempa
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-01-17 01:50 UTC by Oliver
Modified: 2020-01-17 08:02 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-01-17 08:02:03 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Oliver 2020-01-17 01:50:49 UTC
Hi,

i try to test live-migration using this command:

#virsh migrate --copy-storage-all --verbose --live kvm1776
qemu+ssh://nodeb/system


Instant error message:

error: internal error: unable to execute QEMU command 'blockdev-mirror':
Cannot find device=drive-sata0-0-0 nor node_name=drive-sata0-0-0

If i use scsi or virtio its complaining with the corresponding names.
Example: drive-virtio-disk0

Its backed via zfs.



Source Host:


Virsh command line tool of libvirt 5.10.0
See web site at https://libvirt.org/

Compiled with support for:
 Hypervisors: QEMU/KVM LXC LibXL OpenVZ VMware PHYP VirtualBox ESX
Hyper-V Test
 Networking: Remote Network Bridging Interface netcf Nwfilter VirtualPort
 Storage: Dir Disk Filesystem SCSI Multipath iSCSI LVM RBD Sheepdog
Gluster ZFS
 Miscellaneous: Daemon Nodedev SELinux Secrets Debug DTrace Readline

# qemu-x86_64 --version
qemu-x86_64 version 4.2.0 (qemu-4.2.0-2.fc31)



Target Host:

Virsh command line tool of libvirt 6.0.0
See web site at https://libvirt.org/

Compiled with support for:
 Hypervisors: QEMU/KVM LXC LibXL OpenVZ VMware VirtualBox ESX Hyper-V Test
 Networking: Remote Network Bridging Interface netcf Nwfilter VirtualPort
 Storage: Dir Disk Filesystem SCSI Multipath iSCSI LVM RBD Sheepdog
Gluster ZFS
 Miscellaneous: Daemon Nodedev SELinux Secrets Debug DTrace Readline

# qemu-x86_64 --version
qemu-x86_64 version 4.2.0 (qemu-4.2.0-2.fc31)


both Fedora31.

The XML File:

<domain type='kvm' id='292'>
  <name>kvm1776</name>
  <uuid>a4668f0b-4a71-4956-b74a-a0d3af5fe1f8</uuid>
   <metadata>
    <libosinfo:libosinfo
xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
      <libosinfo:os id="http://debian.org/debian/10"/>
    </libosinfo:libosinfo>
  </metadata>
  <memory unit='KiB'>8192000</memory>
  <currentMemory unit='KiB'>8192000</currentMemory>
  <blkiotune>
    <device>
      <path>/dev/kvm-storage/465-9fe4507b-c232-47b3-9b3b-f885359449c6</path>
      <read_iops_sec>500</read_iops_sec>
      <write_iops_sec>500</write_iops_sec>
      <read_bytes_sec>51200000</read_bytes_sec>
      <write_bytes_sec>51200000</write_bytes_sec>
    </device>
  </blkiotune>
  <vcpu placement='static' current='4'>32</vcpu>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-q35-4.2'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
  </features>
  <cpu mode='custom' match='exact' check='full'>
    <model fallback='forbid'>IvyBridge-IBRS</model>
    <vendor>Intel</vendor>
    <feature policy='require' name='ss'/>
    <feature policy='require' name='vmx'/>
    <feature policy='require' name='pcid'/>
    <feature policy='require' name='hypervisor'/>
    <feature policy='require' name='arat'/>
    <feature policy='require' name='tsc_adjust'/>
    <feature policy='require' name='umip'/>
    <feature policy='require' name='md-clear'/>
    <feature policy='require' name='stibp'/>
    <feature policy='require' name='arch-capabilities'/>
    <feature policy='require' name='ssbd'/>
    <feature policy='require' name='xsaveopt'/>
    <feature policy='require' name='pdpe1gb'/>
    <feature policy='require' name='ibpb'/>
    <feature policy='require' name='amd-ssbd'/>
    <feature policy='require' name='skip-l1dfl-vmentry'/>
  </cpu>
  <clock offset='utc'>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='hpet' present='no'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <pm>
    <suspend-to-mem enabled='no'/>
    <suspend-to-disk enabled='no'/>
  </pm>
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='none' io='native'/>
      <source
dev='/dev/kvm-storage/465-9fe4507b-c232-47b3-9b3b-f885359449c6' index='2'/>
      <backingStore/>
      <target dev='sda' bus='sata'/>
      <alias name='sata0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu'/>
      <target dev='sdb' bus='sata'/>
      <readonly/>
      <alias name='sata0-0-1'/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>
    <controller type='usb' index='0' model='qemu-xhci' ports='15'>
      <alias name='usb'/>
      <address type='pci' domain='0x0000' bus='0x03' slot='0x00'
function='0x0'/>
    </controller>
    <controller type='sata' index='0'>
      <alias name='ide'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1f'
function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pcie-root'>
      <alias name='pcie.0'/>
    </controller>
    <controller type='pci' index='1' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='1' port='0x10'/>
      <alias name='pci.1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02'
function='0x0' multifunction='on'/>
    </controller>
    <controller type='pci' index='2' model='pcie-to-pci-bridge'>
      <model name='pcie-pci-bridge'/>
      <alias name='pci.2'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00'
function='0x0'/>
    </controller>
    <controller type='pci' index='3' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='3' port='0x11'/>
      <alias name='pci.3'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02'
function='0x1'/>
    </controller>
    <controller type='pci' index='4' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='4' port='0x12'/>
      <alias name='pci.4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02'
function='0x2'/>
    </controller>
    <controller type='pci' index='5' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='5' port='0x13'/>
      <alias name='pci.5'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02'
function='0x3'/>
    </controller>
    <controller type='pci' index='6' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='6' port='0x14'/>
      <alias name='pci.6'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02'
function='0x4'/>
    </controller>
    <controller type='pci' index='7' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='7' port='0x15'/>
      <alias name='pci.7'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02'
function='0x5'/>
    </controller>
    <controller type='pci' index='8' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='8' port='0x16'/>
      <alias name='pci.8'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02'
function='0x6'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <alias name='virtio-serial0'/>
      <address type='pci' domain='0x0000' bus='0x05' slot='0x00'
function='0x0'/>
    </controller>
    <interface type='bridge'>
      <mac address='16:c7:25:d4:23:14'/>
      <source network='Public Network'
portid='7291b4be-07a7-49ad-b6ce-b1a0593c96c3' bridge='ovsbr'/>
      <virtualport type='openvswitch'>
        <parameters interfaceid='a9ddd087-71ca-456f-bb7b-c2848d11a5a6'/>
      </virtualport>
      <target dev='k1776-5nEsy'/>
      <model type='rtl8139'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x01'
function='0x0'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/19'/>
      <target type='isa-serial' port='0'>
        <model name='isa-serial'/>
      </target>
      <alias name='serial0'/>
    </serial>
    <console type='pty' tty='/dev/pts/19'>
      <source path='/dev/pts/19'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <channel type='unix'>
      <source mode='bind'
path='/var/lib/libvirt/qemu/channel/target/domain-292-kvm1776/org.qemu.guest_agent.0'/>
      <target type='virtio' name='org.qemu.guest_agent.0'
state='disconnected'/>
      <alias name='channel0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <input type='tablet' bus='usb'>
      <alias name='input0'/>
      <address type='usb' bus='0' port='1'/>
    </input>
    <input type='mouse' bus='ps2'>
      <alias name='input1'/>
    </input>
    <input type='keyboard' bus='ps2'>
      <alias name='input2'/>
    </input>
    <graphics type='vnc' port='5917' autoport='yes' listen='0.0.0.0'
keymap='en-us'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='16384'
heads='1' primary='yes'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01'
function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x06' slot='0x00'
function='0x0'/>
    </memballoon>
    <rng model='virtio'>
      <backend model='random'>/dev/urandom</backend>
      <alias name='rng0'/>
      <address type='pci' domain='0x0000' bus='0x07' slot='0x00'
function='0x0'/>
    </rng>
  </devices>
  <seclabel type='dynamic' model='dac' relabel='yes'>
    <label>+107:+107</label>
    <imagelabel>+107:+107</imagelabel>
  </seclabel>
</domain>

Comment 1 Peter Krempa 2020-01-17 08:02:03 UTC
This was fixed in libvirt-6.0 which was released yesterday with the following patchset:

commit f5259ba4027807e82ce040f63db40efe56e86925
Author: Peter Krempa <pkrempa>
Date:   Fri Dec 6 18:50:46 2019 +0100

    qemu: migration: Properly setup mirror for blockdev configurations
    
    With blockdev we need to refer to the nodename of the disk source image
    as the source argument for the blockdev-mirror operation while still
    keeping the old job name. With blockdev we must also persist the job in
    qemu.
    
    Signed-off-by: Peter Krempa <pkrempa>
    Reviewed-by: Eric Blake <eblake>

commit 3e35156bd18badf9757cad0904493e7eda530320
Author: Peter Krempa <pkrempa>
Date:   Fri Dec 6 18:44:22 2019 +0100

    qemu: migration: Mention disk target rather than the drive name in debug msg
    
    Signed-off-by: Peter Krempa <pkrempa>
    Reviewed-by: Eric Blake <eblake>

commit 69abc80f5e58ba2c0f30e1d7296be8524631246d
Author: Peter Krempa <pkrempa>
Date:   Fri Dec 6 17:47:46 2019 +0100

    qemu: migration: Split out setup of the migration target
    
    Separate out allocation of the virStorageSource corresponding to the
    target NBD export of the migration.
    
    As part of the splitout we allocate the export name explicitly as that
    one must not change regardless whether blockdev is used or not to
    provide compatibility.
    
    Signed-off-by: Peter Krempa <pkrempa>
    Reviewed-by: Eric Blake <eblake>

commit 0d0b490a32be5cb4f8a3b103784e1f10ce6c51ce
Author: Peter Krempa <pkrempa>
Date:   Fri Dec 6 17:46:29 2019 +0100

    qemu: blockjob: Allow NULL 'mirror' for block copy jobs due to migration
    
    The non-shared-storage migration tracks the storage source used
    explicitly in the migration data so we must allow for processing of the
    block job which has NULL mirror as the mirror will not be populated.
    
    Signed-off-by: Peter Krempa <pkrempa>
    Reviewed-by: Eric Blake <eblake>

commit e1910a1f3b5a1926bc130ddd16ebee0a3cf8db27
Author: Peter Krempa <pkrempa>
Date:   Fri Dec 6 17:26:01 2019 +0100

    qemu: migration: Simplify cleanup in qemuMigrationSrcNBDCopyCancelOne
    
    Now that the cleanup section does not exist remove the label.
    
    Signed-off-by: Peter Krempa <pkrempa>
    Reviewed-by: Eric Blake <eblake>

commit 37e801340ac6902e63e83983f5e606fbc38a23e6
Author: Peter Krempa <pkrempa>
Date:   Fri Dec 6 17:22:53 2019 +0100

    qemu: migration: Access job name from job struct
    
    qemuMigrationSrcNBDCopyCancelOne uses the block job data structure but
    generated it's own job name rather than taking it from the block job
    data.
    
    Signed-off-by: Peter Krempa <pkrempa>
    Reviewed-by: Eric Blake <eblake>

commit 5339f57a0bf958f5c432c6ae6b655bf234ea0971
Author: Peter Krempa <pkrempa>
Date:   Fri Dec 6 17:02:33 2019 +0100

    qemu: migration: Properly export backend for NBD storage migration
    
    With -blockdev we must use the nodename as the export but we must keep
    the name of the export as it was before to ensure compatiblity.
    
    Signed-off-by: Peter Krempa <pkrempa>
    Reviewed-by: Eric Blake <eblake>

commit 83137f5d3710ffe5a36ba9218ddc382d6675dc32
Author: Peter Krempa <pkrempa>
Date:   Fri Dec 6 16:54:33 2019 +0100

    qemu: migration: Simplify handling of 'diskAlias' when adding NBD exports
    
    Declare the variable inside the loop with automatic clearing.
    
    Signed-off-by: Peter Krempa <pkrempa>
    Reviewed-by: Eric Blake <eblake>


Note You need to log in before you can comment on or make changes to this bug.