Red Hat Training

A Red Hat training course is available for Red Hat OpenStack Platform

1.2.4.2. Importing from a local volume

The glance-direct method creates an image record, which generates an image ID. After the image is uploaded to the service from a local volume, it is stored in a staging area and is made active after it passes any configured checks. The glance-direct method requires a shared staging area when used in a highly available (HA) configuration.

注記

Image uploads that use the glance-direct method fail in an HA environment if a common staging area is not present. In an HA active-active environment, API calls are distributed to the Image service controllers. The download API call can be sent to a different controller than the API call to upload the image. For more information about configuring the staging area, see Storage Configuration in the Advanced Overcloud Customization Guide.

The glance-direct method uses the following calls to import an image:

  • glance image-create
  • glance image-stage
  • glance image-import

Procedure

  1. You can use the glance image-create-via-import command to perform all three of these calls in one command:

    $ glance image-create-via-import --container-format <format> --disk-format <disk_format> --name <name> --file <path_to_image>

    After the image moves from the staging area to the back end location, the image is listed. However, it might take some time for the image to become active.

  2. You can monitor the availability of the image:

    $ openstack image show <image_id> command.

    Replace the ID with the one provided during image creation.