# Revision history [back]

### Icehouse: How to download a bootable disk image from an instance

I'm trying to create a qcow2 disk image file from a snapshot, that can be used to create a bootable image in OpenStack again:

1. Created an image from stock trusty-server-cloudimg-amd64-disk1.img.

2. The file command identifies the format as "QEMU QCOW Image (v2), 2361393152 bytes"

3. Booted instance (succcessful)

4. Logged in and performed additional installation/configuration (successful: instance still running, reboots succesfully)

5. Shut down instance

6. Create snapshot

7. Download snapshot using glance image-download *snapname* --file *snapname.qcow2* --progress

The resulting file is now identified as "QEMU QCOW Image (unknown version)" without any size information. Consequently, after reimporting the file using

glance image-create --name *newname* --file *snapname.qcow2* --disk-format qcow2 --container-format bare --is-public True --progress


the new image's instance doesn't boot. On startup the instance complains "Boot failed: not a bootable disk".

I can, however, mount and browse the image file with guestmount command. It also has the expected size and is populated with the expected contents. It just seems to have lost its boot flag!

Is the procedure described supposed to work? What is the exact difference between the original and my downloaded file? And finally, how do do I get an image file that can boot?

• it doesn't make a difference whether the instance if running or shut down when the snaphot is taken.

• It doesn't make a difference whether I actually modify the running instance or not. Even a snapshot taken from a freshly instantiated cirros-0.3.2-x86_64 is broken, once I download the snapshot to a file.

### Icehouse: How to download a bootable disk image from an instance

I'm trying to create a qcow2 disk image file from a snapshot, that can be used to create a bootable image in OpenStack again:

1. Created an image from stock trusty-server-cloudimg-amd64-disk1.img.

2. The file command identifies the format as "QEMU QCOW Image (v2), 2361393152 bytes"

3. Booted instance (succcessful)

4. Logged in and performed additional installation/configuration (successful: instance still running, reboots succesfully)

5. Shut down instance

6. Create snapshot

7. Download snapshot using glance image-download *snapname* --file *snapname.qcow2* --progress

The resulting file is now identified as "QEMU QCOW Image (unknown version)" without any size information. Consequently, after reimporting the file using

glance image-create --name *newname* --file *snapname.qcow2* --disk-format qcow2 --container-format bare --is-public True --progress


the new image's instance doesn't boot. On startup the instance complains "Boot failed: not a bootable disk".

I can, however, mount and browse the image file with guestmount command. It also has the expected size and is populated with the expected contents. It just seems to have lost its boot flag!

Is the procedure described supposed to work? What is the exact difference between the original and my downloaded file? And finally, how do do I get an image file that can boot?

• it doesn't make a difference whether the instance if running or shut down when the snaphot is taken.

• It doesn't make a difference whether I actually modify the running instance or not. Even a snapshot taken from a freshly instantiated cirros-0.3.2-x86_64 is broken, once I download the snapshot to a file.

Update after some more digging and experimenting:

• the discrepancy of file id strings is due to qcow2 versions. The stock image has 0.10, while the image after download from glance has 1.1, apparently not recognized by the file command. I can convert formats into each other using qemu-img, however, that only fixes the output of file command, not the boot issue.

• At the cost of a lot of disk space and launch time consumption I can work around the issue: Use qemu-img to convert the broken disk file into raw format. The resulting file can be imported into glance and boots without a problem!

• Trying to fix the resource issues introduced by the workaround mentioned above, I tried whether converting the working raw image file back into qcow2 would help. It doesn't. If I convert to qcow2 version 1.1 I end up with the same boot failure as before. If I convert to version 0.10 I end up with a grub failure:

Booting from Hard Disk... error: invalid arch-independent ELF magic. Entering rescue mode... grub rescue>

Conclusion: still no satisfying way the create bootable qcow2 image files form running instances.

### Icehouse: How to download a bootable disk image from an instance

I'm trying to create a qcow2 disk image file from a snapshot, that can be used to create a bootable image in OpenStack again:

1. Created an image from stock trusty-server-cloudimg-amd64-disk1.img.

2. The file command identifies the format as "QEMU QCOW Image (v2), 2361393152 bytes"

3. Booted instance (succcessful)

4. Logged in and performed additional installation/configuration (successful: instance still running, reboots succesfully)

5. Shut down instance

6. Create snapshot

