cinder upload-to-image doesn't copy os_type property

Bug #1692446 reported by Seyeong Kim
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
Unassigned
Ubuntu Cloud Archive
Fix Released
Undecided
Unassigned
Kilo
Fix Released
High
Unassigned
cinder (Ubuntu)
Fix Released
Undecided
Unassigned
Trusty
Fix Released
High
Unassigned

Bug Description

[Description]

on Trusty Icehouse, Kilo(UCA, only second commit)

When copy volume to image using upload-to-image, it doesn't copy os_type properly.

I modified second patche's directory structure in patch file because there was no matched "unit" directory, removed and adjust it.

[Test Case]
deploy trusty openstack environment.

testing script
http://pastebin.ubuntu.com/24630417/

[Regression Potential]
Regression potential is low. these patches are already in upstream.
Making image from volume could be affected. Could be issue on custom properties.

[Other Info]
related bugs

- first commit (upstream) : https://review.openstack.org/95954, from blueprint https://blueprints.launchpad.net/cinder/+spec/restrict-uploading-volume-to-image
   - include from Juno (2014.2)
- second commit (LP) : https://bugs.launchpad.net/cinder/+bug/1527324
   - included from Liberty(7.0.2)

Below commits fix this issue.

[1]
commit dcf4b10cd1e16b28ab388def658e77cc9a34d766
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
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.

For Example:
glance_core_properties = 'checksum', 'container_format',
'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: I786edbc6e54b3d06ef679a71e22676d2f88e7307

[2]
commit edf00659aadaf898ae679f358a6ea8533f4dd891
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'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.

Change-Id: Ib32c92a8be170b5f43a34e69155398dfc1a8cbcd
Closes-Bug: #1527324

Seyeong Kim (seyeongkim)
Changed in cinder:
status: New → Fix Released
Changed in cinder (Ubuntu):
status: New → Fix Released
description: updated
Seyeong Kim (seyeongkim)
tags: added: sts-sru-needed
removed: sts-sru
Revision history for this message
Edward Hope-Morley (hopem) wrote :

@seyeongkim can you please provide the following info:

  * specify which LP bug the first patch comes from
  * specify which versions you are targeting (is it just Trusty Icehouse?) - Kilo is still supported but i don't think the second patch is in Kilo.

Seyeong Kim (seyeongkim)
description: updated
Revision history for this message
Seyeong Kim (seyeongkim) wrote :
Revision history for this message
Seyeong Kim (seyeongkim) wrote :
description: updated
Seyeong Kim (seyeongkim)
description: updated
Seyeong Kim (seyeongkim)
Changed in cloud-archive:
status: New → Fix Released
Seyeong Kim (seyeongkim)
description: updated
James Page (james-page)
Changed in cinder (Ubuntu Trusty):
status: New → Triaged
importance: Undecided → High
James Page (james-page)
Changed in cinder (Ubuntu Trusty):
status: Triaged → In Progress
Revision history for this message
James Page (james-page) wrote :

Uploaded to trusty-proposed for SRU team review.

Revision history for this message
James Page (james-page) wrote :

Uploaded to trusty-kilo staging for UCA team review.

Revision history for this message
James Page (james-page) wrote : Please test proposed package

Hello Seyeong, or anyone else affected,

Accepted cinder into kilo-proposed. The package will build now and be available in the Ubuntu Cloud Archive in a few hours, and then in the -proposed repository.

Please help us by testing this new package. To enable the -proposed repository:

  sudo add-apt-repository cloud-archive:kilo-proposed
  sudo apt-get update

Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-kilo-needed to verification-kilo-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-kilo-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: added: verification-kilo-needed
Revision history for this message
Seyeong Kim (seyeongkim) wrote :

BEFORE, GOT ERROR

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

Failed validating u'type' in schema[u'additionalProperties']:
    {u'type': u'string'}

On instance['properties']:
    {u'os_type': u'linux'} (HTTP 400) (Request-ID: req-479f0c3a-8a27-4a6e-99a4-298f9249f03d)
