Tuesday, March 4, 2014

OpenStack Compatible CentOS Image Building

Here are some steps to create CentOS compatible for OpenStack

1. Create flat file compatible as disk for OpenStack use qcow2.
    qemu-img create -f qcow2 -o preallocation=metadata /home/***/centos-6.4_20G.qcow2 20G

   Preallocation of metadata doesn't give 20Gb as go space saving..

2. Start Image using newly created disk and use ISO for installing Image:
     virt-install --virt-type kvm --name centos-6.4_32 --ram 2048  --cdrom=/home/images/CentOS-6.5-x86_64-bin-DVD1.iso  --disk /home/nova/centos-6.4_20G.qcow2,format=qcow2  --network bridge=br0  --graphics vnc,listen=0.0.0.0 --noautoconsole  --os-type=linux --os-variant=rhel6

3. Connect to gui using virt-monitor

4. To eject a disk using virsh, libvirt requires that you attach an empty disk at the same target that the CDROM was previously attached, which should be hdc. You can confirm the appropriate target using the virsh dumpxml vm-image > /tmp/filename.xml

No comments:

Post a Comment