After you copy the images folder to a new datastore, you must update the locations setting on each image to reflect the new datastore.
Prerequisites
Verify that the images folder has been copied to the new datastore.
Verify that the image folder name and relative path on the new datastore are the same as as on the previous datastore.
Verify that you know the image ID values of the images you want to update.
Procedure
- Repeat this procedure for all images that you want to migrate.
- Using SSH, log in as administrator to the VMware Integrated OpenStack manager.
- Using SSH, log in to the controller01 node.
- Switch to root user.
- Execute the cloudadmin.rc file.
- (Optional) View a list of images.
- (Optional) Get the location of a specific image.
Note:
You must know the image ID to specify the image.
glance --os-image-api-version 2 image-show <image_id>
The image location is the URL indicated by the locations parameter.
vsphere://<vcenter_ip>/folder/<image_folder_name>/<image_id>dcPath=<path_to_datacenter>&dsName=<old_datastore_name>
For example:
vsphere://10.20.123.456/folder/images/6c4a7e0d-65e7-4f3c-9dde-0de75f729a0c
?dcPath=Datacenter1&dsName=old_ds
- Update the image's location URL to reflect the destination datastore to complete the migration of a single image.
- Add the new location to the image configuration.
glance --os-image-api-version 2 location-add <image_id> --url <new_url>
Option |
Description |
image_id |
Specifies the image to be modified. |
new_url |
The new URL is the same as the previous URL except the dsName argument specifies the name of the new datastore. vsphere://<vcenter_ip>/folder/<image_folder_name>/<image_id>dcPath=<path_to_datacenter>&dsName=<new_datastore_name>
|
If the command returns a 400 Bad Request: Invalid Location message, verify that file path of the image on the destination datastore is correct.
- Remove the old location from the image configuration.
glance --os-image-api-version 2 location-delete <image_id> --url <old_url>
- View the image information again to verify that the locations parameter correctly reflects the new datastore.
glance --os-image-api-version 2 image-show <image_id>
The image is successfully migrated.