Openstack stemcell image format QCOW2 or RAW?

95 views
Skip to first unread message

m...@matt-j.co.uk

unread,
Dec 5, 2013, 8:50:18 AM12/5/13
to vcap...@cloudfoundry.org
Hi all,

Having an issue running stemcells on an Openstack instance and reasearch seems to suggest it's due to incompatibility between the QCOW2 image format and our openstack clusters CEPH-Backed storage.

Long story short, I wanted to convert the stemcell image to RAW;

Extracted bosh-stemcell-1478-openstack-kvm-ubuntu.tgz

root@ft-cloudhammer:~/deployments/extracted-bosh-stemcell-1478-openstack-kvm-ubuntu# ls -la
total 390272
drwxr-xr-x 2 root root      4096 Dec  4 16:07 .
drwxr-xr-x 4 root root      4096 Dec  4 18:43 ..
-rw-r--r-- 1 root root      5846 Dec  3 22:16 apply_spec.yml
-rw-r--r-- 1 root root 399577476 Dec  3 22:21 image
-rw-r--r-- 1 root root     31634 Dec  3 21:49 stemcell_dpkg_l.txt
-rw-r--r-- 1 root root       347 Dec  3 22:22 stemcell.MF

Confirmed stemcell.MF;

root@ft-cloudhammer:~/deployments/extracted-bosh-stemcell-1478-openstack-kvm-ubuntu# cat stemcell.MF
---
name: bosh-openstack-kvm-ubuntu
version: '1478'
bosh_protocol: 1
sha1: b528c59d5e47c7e898aca8bbd8f9e5a657a8edac
cloud_properties:
  name: bosh-openstack-kvm-ubuntu
  version: '1478'
  infrastructure: openstack
  disk_format: qcow2
  container_format: bare
  os_type: linux
  os_distro: ubuntu
  architecture: x86_64
  auto_disk_config: 'true'

Simple, I thought, change disk_format to raw in stemcell.MF and then run the following command on the image file;

mv image image.qcow2
qemu-img convert image.qcow2 image.raw
mv image.raw image
sha1sum image

However.... qemu-image info gives me conflicting information;

root@ft-cloudhammer:~/deployments/extracted-bosh-stemcell-1478-openstack-kvm-ubuntu# qemu-img info image
image: image
file format: raw
virtual size: 381M (399577088 bytes)
disk size: 381M

Apparently the image is *already* in RAW format?
Is this the case? Could someone confirm how the stemcell images are created?
I tried the convert nontheless and the sha1 did change, however the re-packaged stemcell now fails to upload (yes i repliaced the sha1: field in stemcell.MF).

Kind Regards,
Matt

Ferran Rodenas

unread,
Dec 5, 2013, 12:04:43 PM12/5/13
to vcap...@cloudfoundry.org
Matt, don't forget untar the 'image' file, the real image is located at a file called 'root.img':

root@inception:~/bosh-workspace/stemcells# tar xzvf bosh-stemcell-latest-openstack-kvm-ubuntu.tgz 
apply_spec.yml
image
stemcell_dpkg_l.txt
stemcell.MF
root@inception:~/bosh-workspace/stemcells# tar xzvf image 
root.img
root@inception:~/bosh-workspace/stemcells# qemu-img info root.img 
image: root.img
file format: qcow2
virtual size: 10G (10737418240 bytes)
disk size: 1.0G
cluster_size: 65536

It should be in QCOW2 format.

- Ferdy


2013/12/5 <m...@matt-j.co.uk>
To unsubscribe from this group and stop receiving emails from it, send an email to vcap-dev+u...@cloudfoundry.org.

m...@matt-j.co.uk

unread,
Dec 5, 2013, 12:12:36 PM12/5/13
to vcap...@cloudfoundry.org
Doh!

This is the information I was missing!

Many thanks,
Matt
Reply all
Reply to author
Forward
0 new messages