Adding an image to DevStack
I had some time to play with OpenStack this week so I rolled a DevStack install on an Ubuntu VM running in Parallels on my MacBook Air following the instructions here. Once OpenStack was up and running I was able to log in to Horizon at http://localhost/ and started to poke about. I decided I wanted to try and create a compute instance just to see what all the fuss was about … as it turns out, you need to have an image to base this instance on.
With a little bit of help from the OpenStack documentation and a little bit of trial and error I was able to quickly upload an image as follows:
First things first. Create a directory for your images:
mkdir /tmp/images
cd /tmp/images
Then grab the latest CirrOs image with wget:
wget -c https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img
We can then upload to glance:
glance --os-username=admin --os-password=password --os-tenant-name=demo
--os-auth-url=http://localhost:5000/v2.0 image-create --name
cirros-0.3.0-x86_64 --disk-format qcow2 --container-format bare
< /tmp/images/cirros-0.3.0-x86_64-disk.img
+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | 50bdc35edb03a38d91b1b071afb20a3c |
| container_format | bare |
Continue reading