# Can't attach disk after upgrade to 5.4

**URL:** https://forum.opennebula.io/t/cant-attach-disk-after-upgrade-to-5-4/4842
**Category:** Product Support
**Created:** [August 28, 2017, 3:10pm UTC](https://forum.opennebula.io/t/cant-attach-disk-after-upgrade-to-5-4/4842 "2017-08-28T15:10:25Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![madko](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/madko/32/4195_2.png) [@madko](https://forum.opennebula.io/u/madko)
#### Post date: [August 28, 2017, 3:10pm UTC](https://forum.opennebula.io/t/cant-attach-disk-after-upgrade-to-5-4/4842/1 "2017-08-28T15:10:25Z")

</div>

Hi,

I’ve just realized that we can’t attach new disk anymore after upgrade from ONE 5.2 to 5.4.

It seems that the image is created in RAW format instead of qcow2. And then the disk.2.attach always mention a qcow2 format. So we are stuck. Any idea how to fix this problem ?

The datastore is set with driver and TM\_MAD as qcow2.

As I said it was working with 5.2.

Log in libvirt for the concerned VM:  
`Image is not in qcow2 format`

/var/lib/one/datastores/100/2844/disk.2.attach  
\<disk type=‘file’ device=‘disk’\>  
\<driver name=‘qemu’ type=‘qcow2’ /\>  
\<source file=’/var/lib/one//datastores/100/2844/disk.2’ \>  
\</source\>  
\<target dev=‘vdb’/\>  
\</disk\>

Best regards,  
Edouard

---

<div class="post-metadata">

### Author: ![madko](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/madko/32/4195_2.png) [@madko](https://forum.opennebula.io/u/madko)
#### Post date: [August 29, 2017, 9:53am UTC](https://forum.opennebula.io/t/cant-attach-disk-after-upgrade-to-5-4/4842/2 "2017-08-29T09:53:23Z")

</div>

This is the VM definition :  
[vm.xml](https://canada1.discourse-cdn.com/flex031/uploads/opennebula/original/2X/6/69fb2be4e008b2842ffe5c6f608ea4e38563e345.xml) (15.6 KB)

How can I debug this ?

---

<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: [August 29, 2017, 1:08pm UTC](https://forum.opennebula.io/t/cant-attach-disk-after-upgrade-to-5-4/4842/3 "2017-08-29T13:08:38Z")

</div>

What’s the process to create a new image? In Sunstone the type `qcow2` is selected by default when I create a new empty datablock on a `qcow2` datastore.

---

<div class="post-metadata">

### Author: ![madko](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/madko/32/4195_2.png) [@madko](https://forum.opennebula.io/u/madko)
#### Post date: [August 30, 2017, 5:27am UTC](https://forum.opennebula.io/t/cant-attach-disk-after-upgrade-to-5-4/4842/4 "2017-08-30T05:27:55Z")

</div>

The process is via Sunstone. I will try on an other OpenNebula 5.4 that was also upgraded from 5.2 to see if the problem is reproducible.

When we click on attach disk in storage section of the vm, we choose qcow2 instead of raw and then validate. The vm goes in HOTPLUG state and a can see on the storage tab view that a raw image is created instead of the qcow2 we asked for.

I will also try to do this operation with the CLI.

Thank you for your help

---

<div class="post-metadata">

### Author: ![madko](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/madko/32/4195_2.png) [@madko](https://forum.opennebula.io/u/madko)
#### Post date: [August 30, 2017, 8:20am UTC](https://forum.opennebula.io/t/cant-attach-disk-after-upgrade-to-5-4/4842/5 "2017-08-30T08:20:34Z")

</div>

is it possible to attache volatile disk with the CLI ?  
It seems the onevm disk-attach asks for an image file.

---

<div class="post-metadata">

### Author: ![madko](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/madko/32/4195_2.png) [@madko](https://forum.opennebula.io/u/madko)
#### Post date: [August 30, 2017, 8:50am UTC](https://forum.opennebula.io/t/cant-attach-disk-after-upgrade-to-5-4/4842/6 "2017-08-30T08:50:51Z")

</div>

I have bad news, this is 100% reproductible (at leat on 2 platforms for the moment, will have a third soon to be upgraded to 5.4). This happens with Ssh AND qcow2 type datastores.

Did you try to reproduce ?

Create 1 vm (we are using centos 7 kvm template from marketplace)  
While the VM is running, go to storage tab, click on attach disk  
Choose volatile, type 1 GB for the size, and just change Filesystem format to qcow2  
Click on attach

The page will refresh to show the VM is now in HOTPLUG state, and you can see the new disk is added but in raw format.  
After a few second, if you refresh, state is back to RUNNING, adding the disk has failed tho. Errors in log say image is not in qcow2 format.

We are using CentOS7

Should I open a bug report ?

---

<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: [August 30, 2017, 10:10am UTC](https://forum.opennebula.io/t/cant-attach-disk-after-upgrade-to-5-4/4842/7 "2017-08-30T10:10:56Z")

</div>

I’ve tested adding a new volatile disk and you are right that the image is created as `raw` even if you specify `qcow2`. In my case it is correcty attached as as `raw` image though.

Anyway, it is indeed a bug. Can you open that bug report please? Thanks.

---

<div class="post-metadata">

### Author: ![madko](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/madko/32/4195_2.png) [@madko](https://forum.opennebula.io/u/madko)
#### Post date: [August 30, 2017, 1:28pm UTC](https://forum.opennebula.io/t/cant-attach-disk-after-upgrade-to-5-4/4842/8 "2017-08-30T13:28:32Z")

</div>

Thanks Javi. I’m opening a bug report right now.

---

<div class="post-metadata">

### Author: ![madko](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/madko/32/4195_2.png) [@madko](https://forum.opennebula.io/u/madko)
#### Post date: [August 30, 2017, 2:18pm UTC](https://forum.opennebula.io/t/cant-attach-disk-after-upgrade-to-5-4/4842/9 "2017-08-30T14:18:45Z")

</div>

This is bug #5336  
[https://dev.opennebula.org/issues/5336](https://dev.opennebula.org/issues/5336)

---

<div class="post-metadata">

### Author: ![madko](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/madko/32/4195_2.png) [@madko](https://forum.opennebula.io/u/madko)
#### Post date: [August 31, 2017, 9:26am UTC](https://forum.opennebula.io/t/cant-attach-disk-after-upgrade-to-5-4/4842/10 "2017-08-31T09:26:47Z")

</div>

do you know Javi where the command qemu-img create is done ? I would like to force it in qcow2 instead of raw as a workaround because we are blocked with this bug.

---

<div class="post-metadata">

### Author: ![vholer](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/vholer/32/4392_2.png) [@vholer](https://forum.opennebula.io/u/vholer)
#### Post date: [August 31, 2017, 1:35pm UTC](https://forum.opennebula.io/t/cant-attach-disk-after-upgrade-to-5-4/4842/11 "2017-08-31T13:35:27Z")

</div>

I’m slightly looking on it and looks to me like a Sunstone only problem. If you are only on KVM and don’t use vCenter, here is a workaround [main.js.patch](https://canada1.discourse-cdn.com/flex031/uploads/opennebula/original/2X/c/cd527961743e876b6bd379a702a36921499fd4cc.patch) (1.9 KB) for `/usr/lib/one/sunstone/public/dist/main.js`. Simply, there are two FORMAT selection fields (for KVM and vCenter), and the latter (although hidden) always overrides the visible KVM configuration.

Please check if it’s better. Thanks.

---

<div class="post-metadata">

### Author: ![madko](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/madko/32/4195_2.png) [@madko](https://forum.opennebula.io/u/madko)
#### Post date: [September 1, 2017, 8:48am UTC](https://forum.opennebula.io/t/cant-attach-disk-after-upgrade-to-5-4/4842/12 "2017-09-01T08:48:25Z")

</div>

I have applied the patch with no error. Is there anything else to do? I don’t see any difference ? Do I have to restart sunstone ?

---

<div class="post-metadata">

### Author: ![madko](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/madko/32/4195_2.png) [@madko](https://forum.opennebula.io/u/madko)
#### Post date: [September 1, 2017, 8:57am UTC](https://forum.opennebula.io/t/cant-attach-disk-after-upgrade-to-5-4/4842/13 "2017-09-01T08:57:57Z")

</div>

ok I’ve just had the opportunity to restart sunstone and it works ! Thanks. At least disk are now in qcow2 format.