7. Download snapshot using glance image-download *snapname* --file *snapname.qcow2* --progress

The resulting file is now identified as "QEMU QCOW Image (unknown version)" without any size information. Consequently, after reimporting the file using

glance image-create --name *newname* --file *snapname.qcow2* --disk-format qcow2 --container-format bare --is-public True --progress


the new image's instance doesn't boot. On startup the instance complains "Boot failed: not a bootable disk".

I can, however, mount and browse the image file with guestmount command. It also has the expected size and is populated with the expected contents. It just seems to have lost its boot flag!

Is the procedure described supposed to work? What is the exact difference between the original and my downloaded file? And finally, how do do I get an image file that can boot?

• it doesn't make a difference whether the instance if running or shut down when the snaphot is taken.

• It doesn't make a difference whether I actually modify the running instance or not. Even a snapshot taken from a freshly instantiated cirros-0.3.2-x86_64 is broken, once I download the snapshot to a file.

Update after some more digging and experimenting:

• the discrepancy of file id strings is due to qcow2 versions. The stock image has 0.10, while the image after download from glance has 1.1, apparently not recognized by the file command. I can convert formats into each other using qemu-img, however, that only fixes the output of file command, not the boot issue.

• At the cost of a lot of disk space and launch time consumption I can work around the issue: Use qemu-img to convert the broken disk file into raw format. The resulting file can be imported into glance and boots without a problem!

• Trying to fix the resource issues introduced by the workaround mentioned above, I tried whether converting the working raw image file back into qcow2 would help. It doesn't. If I convert to qcow2 version 1.1 I end up with the same boot failure as before. If I convert to version 0.10 I end up with a grub failure:

Booting from Hard Disk... error: invalid arch-independent ELF magic. Entering rescue mode... grub rescue>

Conclusion: still no satisfying way the to create bootable qcow2 image files form running instances.

### Icehouse: How to download a bootable disk image from an instance

I'm trying to create a qcow2 disk image file from a snapshot, that can be used to create a bootable image in OpenStack again:

1. Created an image from stock trusty-server-cloudimg-amd64-disk1.img.

2. The file command identifies the format as "QEMU QCOW Image (v2), 2361393152 bytes"

3. Booted instance (succcessful)

4. Logged in and performed additional installation/configuration (successful: instance still running, reboots succesfully)

5. Shut down instance

6. Create snapshot

7. Download snapshot using glance image-download *snapname* --file *snapname.qcow2* --progress

The resulting file is now identified as "QEMU QCOW Image (unknown version)" without any size information. Consequently, after reimporting the file using

glance image-create --name *newname* --file *snapname.qcow2* --disk-format qcow2 --container-format bare --is-public True --progress


the new image's instance doesn't boot. On startup the instance complains "Boot failed: not a bootable disk".

I can, however, mount and browse the image file with guestmount command. It also has the expected size and is populated with the expected contents. It just seems to have lost its boot flag!

Is the procedure described supposed to work? What is the exact difference between the original and my downloaded file? And finally, how do do I get an image file that can boot?

• it doesn't make a difference whether the instance if running or shut down when the snaphot is taken.

• It doesn't make a difference whether I actually modify the running instance or not. Even a snapshot taken from a freshly instantiated cirros-0.3.2-x86_64 is broken, once I download the snapshot to a file.

Update after some more digging and experimenting:

• the discrepancy of file id strings is due to qcow2 versions. The stock image has 0.10, while the image after download from glance has 1.1, apparently not recognized by the file command. I can convert formats into each other using qemu-img, however, that only fixes the output of file command, not the boot issue.

• At the cost of a lot of disk space and launch time consumption I can work around the issue: Use qemu-img to convert the broken disk file into raw format. The resulting file can be imported into glance and boots without a problem!

• Trying to fix the resource issues introduced by the workaround mentioned above, I tried whether converting the working raw image file back into qcow2 would help. It doesn't. If I convert to qcow2 version 1.1 I end up with the same boot failure as before. If I convert to version 0.10 I end up with a grub failure:

Booting from Hard Disk... error: invalid arch-independent ELF magic. Entering rescue mode... grub rescue>

Conclusion: still no satisfying way to create bootable qcow2 image files form running instances.

### Icehouse: How to download a bootable disk image from an instance

I'm trying to create a qcow2 disk image file from a snapshot, that can be used to create a bootable image in OpenStack again:

