IBM Cloud Orchestrator, Version 2.5

Adding images to your OpenStack environment

You can add images to your OpenStack environment to be used by IBM® Cloud Orchestrator.

About this task

To use an image in IBM Cloud Orchestrator, you must add the image to your OpenStack environment.

If you are using Linux on System z®, follow the instructions in Enabling z/VM® for OpenStack (Support for OpenStack Kilo Release) guide at http://www.vm.ibm.com/sysman/openstk.html.

If you are using VMware, you can populate the Glance repository automatically by using the discovery process (see Configuring vmware-discovery) or you can add images to the Glance repository manually. If you rely on VMware discovery, you can skip the remaining part of this topic.

If you are using PowerVC, images are displayed in Glance automatically, without any additional action.

To add an image to OpenStack, complete the following steps on the OpenStack Controller:

Procedure

  1. Set the environment by running the following command:
    source /root/openrc
  2. Run the following command on one line:
    glance image-create 
    --name image_name 
    --disk-format disk_format 
    --container-format container_format 
    --is-public [True|False] 
    < image_path
    where
    image_name
    Specifies a name for the new image that you are adding.
    disk_format
    Specifies one of the following disk formats:
    raw
    An unstructured disk image format.
    qcow2
    A disk format that is supported by the QEMU emulator that can expand dynamically and supports copy-on-write.
    vmdk
    For a VMware hypervisor, another common disk format that is supported by many common virtual machine monitors.
    container-format
    Specifies the container format for the image. The acceptable formats are: aki, ami, ari, bare, and ovf.
    --is-public
    Specifies whether the image is accessible by other users. The value can be true or false.
    image_path
    Specifies the full path of the image to be added.
    For more information about the glance image-create command, see the OpenStack documentation.
    Attention: If you are deploying on VMware, specify the additional properties vmware_adaptertype, vmware_ostype, and vmware_disktype.
    For example:
    glance image-create 
    --name my_vmware_windows_image 
    --disk-format vmdk 
    --container-format bare 
    --is-public False 
    --property vmware_disktype="preallocated" 
    --property vmware_adaptertype="lsiLogic" 
    --property vmware_ostype="Windows764_Guest" 
    < /tmp/images_to_create
    where vmware_disktype can be sparse, preallocated, or streamOptimized, and the vmware_adaptertype can be ide, busLogic, or lsiLogic. VMDK disks that are converted by the qemu-img utility are always monolithic sparse VMDK disks with an IDE adapter type. If the image does not come from the qemu-img utility, vmware_disktype and vmware_adaptertype might be different.

    To determine the image disk type and adapter type from an image file, use the head -20 vmdk_filename command, and find the createType and ddb.adapterType in the command output. Currently, the operating system boots VMDK disks with an IDE adapter type that cannot be attached to a virtual SCSI controller. Disks with one of the SCSI adapter types (such as busLogic or lsiLogic) cannot be attached to the IDE controller. Therefore, as the previous examples show, it is important to set the vmware_adaptertype property correctly. The default adapter type is lsiLogic, which is SCSI. You can omit the vmware_adaptertype property only if the image adapter type is lsiLogic.

    When you create an image by using the glance image-create command or the OpenStack Dashboard, and the image format is not of raw type, you must specify the minimum disk space that is required for the image to run (that is, the current disk size). The disk size is specified in GB, and the value must be greater than or equal to the virtual size of the image. You can use the following command to find the virtual size of an image:
    # qemu-img info
    Tip: If using the glance image-create command, specify the minimum disk size by using the --min-disk value option. If using the OpenStack Dashboard, specify the required value in the Minimum Disk (GB) field.
    Note: Windows has a different mechanism of interpreting the hardware clock than Linux does. Therefore, the following settings are recommended for a Windows guest image:
    • Set the time zone of the image the same as the compute node.
    • Disable time synchronization with Internet inside the image, so that the guest virtual machine gets its time solely from the hypervisor.
    • Set the os_type=windows metadata with the --property option when registering the image.
    Note: When you use the OpenStack Dashboard to create an image and your image size is large (>1 GB for example), it is recommended to use Image Location as Image Source. If you select Image File as Image Source for a large image size, your image might not be loaded correctly because the Horizon server might timeout and the image may remain in Saving status.