Bug #3986

Disk detached but appears in virsh dumpxml

Added by Valerio Schiavoni almost 6 years ago. Updated almost 6 years ago.

Status:ClosedStart date:09/16/2015
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-
Resolution:fixed Pull request:
Affected Versions:OpenNebula 4.10

Description

Tested only on OpenNebula 4.10.
I've detached a disk from Sunstone, but virsh dumpxml IMG still lists it as one attached drive.

The disk was attached via Sunstone as a volatile 100GB disk, ext4 FS, on sd/sdb target. Then it was detached, reattached/deteached again, and once more.

 virsh -c qemu:///system dumpxml one-5481
<domain type='kvm' id='2'>
  <name>one-5481</name>
  <uuid>551d119c-b029-4e4b-a8da-9460e705919d</uuid>
  <memory unit='KiB'>7168000</memory>
  <currentMemory unit='KiB'>7168000</currentMemory>
  <vcpu placement='static'>8</vcpu>
  <cputune>
    <shares>8192</shares>
  </cputune>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-i440fx-trusty'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
  </features>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='writethrough'/>
      <source file='/var/lib/one//datastores/1/5481/disk.0'/>
      <target dev='hda' bus='ide'/>
      <alias name='ide0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/var/lib/one//datastores/1/5481/disk.1'/>
      <target dev='hdb' bus='ide'/>
      <readonly/>
      <alias name='ide0-0-1'/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/var/lib/one//datastores/1/5481/disk.2'/>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </disk>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/var/lib/one//datastores/1/5481/disk.2'/>
      <target dev='vdb' bus='virtio'/>
      <alias name='virtio-disk1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
    </disk>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/var/lib/one//datastores/1/5481/disk.2'/>
      <target dev='vdba' bus='virtio'/>
      <alias name='virtio-disk52'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </disk>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/var/lib/one//datastores/1/5481/disk.2'/>
      <target dev='sdb' bus='scsi'/>
      <alias name='scsi0-0-1'/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>
    <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>
    <controller type='scsi' index='0'>
      <alias name='scsi0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </controller>
    <controller type='scsi' index='1' model='virtio-scsi'>
      <alias name='scsi1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </controller>
    <interface type='bridge'>
      <mac address='02:00:ac:10:00:0c'/>
      <source bridge='onebr.2100'/>
      <target dev='vnet0'/>
      <model type='rtl8139'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='vnc' port='11381' autoport='no' listen='0.0.0.0'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <video>
      <model type='cirrus' vram='9216' heads='1'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </memballoon>
  </devices>
  <seclabel type='none'/>
</domain>

History

#1 Updated by Valerio Schiavoni almost 6 years ago

Host OS:
Ubuntu 14.04 LTS (GNU/Linux 3.13.0-29-generic x86_64)

Guest OS (the VM):
Linux oneguest 3.2.0-29-generic #46-Ubuntu SMP Fri Jul 27 17:03:23 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

qemu-system-x86_64 --version
QEMU emulator version 2.0.0 (Debian 2.0.0+dfsg-2ubuntu1.1), Copyright (c) 2003-2008 Fabrice Bellard

#2 Updated by Ruben S. Montero almost 6 years ago

Hi,

It seems that virsh detach command succeeds but actually the device is not detached. In 4.14 we have included a check to test this:

https://github.com/OpenNebula/one/blob/10442f8182b3137ee3f5fae471255d285523693c/src/vmm_mad/remotes/kvm/detach_disk#L32

You may try to replace the detach_disk script, and test again (do not forget to do a onehost sync)

#3 Updated by Ruben S. Montero almost 6 years ago

  • Status changed from Pending to Closed
  • Resolution set to fixed

moving it to close for Release 4.14, if it reappears will reopen

Also available in: Atom PDF