Building CentOS images for OpenStack

Here’s an easy way to roll your own images for OpenStack. The build machine runs CentOS 6.

  1. Install EPEL repository if you haven’t already
  2. Install oz
    yum -y install oz
  3. Create a kickstart file. Download example.
  4. Create a tdl file. Download example.
  5. Run oz-install
    oz-install -p -u -d1 -a centos6.ks centos6.tdl
  6. Convert the image to qcow2
    qemu-img convert /var/lib/libvirt/images/centos6_x86_64.dsk -O qcow2 centos6.qcow2
  7. Import the newly create image into glance
    glance image-create --name centos6 --disk-format=qcow2 --container-format=ovf < centos6.qcow2</li>
  8. Boot it up to see whether it works!
    nova boot --flavor 1 --image centos6 --key_name sshkey centos6

4 thoughts on “Building CentOS images for OpenStack

  1. Pingback: Oz制作CentOS镜像 » 陈沙克日志
  2. Games have now migrated from play fields to personal computers.

    You can use it as a playhouse as nicely as storage space for some of your children’s toys and play factors.
    When I realized how much I enjoyed having games on
    my Pocket PC, I decided to check them out to see if they had
    any listing for such software, and sure enough, they do.

  3. DEBUG:oz.Guest.RHEL6Guest:Waiting for centos_63_x86_64 to finish installing, 830/1200
    DEBUG:oz.Guest.RHEL6Guest:Waiting for centos_63_x86_64 to finish installing, 820/1200
    INFO:oz.Guest.RHEL6Guest:Cleaning up guest named centos_63_x86_64
    INFO:oz.Guest.RHEL6Guest:Cleaning up after install
    Traceback (most recent call last):
    File “/usr/bin/oz-install”, line 162, in
    libvirt_xml = guest.install(timeout, force_download)
    File “/usr/lib/python2.6/site-packages/oz/”, line 685, in install
    self.initrdfname, self.cmdline)
    File “/usr/lib/python2.6/site-packages/oz/”, line 1663, in _do_install
    self._wait_for_install_finish(dom, timeout)
    File “/usr/lib/python2.6/site-packages/oz/”, line 775, in _wait_for_install_finish
    raise oz.OzException.OzException(“No disk activity in %d seconds, failing. %s” % (inactivity_timeout, screenshot_text))
    oz.OzException.OzException: No disk activity in 300 seconds, failing. Check screenshot at /var/lib/oz/screenshots/centos_63_x86_64-1406630617.97.ppm for more detail

Leave a Reply

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

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

Google photo

You are commenting using your Google 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