RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1255287 - Detaching a disk does not work, although a success is returned
Summary: Detaching a disk does not work, although a success is returned
Keywords:
Status: CLOSED DUPLICATE of bug 993631
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.1
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: rc
: ---
Assignee: Libvirt Maintainers
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 1172230
TreeView+ depends on / blocked
 
Reported: 2015-08-20 08:30 UTC by Amit Aviram
Modified: 2015-08-20 16:55 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-08-20 16:55:53 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
logs (18.60 MB, text/plain)
2015-08-20 08:33 UTC, Amit Aviram
no flags Details

Description Amit Aviram 2015-08-20 08:30:04 UTC
Description of problem:
After multiple plugging & hotplugging a disk- trying to detach it with detach-device in virsh returns "Device detached successfully", but the disk is still not detached.

*******************************************************
** vm's dumpxml:
*******************************************************
<domain type='kvm' id='8'>
  <name>VM1</name>
  <uuid>380e97f1-ddbf-4c4f-8d92-41c44a21f88f</uuid>
  <memory unit='KiB'>1048576</memory>
  <currentMemory unit='KiB'>1048576</currentMemory>
  <vcpu placement='static' current='1'>16</vcpu>
  <cputune>
    <shares>1020</shares>
  </cputune>
  <numatune>
    <memory mode='interleave' nodeset='0'/>
  </numatune>
  <resource>
    <partition>/machine</partition>
  </resource>
    <sysinfo type='smbios'>
      <system>
        <entry name='manufacturer'>oVirt</entry>
        <entry name='product'>oVirt Node</entry>
        <entry name='version'>7.1-1.el7</entry>
        <entry name='serial'>63F9AB7B-B902-4858-9E30-14D2E2AFD640</entry>
        <entry name='uuid'>380e97f1-ddbf-4c4f-8d92-41c44a21f88f</entry>
      </system>
    </sysinfo>
  <os>
    <type arch='x86_64' machine='pc-i440fx-rhel7.1.0'>hvm</type>
    <smbios mode='sysinfo'/>
  </os>
  <features>
    <acpi/>
  </features>
  <cpu mode='custom' match='exact'>
    <model fallback='allow'>SandyBridge</model>
    <topology sockets='16' cores='1' threads='1'/>
    <numa>
      <cell id='0' cpus='0,1' memory='1048576'/>
    </numa>
  </cpu>
  <clock offset='variable' adjustment='0' basis='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>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source startupPolicy='optional'/>
      <backingStore/>
      <target dev='hdc' bus='ide'/>
      <readonly/>
      <serial></serial>
      <alias name='ide0-1-0'/>
      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
    </disk>
    <disk type='file' device='disk' snapshot='no'>
      <driver name='qemu' type='raw' cache='none' error_policy='stop' io='threads'/>
      <source file='/rhev/data-center/00000001-0001-0001-0001-0000000001d4/477afe45-c8f5-4985-81ba-b9e2603bb6d9/images/9f09e0db-cc0b-4a93-826b-c4a3fda0b208/d3da17b9-cef8-40a8-8fa3-4c0afe5f6176'>
        <seclabel model='selinux' labelskip='yes'/>
      </source>
      <backingStore/>
      <target dev='vda' bus='virtio'/>
      <serial>9f09e0db-cc0b-4a93-826b-c4a3fda0b208</serial>
      <boot order='1'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </disk>
    <disk type='file' device='disk' snapshot='no'>
      <driver name='qemu' type='raw' cache='none' error_policy='stop' io='threads'/>
      <source file='/rhev/data-center/00000001-0001-0001-0001-0000000001d4/477afe45-c8f5-4985-81ba-b9e2603bb6d9/images/f370841b-4caf-4272-95fb-c567f59e4c1b/c5100145-bd0a-45aa-a109-0b5d6e7ceac3'>
        <seclabel model='selinux' labelskip='yes'/>
      </source>
      <backingStore/>
      <target dev='vdnq' bus='virtio'/>
      <serial>f370841b-4caf-4272-95fb-c567f59e4c1b</serial>
      <alias name='virtio-disk380'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
    </disk>
    <disk type='file' device='disk' snapshot='no'>
      <driver name='qemu' type='raw' cache='none' error_policy='stop' io='threads'/>
      <source file='/rhev/data-center/00000001-0001-0001-0001-0000000001d4/477afe45-c8f5-4985-81ba-b9e2603bb6d9/images/fc2a7a5e-6e9b-4765-82d3-8bf5f57a643b/da05792a-9fc4-438d-8ba7-9127f327c613'>
        <seclabel model='selinux' labelskip='yes'/>
      </source>
      <backingStore/>
      <target dev='vdnr' bus='virtio'/>
      <serial>fc2a7a5e-6e9b-4765-82d3-8bf5f57a643b</serial>
      <alias name='virtio-disk381'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0b' function='0x0'/>
    </disk>
    <controller type='scsi' index='0' model='virtio-scsi'>
      <alias name='scsi0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </controller>
    <controller type='virtio-serial' index='0' ports='16'>
      <alias name='virtio-serial0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </controller>
    <controller type='usb' index='0'>
      <alias name='usb0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'>
      <alias name='pci.0'/>
    </controller>
    <controller type='ide' index='0'>
      <alias name='ide0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <interface type='bridge'>
      <mac address='00:1a:4a:16:01:51'/>
      <source bridge='ovirtmgmt'/>
      <bandwidth>
      </bandwidth>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <filterref filter='vdsm-no-mac-spoofing'/>
      <link state='up'/>
      <boot order='2'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <channel type='unix'>
      <source mode='bind' path='/var/lib/libvirt/qemu/channels/380e97f1-ddbf-4c4f-8d92-41c44a21f88f.com.redhat.rhevm.vdsm'/>
      <target type='virtio' name='com.redhat.rhevm.vdsm' state='disconnected'/>
      <alias name='channel0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <channel type='unix'>
      <source mode='bind' path='/var/lib/libvirt/qemu/channels/380e97f1-ddbf-4c4f-8d92-41c44a21f88f.org.qemu.guest_agent.0'/>
      <target type='virtio' name='org.qemu.guest_agent.0' state='disconnected'/>
      <alias name='channel1'/>
      <address type='virtio-serial' controller='0' bus='0' port='2'/>
    </channel>
    <channel type='spicevmc'>
      <target type='virtio' name='com.redhat.spice.0' state='disconnected'/>
      <alias name='channel2'/>
      <address type='virtio-serial' controller='0' bus='0' port='3'/>
    </channel>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='spice' port='5900' tlsPort='5901' autoport='yes' listen='0' passwdValidTo='1970-01-01T00:00:01'>
      <listen type='address' address='0'/>
    </graphics>
    <video>
      <model type='qxl' ram='65536' vram='32768' vgamem='16384' heads='1'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='none'>
      <alias name='balloon0'/>
    </memballoon>
  </devices>
  <seclabel type='dynamic' model='selinux' relabel='yes'>
    <label>system_u:system_r:svirt_t:s0:c188,c214</label>
    <imagelabel>system_u:object_r:svirt_image_t:s0:c188,c214</imagelabel>
  </seclabel>
