Openstack Uploading Image to Volume

From Tech Wiki
Jump to navigation Jump to search

If you encounter an error uploading an image to a volume using the Horizon Openstack Dashboard you can use the Python CLI Interface to solve the issue.

The error you receive on the dashboard will not be at all helpful however this will no longer be the case in the 'M' Release Cycle of the Dashboard. To get a better error code you can run the following command using the CLI Clients:

cinder upload-to-image 5a6a6154-4cb0-4e5e-ade4-0f497e7f4fae CodeClub

The long set of characters is the Volume ID and the CodeClub bit is the name of the image you want it to be called.

This will then produce a better error such as the one below:

ERROR: Unable to set 'properties' to '{u'description': u''}'. Reason: {u'description': u''} is not of type u'string'

To solve this issue in a work-around you need to list the meta-date of the volume you are trying to upload using the following command:

cinder show 5a6a6154-4cb0-4e5e-ade4-0f497e7f4fae | grep -i meta

We then need to remove all the meta-data and this can be done using the following loop command replacing the meta-data I have placed in the command for what appeared when you listed the meta-data in the earlier command:

for i in container_format hw_qemu_guest_agent disk_format hw_scsi_model image_id min_ram checksum min_disk hw_disk_bus size ; do cinder image-metadata 5a6a6154-4cb0-4e5e-ade4-0f497e7f4fae unset $i ; done

You can then run the original command to upload the volume to an image:

cinder upload-to-image 5a6a6154-4cb0-4e5e-ade4-0f497e7f4fae CodeClub

This error should be resolved in the future as a bug has been submitted and committed into the openstack/cinder development milestone.