You can add existing VM templates to your VMware Integrated OpenStack deployment as Glance images. This enables users to boot instances, create bootable block storage volumes, and other functions available to Glance images.

Prerequisites

  • Verify that the existing VMs template resides in the same vCenter as your VMware Integrated OpenStack deployment.

  • Verify that the following conditions do apply.

    • The VM template does not have multiple disks.

    • The VM template does not have a CD-ROM drive.

    • The VM template does not have a floppy disk drive.

Procedure

  1. Prepare the VM template.

    Configure the metadata settings as necessary.

    • The vmware_ostype is required for Windows images, but optional for Linux images.

    • The hw_vif_model is recommended for specifying NIC type. Before defining this setting, confirm the correct NIC type for this image template. For example, if this setting is undefined, the instance is provisioned with the E1000 NIC by default. To ensure another NIC is provisioned, define this setting appropriately.

      For example, to provision the VMXNET3 NIC, the metadata definition is hw_vif_model=VirtualVmxnet3.

    • The following metadata settings are not required.

      • vmware_adaptertype

      • vmware_disktype

  2. Log in to the OpenStack management cluster.
  3. Run the glance command to obtain, define, and import the image.
    glance image-create --name <NAME> \
           --disk-format vmdk --container-format bare
           --property vmware_ostype=ubuntu64Guest
           --property hw_vif_model=VirtualVmxnet3
    
    glance location-add <glance_image_UUID> --url "vi://<vcenter-host>/<datacenter-path>/vm/<sub-folders>/<template_name> IMAGE_ID" 

    The location-add command points to the inventory path for the VM template and can refer to either VM or host. For example:

    "vi://<datacenter-path>/vm/<template_name>” 
    or 
    "vi://<datacenter-path>/host/<host_name>/<template_name>"

    The vm and host keywords in the inventory path represent the VM and Templates View and Host and Cluster View hierarchy in your vSphere Web Client.