1. Created an image from stock trusty-server-cloudimg-amd64-disk1.img.

2. The file command identifies the format as "QEMU QCOW Image (v2), 2361393152 bytes"

3. Booted instance (succcessful)

4. Logged in and performed additional installation/configuration (successful: instance still running, reboots succesfully)

5. Shut down instance

6. Create snapshot

7. Download snapshot using glance image-download *snapname* --file *snapname.qcow2* --progress

The resulting file is now identified as "QEMU QCOW Image (unknown version)" without any size information. Consequently, after reimporting the file using

glance image-create --name *newname* --file *snapname.qcow2* --disk-format qcow2 --container-format bare --is-public True --progress


the new image's instance doesn't boot. On startup the instance complains "Boot failed: not a bootable disk".

I can, however, mount and browse the image file with guestmount command. It also has the expected size and is populated with the expected contents. It just seems to have lost its boot flag!

Is the procedure described supposed to work? What is the exact difference between the original and my downloaded file? And finally, how do do I get an image file that can boot?

• it doesn't make a difference whether the instance if running or shut down when the snaphot is taken.

• It doesn't make a difference whether I actually modify the running instance or not. Even a snapshot taken from a freshly instantiated cirros-0.3.2-x86_64 is broken, once I download the snapshot to a file.

Update after some more digging and experimenting:

• the discrepancy of file id strings is due to qcow2 versions. The stock image has 0.10, while the image after download from glance has 1.1, apparently not recognized by the file command. I can convert formats into each other using qemu-img, however, that only fixes the output of file command, not the boot issue.

• At the cost of a lot of disk space and launch time consumption I can work around the issue: Use qemu-img to convert the broken disk file into raw format. The resulting file can be imported into glance and boots without a problem!

• Trying to fix the resource issues introduced by the workaround mentioned above, I tried whether converting the working raw image file back into qcow2 would help. It doesn't. If I convert to qcow2 version 1.1 I end up with the same boot failure as before. If I convert to version 0.10 I end up with a grub failure:

Booting from Hard Disk... error: invalid arch-independent ELF magic. Entering rescue mode... grub rescue>

Conclusion: still no satisfying way to create bootable qcow2 image files form from running instances.

### Icehouse: How to download create a bootable disk image from an snapshot from a running instance

Update 2: The issue seems to be unrelated to image down- or uploading, except for the partial workaround described below. But I can also reproduce this issue by attempting to launch snapshot directly after creation from the running instance. Rephrasing the question title accordingly. Any ideas?

I'm trying to create a qcow2 disk image file from a snapshot, that can be used to create a bootable image in OpenStack again:

1. Created an image from stock trusty-server-cloudimg-amd64-disk1.img.

2. The file command identifies the format as "QEMU QCOW Image (v2), 2361393152 bytes"

3. Booted instance (succcessful)

4. Logged in and performed additional installation/configuration (successful: instance still running, reboots succesfully)

5. Shut down instance

6. Create snapshot

7. Download snapshot using glance image-download *snapname* --file *snapname.qcow2* --progress

The resulting file is now identified as "QEMU QCOW Image (unknown version)" without any size information. Consequently, after reimporting the file using

glance image-create --name *newname* --file *snapname.qcow2* --disk-format qcow2 --container-format bare --is-public True --progress


the new image's instance doesn't boot. On startup the instance complains "Boot failed: not a bootable disk".

I can, however, mount and browse the image file with guestmount command. It also has the expected size and is populated with the expected contents. It just seems to have lost its boot flag!

Is the procedure described supposed to work? What is the exact difference between the original and my downloaded file? And finally, how do do I get an image file that can boot?

• it doesn't make a difference whether the instance if running or shut down when the snaphot is taken.

• It doesn't make a difference whether I actually modify the running instance or not. Even a snapshot taken from a freshly instantiated cirros-0.3.2-x86_64 is broken, once I download the snapshot to a file.

Update after some more digging and experimenting:

• the discrepancy of file id strings is due to qcow2 versions. The stock image has 0.10, while the image after download from glance has 1.1, apparently not recognized by the file command. I can convert formats into each other using qemu-img, however, that only fixes the output of file command, not the boot issue.

• At the cost of a lot of disk space and launch time consumption I can work around the issue: Use qemu-img to convert the broken disk file into raw format. The resulting file can be imported into glance and boots without a problem!

