CentOS · CentOS 7 · Cloud · Glance · Image Management · OpenStack

Bundling CentOS 7.x image for OpenStack

This article explains how to create a CentOS 7 image on KVM for uploading it to the image store on OpenStack Juno (This article may be applicable for other versions as well). I have used KVM running on Ubuntu 14.04.2 64-bit server for creation of the image.

The first step would be to create a qcow2 image. This will represent the main HDD of the virtual machine, so make sure to give it as much space as you will need.

kvm-img create -f qcow2 centos7.img 20G

Start the Virtual Machine booting from the CD using the following command.

kvm -m 1024 -cdrom CentOS-7-x86_64-Minimal-1503-01.iso -drive file=centos7.img,if=virtio,index=0 -boot d -net nic -net user -nographic -vnc :1

Connect to the Virtual Machine through VNC (use display number :1).For Example, where is the IP address of the host machine.

vncviewer :1

Select “Minimal Installation” under the section “Software selection”. Once the installation is over shutdown and boot the Virtual Machine from Hard Drive.

kvm -m 1024 -drive file=centos.img,if=virtio,index=0,boot=on -boot c -net nic -net user -nographic -vnc :1

Do the necessary changes needed for the image.

Shutdown the Virtual Machine. Upload the image to OpenStack using the following command

glance image-create --name CentOS-7 --is-public true --container-format bare --disk-format qcow2 --file centos7.img

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s