</domain>




*******************************************************
** requested device to detach:
*******************************************************

<disk device="disk" snapshot="no" type="file">
        <address bus="0x00" domain="0x0000" function="0x0" slot="0x0a" type="pci"/>
        <source file="/rhev/data-center/00000001-0001-0001-0001-0000000001d4/477afe45-c8f5-4985-81ba-b9e2603bb6d9/images/f370841b-4caf-4272-95fb-c567f59e4c1b/c5100145-bd0a-45aa-a109-0b5d6e7ceac3"/>
        <target bus="virtio" dev="vdnq"/>
        <serial>f370841b-4caf-4272-95fb-c567f59e4c1b</serial>
        <driver cache="none" error_policy="stop" io="threads" name="qemu" type="raw"/>
</disk>


*****

After requesting to detach this device, the VM's XML stays the same, although libvirt returns "Device detached successfully".



Version-Release number of selected component (if applicable):

# rpm -qa | libvirtd 
2015-08-20 08:20:30.561+0000: 20063: info : libvirt version: 1.2.8, package: 16.el7_1.3 (Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>, 2015-04-02-12:11:36, x86-024.build.eng.bos.redhat.com)
2015-08-20 08:20:30.561+0000: 20063: debug : virLogParseOutputs:1105 : outputs=1:file:/var/log/libvirt/libvirtd.log


How reproducible:
100%


Steps to Reproduce:
1. multiple detach & attach multiple disks
2. at some point, one of the disks will no longer be detached successfully.


Expected results:
Should be detached successfuly, or return a proper error message.

Additional info:
Logs are attached.

Comment 1 Amit Aviram 2015-08-20 08:33:44 UTC
Created attachment 1065162 [details]
logs

Comment 2 Amit Aviram 2015-08-20 08:35:33 UTC
An environment can be supplied if needed.

Comment 3 Jiri Denemark 2015-08-20 16:55:15 UTC
In short, the only bug here is that message virsh reports. It should say that the device was requested to be detached, but it should not really report any error.

Detaching a device requires a guest cooperation (in general, exceptions exist) and thus the libvirt API is only designed (and documented) to request a device to be removed. A management application or a user needs to either wait for an event reporting successful removal of the device or needs to check the domain's XML to see if the device is still there or not.

Comment 4 Jiri Denemark 2015-08-20 16:55:53 UTC

*** This bug has been marked as a duplicate of bug 993631 ***


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