Showing final image from volume properties
usage: glance image-show [--human-readable] [--max-column-width <integer>]
                         <IMAGE_ID>
glance image-show: error: too few arguments

AFTER

ii cinder-api 1:2015.1.4-0ubuntu1.3 all Cinder storage service - API server
ii cinder-common 1:2015.1.4-0ubuntu1.3 all Cinder storage service - common files
ii cinder-scheduler 1:2015.1.4-0ubuntu1.3 all Cinder storage service - Scheduler server
ii cinder-volume 1:2015.1.4-0ubuntu1.3 all Cinder storage service - Volume server
ii python-cinder 1:2015.1.4-0ubuntu1.3 all Cinder Python libraries

+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | None |
| container_format | bare |
| created_at | 2017-06-08T15:31:12Z |
| disk_format | raw |
| id | 38cf8599-24b5-43ff-9ca8-f47213bf1073 |
| locations | [] |
| min_disk | 0 |
| min_ram | 0 |
| name | T1 |
| os_type | linux |
| owner | 5f21480f8b6c442888899ef28d4c51bd |
| protected | False |
| size | None |
| status | queued |
| tags | [] |
| updated_at | 2017-06-08T15:31:12Z |
| virtual_size | None |
| visibility | private |
+------------------+--------------------------------------+

result is fine

tags: added: verification-kilo-done
removed: verification-kilo-needed
Revision history for this message
James Page (james-page) wrote : Update Released

The verification of the Stable Release Update for cinder has completed successfully and the package has now been released to -updates. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
James Page (james-page) wrote :

This bug was fixed in the package cinder - 1:2015.1.4-0ubuntu1.3
---------------

 cinder (1:2015.1.4-0ubuntu1.3) trusty-kilo; urgency=medium
 .
   * Fix issue that upload-to-image doesn't copy os_type property
     (LP: #1692446):
     - d/p/0001-Fix-volume-upload-failure-with-glance_api_version-2.patch
 .
 cinder (1:2015.1.4-0ubuntu1.2) trusty-kilo; urgency=medium
 .
   * Move RBD calls to a separate thread to avoid blocking the main process. (LP: #1401335):
     - d/p/lp1401335-Move-RBD-calls-to-a-separate-threads.patch

Revision history for this message
Robie Basak (racb) wrote : Please test proposed package

Hello Seyeong, or anyone else affected,

Accepted cinder into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/cinder/1:2014.1.5-0ubuntu2.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in cinder (Ubuntu Trusty):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Robie Basak (racb) wrote :

Accepted, but please review https://wiki.ubuntu.com/StableReleaseUpdates#Procedure and add to the Regression Potential details of where testers should look to find the most likely regressions.

Also, please consider adding dep3 headers to your new quilt patches next time.

Revision history for this message
Seyeong Kim (seyeongkim) wrote :

sorry for missing dep3 and thanks. will do that.

verification done. it works well

ii cinder-api 1:2014.1.5-0ubuntu2.2 all Cinder storage service - API server
ii cinder-common 1:2014.1.5-0ubuntu2.2 all Cinder storage service - common files
ii cinder-scheduler 1:2014.1.5-0ubuntu2.2 all Cinder storage service - Scheduler server
ii cinder-volume 1:2014.1.5-0ubuntu2.2 all Cinder storage service - Volume server
ii python-cinder 1:2014.1.5-0ubuntu2.2 all Cinder Python libraries

tags: added: verification-done
removed: verification-needed
Seyeong Kim (seyeongkim)
description: updated
tags: added: verification-done-trusty
removed: verification-done
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cinder - 1:2014.1.5-0ubuntu2.2

---------------
cinder (1:2014.1.5-0ubuntu2.2) trusty; urgency=medium

  * Fix issue that upload-to-image doesn't copy os_type property
    (LP: #1692446):
    - d/p/0001-Copy-custom-properties-to-image-from-volume.patch
    - d/p/0001-Fix-volume-upload-failure-with-glance_api_version-2.patch

 -- Seyeong Kim <email address hidden> Fri, 19 May 2017 18:37:48 +0900

Changed in cinder (Ubuntu Trusty):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.