You can enable live resize for OpenStack instances by configuring image metadata. With live resize, you can change the disk size, memory, and vCPUs of an instance while the instance is powered on.

Prerequisites

  • Do not create live resize-enabled instances using SR-IOV-enabled ports. Live resize is not compatible with SR-IOV.
  • Do not use live resize-enabled instances in tenant virtual data centers. Live resize is not compatible with tenant virtual data centers.

In addition, the following conditions apply for live resizing of disk size:

  • Use VMDK as the disk format for the image.
  • Use a SCSI virtual disk adapter type for the image. IDE adapter types are not supported.
  • Deploy virtual machines from the image as full clones. Linked clones cannot be live-resized.

Procedure

  1. Log in to the OpenStack Management Server as viouser.
  2. Switch to the root user and load the cloud administrator credentials file.
    sudo su -
    source ~/cloudadmin.rc
  3. Create a new image with live resize enabled.
    openstack image create image-name --disk-format {vmdk | iso} --container-format bare --file image-file {--public | --private} [--property vmware_adaptertype="vmdk-adapter-type"] [--property vmware_disktype="{sparse | preallocated | streamOptimized}"] --property vmware_ostype="operating-system" --property img_linked_clone="false" --property os_live_resize="{vcpu | memory | disk}"
    Option Description
    image-name

    Enter the name of the source image.

    --disk-format

    Enter vmdk.

    --container-format

    Enter bare. The container format argument is not currently used by Glance.

    --file

    Specify the image file to upload.

    {--public | --private}

    Include --public to make the image available to all users or --private to make the image available only to the current user.

    --property vmware_adaptertype

    Specify the adapter type of the VMDK disk. For disk live resize, you must specify a SCSI adapter.

    If you do not include this parameter, the adapter type is determined by introspection.

    --property vmware_disktype

    Specify sparse, preallocated, or streamOptimized.

    If you do not include this parameter, the disk type is determined by introspection.

    --property vmware_ostype

    Specify the operating system on the image.

    --property img_linked_clone

    Enter false.

    --property os_live_resize

    Specify vcpu, memory, disk, or any combination separated by commas (for example, vcpu,memory,disk).

Results

When you create virtual machines using the image that you defined in this procedure, those virtual machines can be resized without needing to be powered off.