Skip to content

TUTORIAL: Build OpenStack Ready Images

vlj91 edited this page Sep 16, 2015 · 11 revisions

#Contents

Stage Guide
1. Prerequisites
2. Building OpenStack Ready Images
3. Upload to OpenStack Glance
4. Creating an instance

#Prerequisites

  1. OpenStack Environment Access
  2. OpenStack User Networking Setup
  3. Libvirt host

#Building OpenStack Ready Images

OpenStack stores virtual machine images into the Glance image store, with a number of disk and container formats available including:

Disk formats Container formats
raw bare
vhd ovf
vmdk aki
iso ari
qcow2 ami
aki ova
ari
ami

The following guide will provide an OpenStack ready image using the QCOW2 disk format.

The method used to build OpenStack ready images uses the virtualization API libvirt to build instances ready for OpenStack. Several methods of building OpenStack images are available, including:

Whilst it is possible to create customized bootable OpenStack images using the readily available Cloud images together with the OpenStack Snapshot capability, our guide uses the Libvirt/KVM method of crafting images. We choose the Libvirt method of installation and customization for:

When to use a stock image:

  • Minimal customization required, for example installing a few packages via package installation manager, or creating local user accounts. This can be performed via cloudinit or manually once the instance has booted
  • Commercial support is available only on the image
  • Applications are supplied pre-installed on the stock image

When to use your own image:

  • More than minimal customization is required, at some point the time taken to perform customization at each instance boot becomes unfeasible
  • Apply latest security updates, many stock supplied images are only available at major version releases
  • Perform significant application install and configuration manually, specific to a use-case and distribute ready-to-run images
  • Create a more minimal image with only the packages required for a particular use-case
  • Add additional network devices

Problems with boot->customize->snapshot method:

  • Disk expansion can create very large images (10GB++)
  • Image sys-prep to remove instance personality is difficult
  • Cloudinit has already been executed (as part of the original instance boot), and multiple runs are not always supported by upstream cloudinit file distributors

##Preparing Cloud ready images using libvirt We have included a number of demonstration OpenStack ready images together with application installs using the libvirt host, including:

  1. CentOS6 OpenStack image
  2. CentOS7 OpenStack image

##Image prepartion The following guide details the steps required to prepare an image for use with OpenStack:

#Upload to OpenStack Glance The following guide details the steps required to upload an image to OpenStack Glance:

#Creating an instance The following guide details the steps required to launch and access an instance using OpenStack Nova:

Clone this wiki locally