Presently after copying an image to volume, all properties
of the image are getting copied properly but while creating
image back from volume, it doesn't copy custom properties
to the image.
At present in volume-glance-metadata table all the properties
of volume are stored as key and value. Because of this it is
difficult to differentiate between core and custom properties.
To overcome this, I have added a new option
'glance_core_properties' in cinder.conf. This option defines
all core properties of an image. This way, it's easy to separate
core and custom properties from the glance_volume_metadata and add
custom property to the newly created image.
Fix volume upload failure with glance_api_version=2
When the volume has additional image properties, upload-to-image
using glance API version 2 will fail with the following error.
Failed validation u'type' in schema[u'additionalProperties']:
{u'type': u'string'}
This is due to non core properties passed as a dict to the key
'properties'. It is valid in Image API v1, but the additional
properties must be passed just like core properties in v2.
[Description]
When copy volume to image using upload-to-image, it doesn't copy os_type properly.
[Test Case]
deploy trusty openstack environment.
$glance image-create --name="trusty" --visibility public --os_type=linux --progress --container- format= bare --disk-format=qcow2 < ~/images/ trusty- server- cloudimg- amd64-disk1. img
get image id
$cinder create --image-id [IMAGEID] --display-name T 5
waiting until finished.
$cinder upload-to-image T T1
check the T1's information if there is os_type is set properly
[Regression Potential]
Regression potential is low. these patches are already in upstream.
[Other Info]
related LP bugs
https:/ /bugs.launchpad .net/openstack- manuals/ +bug/1329419 /bugs.launchpad .net/cinder/ +bug/1527324
https:/
Below commits fix this issue.
[1] 8ab388def658e77 cc9a34d766
commit dcf4b10cd1e16b2
Author: PranaliDeore <email address hidden>
Date: Tue May 6 04:04:45 2014 +0000
Copy custom properties to image from volume
Presently after copying an image to volume, all properties
of the image are getting copied properly but while creating
image back from volume, it doesn't copy custom properties
to the image.
At present in volume- glance- metadata table all the properties core_properties ' in cinder.conf. This option defines volume_ metadata and add
of volume are stored as key and value. Because of this it is
difficult to differentiate between core and custom properties.
To overcome this, I have added a new option
'glance_
all core properties of an image. This way, it's easy to separate
core and custom properties from the glance_
custom property to the newly created image.
For Example: core_properties = 'checksum', 'container_format',
glance_
'disk_format', 'image_name', 'image_id', 'min_disk',
'min_ram', 'name', 'size'
DocImpact: Added 'glance_ core_properties ' to distinguish the
core and custom properties as discussed above in cinder.conf
blueprint: restrict- uploading- volume- to-image
Change-Id: I786edbc6e54b3d 06ef679a71e2267 6d2f88e7307
[2] 8ae679f358a6ea8 533f4dd891
commit edf00659aadaf89
Author: Tomoki Sekiyama <email address hidden>
Date: Fri Dec 18 20:38:36 2015 +0900
Fix volume upload failure with glance_ api_version= 2
When the volume has additional image properties, upload-to-image
using glance API version 2 will fail with the following error.
Failed validation u'type' in schema[ u'additionalPro perties' ]:
{u'type': u'string'}
This is due to non core properties passed as a dict to the key
'properties'. It is valid in Image API v1, but the additional
properties must be passed just like core properties in v2.
Change-Id: Ib32c92a8be170b 5f43a34e6915539 8dfc1a8cbcd
Closes-Bug: #1527324