• Trying to fix the resource issues introduced by the workaround mentioned above, I tried whether converting the working raw image file back into qcow2 would help. It doesn't. If I convert to qcow2 version 1.1 I end up with the same boot failure as before. If I convert to version 0.10 I end up with a grub failure:

Booting from Hard Disk... error: invalid arch-independent ELF magic. Entering rescue mode... grub rescue>

Conclusion: still no satisfying way to create bootable qcow2 image files from running instances.

### Icehouse: How to create a bootable boot a snapshot from a running instance

Update 3: Again the question needs to be rephrased a little. It turns out that my "unbootable" snapshots in QCOW2 format do boot easily, just not inside nova. In fact, if I run

sudo virt-install --connect qemu:///system --name *SomeName* --ram=1024 --disk path=*snapshotname.qcow2*,format=qcow2 --import --virt-type kvm --graphics vnc


the VNC window pops up with the OS booting like a charm, using the very same image file snapshotname.qcow2, that nova refuses to recognize as a bootable disk. On the other hand, omitting the format=qcow2 spec for the image file reproduces the boot failure, which is line with virt-install's documentation. Quoting the man page:

format

Image format to be used if creating managed storage. For file volumes, this can be 'raw', 'qcow2', 'vmdk', etc. See format types in http://libvirt.org/storage.html for possible values. This is often mapped to the driver_type value as well.

With libvirt 0.8.3 and later, this option should be specified if reusing an existing disk image, since libvirt does not autodetect storage format as it is a potential security issue. For example, if reusing an existing qcow2 image, you will want to specify format=qcow2, otherwise the hypervisor may not be able to read your disk image.

My libvirt version is 1.2.2. What is the difference in nova boot an image to virt-install doing it? Does anyone else also see this issue?

Update 2: The issue seems to be unrelated to image down- or uploading, except for the partial workaround described below. But I can also reproduce this issue by attempting to launch snapshot directly after creation from the running instance. Rephrasing the question title accordingly. Any ideas?

I'm trying to create a qcow2 disk image file from a snapshot, that can be used to create a bootable image in OpenStack again:

1. Created an image from stock trusty-server-cloudimg-amd64-disk1.img.

2. The file command identifies the format as "QEMU QCOW Image (v2), 2361393152 bytes"

3. Booted instance (succcessful)

4. Logged in and performed additional installation/configuration (successful: instance still running, reboots succesfully)

5. Shut down instance

6. Create snapshot

7. Download snapshot using glance image-download *snapname* --file *snapname.qcow2* --progress

The resulting file is now identified as "QEMU QCOW Image (unknown version)" without any size information. Consequently, after reimporting the file using

glance image-create --name *newname* --file *snapname.qcow2* --disk-format qcow2 --container-format bare --is-public True --progress


the new image's instance doesn't boot. On startup the instance complains "Boot failed: not a bootable disk".

I can, however, mount and browse the image file with guestmount command. It also has the expected size and is populated with the expected contents. It just seems to have lost its boot flag!

Is the procedure described supposed to work? What is the exact difference between the original and my downloaded file? And finally, how do do I get an image file that can boot?

• it doesn't make a difference whether the instance if running or shut down when the snaphot is taken.

• It doesn't make a difference whether I actually modify the running instance or not. Even a snapshot taken from a freshly instantiated cirros-0.3.2-x86_64 is broken, once I download the snapshot to a file.

Update after some more digging and experimenting:

• the discrepancy of file id strings is due to qcow2 versions. The stock image has 0.10, while the image after download from glance has 1.1, apparently not recognized by the file command. I can convert formats into each other using qemu-img, however, that only fixes the output of file command, not the boot issue.

• At the cost of a lot of disk space and launch time consumption I can work around the issue: Use qemu-img to convert the broken disk file into raw format. The resulting file can be imported into glance and boots without a problem!

• Trying to fix the resource issues introduced by the workaround mentioned above, I tried whether converting the working raw image file back into qcow2 would help. It doesn't. If I convert to qcow2 version 1.1 I end up with the same boot failure as before. If I convert to version 0.10 I end up with a grub failure:

Booting from Hard Disk... error: invalid arch-independent ELF magic. Entering rescue mode... grub rescue>

Conclusion: still no satisfying way to create bootable qcow2 image files from running instances.