# Unable to hot detach virtio datadisk

**URL:** <https://forum.opennebula.io/t/unable-to-hot-detach-virtio-datadisk/1573>\
**Category:** Product Support\
**Created:** [December 9, 2015, 4:04pm UTC](https://forum.opennebula.io/t/unable-to-hot-detach-virtio-datadisk/1573 "2015-12-09T16:04:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kiranranjane](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/kiranranjane/32/6207_2.png) [@kiranranjane](https://forum.opennebula.io/u/kiranranjane)\
**Post date:** [December 9, 2015, 4:04pm UTC](https://forum.opennebula.io/t/unable-to-hot-detach-virtio-datadisk/1573/1 "2015-12-09T16:04:21Z")

</div>

Hello,

I have installed 4.14.2 and trying to detach disk from a Windows VM and unable to do so, I am able to attach a disk to running VM however detaching gives a following error -

> Wed Dec 9 21:21:55 2015 [Z0][VMM][I]: VM Disk successfully attached.  
> Wed Dec 9 21:21:55 2015 [Z0][VM][I]: New LCM state is RUNNING  
> Wed Dec 9 21:24:30 2015 [Z0][VM][I]: New LCM state is HOTPLUG  
> Wed Dec 9 21:24:36 2015 [Z0][VMM][I]: Command execution fail: /var/tmp/one/vmm/kvm/detach\_disk ‘one-17’ ‘/var/lib/one//datastores/0/17/disk.2’ ‘vdb’ ‘1’ 17 kvmnode1.local  
> Wed Dec 9 21:24:36 2015 [Z0][VMM][E]: Could not detach vdb from one-17  
> Wed Dec 9 21:24:36 2015 [Z0][VMM][I]: ExitCode: 255  
> Wed Dec 9 21:24:36 2015 [Z0][VMM][I]: Failed to execute virtualization driver operation: detach\_disk.  
> Wed Dec 9 21:24:36 2015 [Z0][VMM][E]: Error detaching VM Disk: Could not detach vdb from one-17  
> Wed Dec 9 21:24:36 2015 [Z0][VM][I]: New LCM state is RUNNING

Powering off the VM and then detaching the disk removes the disk from sunstone however it still shows in the datastore VM folder -

> /var/lib/one/datastores/0/17$ ls -lh  
> total 368K  
> -rw-rw-r-- 1 oneadmin oneadmin 1.1K Dec 9 19:09 deployment.0  
> lrwxrwxrwx 1 oneadmin oneadmin 58 Dec 9 19:09 disk.0 → /var/lib/one/datastores/1/e3cc8a9714df4c67109666a621e70338  
> -rw-rw-r-- 1 oneadmin oneadmin 364K Dec 9 19:09 disk.1  
> lrwxrwxrwx 1 oneadmin oneadmin 35 Dec 9 19:09 disk.1.iso → /var/lib/one/datastores/0/17/disk.1  
> lrwxrwxrwx 1 oneadmin oneadmin 58 Dec 9 21:21 disk.2 → /var/lib/one/datastores/1/486d8facef952a897e378069fc503cf6

I tried it on different VM and having same issue while detaching.

Do you have any suggestions on this or anyone have encountered this.

Regards  
Kiran Ranjane

---

<div class="post-metadata">

**Author:** ![anandharaj](https://avatars.discourse-cdn.com/v4/letter/a/6bbea6/32.png) [@anandharaj](https://forum.opennebula.io/u/anandharaj)\
**Post date:** [December 10, 2015, 6:29am UTC](https://forum.opennebula.io/t/unable-to-hot-detach-virtio-datadisk/1573/2 "2015-12-10T06:29:09Z")

</div>

[quote=“kiranranjane, post:1, topic:1573”]  
I have installed 4.14.2 and trying to detach disk from a Windows VM and unable to do so  
[/quote] As far as i know, you can only detach “SD” type of disk.[quote=“kiranranjane, post:1, topic:1573”]  
Powering off the VM and then detaching the disk removes the disk from sunstone however it still shows in the datastore VM folder  
[/quote] It will only remove from the VM template, not delete the file from filesystem.

---

<div class="post-metadata">

**Author:** ![kiranranjane](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/kiranranjane/32/6207_2.png) [@kiranranjane](https://forum.opennebula.io/u/kiranranjane)\
**Post date:** [December 10, 2015, 1:50pm UTC](https://forum.opennebula.io/t/unable-to-hot-detach-virtio-datadisk/1573/3 "2015-12-10T13:50:51Z")

</div>

Hello Anandharaj,

I am using vd - virtio disk with virtio drivers installed on the virtual machine and they support hot detach but it not working and cannot find any relevant logs related to it.

Regards  
Kiran Ranjane

---

<div class="post-metadata">

**Author:** ![kiranranjane](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/kiranranjane/32/6207_2.png) [@kiranranjane](https://forum.opennebula.io/u/kiranranjane)\
**Post date:** [December 11, 2015, 2:51pm UTC](https://forum.opennebula.io/t/unable-to-hot-detach-virtio-datadisk/1573/4 "2015-12-11T14:51:29Z")

</div>

Hello,

I found these errors in /var/log/libvirt logs and it seems to be related to disk detach issue :-

> 2015-12-09 17:40:18.341+0000: 9448: error : qemuProcessFindDomainDiskByAlias:405 : internal error: no disk found with alias  
> 2015-12-09 17:40:19.341+0000: 9448: error : qemuProcessFindDomainDiskByAlias:405 : internal error: no disk found with alias  
> 2015-12-09 17:40:20.341+0000: 9448: error : qemuProcessFindDomainDiskByAlias:405 : internal error: no disk found with alias  
> 2015-12-09 17:40:20.341+0000: 9448: error : qemuProcessFindDomainDiskByAlias:405 : internal error: no disk found with alias  
> 2015-12-09 17:40:21.356+0000: 9448: error : qemuProcessFindDomainDiskByAlias:405 : internal error: no disk found with alias  
> 2015-12-09 17:40:22.372+0000: 9448: error : qemuProcessFindDomainDiskByAlias:405 : internal error: no disk found with alias  
> 2015-12-09 17:40:23.388+0000: 9448: error : qemuProcessFindDomainDiskByAlias:405 : internal error: no disk found with alias  
> 2015-12-09 17:40:24.403+0000: 9448: error : qemuProcessFindDomainDiskByAlias:405 : internal error: no disk found with alias  
> 2015-12-09 17:40:24.404+0000: 9448: error : qemuProcessFindDomainDiskByAlias:405 : internal error: no disk found with alias  
> 2015-12-09 17:40:25.403+0000: 9448: error : qemuProcessFindDomainDiskByAlias:405 : internal error: no disk found with alias  
> 2015-12-09 17:40:26.419+0000: 9448: error : qemuProcessFindDomainDiskByAlias:405 : internal error: no disk found with alias  
> 2015-12-09 17:40:27.435+0000: 9448: error : qemuProcessFindDomainDiskByAlias:405 : internal error: no disk found with alias  
> 2015-12-09 17:40:28.450+0000: 9448: error : qemuProcessFindDomainDiskByAlias:405 : internal error: no disk found with alias

The detach was working fine until I powered off the VM and then detached both the disk, bootdisk and datadisk from the VM, changed IO and cache setting of the disk and atached it back to the VM and powered it on.

After that the detach never worked. I ran ondb fsck command and did not find any errors. So not sure what to do next

I also ran the command directly

/var/tmp/one/vmm/kvm/detach\_disk ‘one-17’ ‘/var/lib/one//datastores/0/17/disk.3’ ‘vdb’ ‘1’ 17 kvmnode1.local  
ERROR MESSAGE --8\<------  
Could not detach vdb from one-17  
ERROR MESSAGE ------\>8–

Regards  
Kiran Ranjane

---

<div class="post-metadata">

**Author:** ![jfontan](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/jfontan/32/18_2.png) [@jfontan](https://forum.opennebula.io/u/jfontan)\
**Post date:** [January 22, 2016, 12:51pm UTC](https://forum.opennebula.io/t/unable-to-hot-detach-virtio-datadisk/1573/5 "2016-01-22T12:51:08Z")

</div>

Is this problem still happening? Can you send us the output of this command in the node for a VM that is giving you this problem?

```nohighlight
$ vish -c qemu:///system dumpxml one-<vmid>

```

The output of `onevm show -x <vmid>` will also be helpful.

---

<div class="post-metadata">

**Author:** ![kiranranjane](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/kiranranjane/32/6207_2.png) [@kiranranjane](https://forum.opennebula.io/u/kiranranjane)\
**Post date:** [January 23, 2016, 2:50am UTC](https://forum.opennebula.io/t/unable-to-hot-detach-virtio-datadisk/1573/6 "2016-01-23T02:50:39Z")

</div>

Hi Javi,

The issue is still happening, I have attached the output to a txt file [Detach output](https://canada1.discourse-cdn.com/flex031/uploads/opennebula/original/2X/3/30524fd2331924ee488b36ebc67e6b613f435815) (19.3 KB)

Let me know if you need anything else.

Thanks

Regards  
Kiran Ranjane
