Image properties that reference image ids are not updated to UUIDs

Bug #975651 reported by Adam Gandelman on 2012-04-07
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Glance
High
Adam Gandelman
Essex
High
Eoghan Glynn
glance (Ubuntu)
Critical
Unassigned
Precise
Undecided
Unassigned

Bug Description

Migration script 012_id_to_uuid.py updates all image.id's to UUIDs, as well as updates referencing rows in image_properties and image_members. It does not, however, go as far as to update actual properties stored in image_properties (kernel_id, ramdisk_id) that reference the old numerical ID. As a result, clients like nova-compute will get "image not found" errors when trying to launch instances that use images associated with kernels/ramdisks (See Bug #932991)

>>> image_id = '5de785e3-b619-4826-b5b7-ce1bbd57ce63'
>>> pprint(self._call_retry(context, 'get_image_meta', image_id))
{'checksum': '911439879a8f1fdb83aa7e2480520661',
 'container_format': 'ami',
 'created_at': '2012-04-06T20:50:21',
 'deleted': False,
 'disk_format': 'ami',
 'id': '5de785e3-b619-4826-b5b7-ce1bbd57ce63',
 'is_public': False,
 'min_disk': '0',
 'min_ram': '0',
 'properties': {'architecture': 'i386',
                'image_location': 'bucket-18/ttylinux-uec-i686-12.1_2.6.35-22_1.img.manifest.xml',
                'image_state': 'available',
                'kernel_id': '52',
                'project_id': 'novaproject',
                'ramdisk_id': '53'},
 'protected': False,
 'size': 25165824,
 'status': 'active',
 'updated_at': '2012-04-06T20:50:22'}

The migration script should also check for any references to the previous ID and upgrade accordingly.

Changed in glance (Ubuntu):
importance: Undecided → Critical
status: New → Triaged
tags: added: ubuntu-openstack-upgrade

Fix proposed to branch: master
Review: https://review.openstack.org/6343

Changed in glance:
assignee: nobody → Adam Gandelman (gandelman-a)
status: New → In Progress

Reviewed: https://review.openstack.org/6343
Committed: http://github.com/openstack/glance/commit/e4d04f50adc2426f08872b0cececfe48f1d18683
Submitter: Jenkins
Branch: master

commit e4d04f50adc2426f08872b0cececfe48f1d18683
Author: Adam Gandelman <email address hidden>
Date: Fri Apr 6 20:59:39 2012 -0700

    012_id_to_uuid: Also convert ramdisk + kernel ids

    The original migration converts numerical IDs to UUIDs. It updates
    image_members and image_properties that reference image_id, but stops
    short of updating actual properties that reference the new UUIDs,
    specifically kernel_ids and ramdisk_ids. This breaks launching
    of instances in Nova whos images are associated with a kernel and/or rd.

    Also, this fixes an issue when migrating against non-sqlite
    databases where the actual conversion is executed twice.

    Fixes bug 975655
    Fixes bug 975651

    Update: Only update kernel_ids and ramdisk_ids in image_properties
            when converting to UUIDs

    Change-Id: I76ecabc5ee266e2e9765740721e8ec1722cc5a7c

Changed in glance:
status: In Progress → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package glance - 2012.1-0ubuntu2

---------------
glance (2012.1-0ubuntu2) precise; urgency=low

  [ Adam Gandelman ]
  * debian/patches/disable_db_table_auto_create.patch: Disable auto-creation
    of database schema at service start, inspect for consistenty and advise
    running manual migrations instead.
  * debian/patches/fix_migration_012_foreign_keys.patch: Fix a migration issue
    around missing FKs. Cherry-picked from upstream. Can be dropped with
    first stable update.
  * debian/patches/convert_properties_to_uuid.patch: Fixes migration 012 to
    also convert kernel_id and ramdisk_ids to UUID. Cherry picked from upstream.
    Can be dropped with first stable update (LP: #975651)
  * debian/glance-common.postinst: Clean up, fix purging issue due to poor
    us of conditionals
  * debian/glance-registry.postinst: Ensure new database is version_controlled
    before first call of db_sync.

  [ Chuck Short ]
  * debian/control: Fix upgrades from oneiric to precise. (LP: #974592)
 -- Adam Gandelman <email address hidden> Thu, 12 Apr 2012 15:02:08 -0700

Changed in glance (Ubuntu):
status: Triaged → Fix Released
Brian Waldon (bcwaldon) on 2012-04-23
Changed in glance:
importance: Undecided → High
Thierry Carrez (ttx) on 2012-05-23
Changed in glance:
milestone: none → folsom-1
status: Fix Committed → Fix Released

Reviewed: https://review.openstack.org/8598
Committed: http://github.com/openstack/glance/commit/b3df0a8f2728592081676db1580d53ea2c6ff0bd
Submitter: Jenkins
Branch: stable/essex

commit b3df0a8f2728592081676db1580d53ea2c6ff0bd
Author: Adam Gandelman <email address hidden>
Date: Fri Apr 6 20:59:39 2012 -0700

    012_id_to_uuid: Also convert ramdisk + kernel ids

    The original migration converts numerical IDs to UUIDs. It updates
    image_members and image_properties that reference image_id, but stops
    short of updating actual properties that reference the new UUIDs,
    specifically kernel_ids and ramdisk_ids. This breaks launching
    of instances in Nova whos images are associated with a kernel and/or rd.

    Also, this fixes an issue when migrating against non-sqlite
    databases where the actual conversion is executed twice.

    Fixes bug 975655
    Fixes bug 975651

    Update: Only update kernel_ids and ramdisk_ids in image_properties
            when converting to UUIDs

    Change-Id: I76ecabc5ee266e2e9765740721e8ec1722cc5a7c

Dave Walker (davewalker) on 2012-08-24
Changed in glance (Ubuntu Precise):
status: New → Confirmed

Please find the attached test log from the Ubuntu Server Team's CI infrastructure. As part of the verification process for this bug, Glance has been deployed and configured across multiple nodes using precise-proposed as an installation source. After successful bring-up and configuration of the cluster, a number of exercises and smoke tests have be invoked to ensure the updated package did not introduce any regressions. A number of test iterations were carried out to catch any possible transient errors.

Please Note the list of installed packages at the top and bottom of the report.

For records of upstream test coverage of this update, please see the Jenkins links in the comments of the relevant upstream code-review(s):

Trunk review: https://review.openstack.org/6343
Stable review: https://review.openstack.org/8598

As per the provisional Micro Release Exception granted to this package by the Technical Board, we hope this contributes toward verification of this update.

Adam Gandelman (gandelman-a) wrote :

Test coverage log.

tags: added: verification-done

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. 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 regresssions.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package glance - 2012.1.3+stable~20120821-120fcf-0ubuntu1

---------------
glance (2012.1.3+stable~20120821-120fcf-0ubuntu1) precise-proposed; urgency=low

  * New upstream snapshot. (LP: #1041120)
  * Resynchronzie with stable/essex:
    - Glance add uploads a double image if using ssl and images is smaller
      than 4k. (LP: #1007093)
    - If response.environ is None, instance fails to spawn.
      (LP: #1010560)
    - exception.BadStoreURL exposes sensitive information to end users.
      (LP: #1012268)
    - glance-cache.conf needs metadata encryption key (LP: #1012752)
    - image.upload notification doesn't report size (LP: #1018246)
    - Admins should be able to share image regardless of ownership.
      (LP: #1021054)
    - Glance scrubber date formatting fails with postgres (LP: #1022369)
    - Support zero-size image creation. (LP: #1025353)
    - Image id not contained in swift chunk debug message. (LP: #1028433)
    - qpid_heartbeat setting is ineffective. (LP: #1032314)
    - Image properties that reference image ids are not updated to UUIDs.
      (LP: #975651)
    - Migration 012_id_to_uuid attempts to convert IDs twice for non-sqlite
      databases. (LP: #975655)
    - multiprocess glance-api failed to exit when stopped by ctrl+c.
      (LP: #978130)
    - /usr/bin/glance's built-in pager breaks redirection.
      (LP: #978610)
    - Content-Length and Transfer-Encoding are mutually exclusive HTTP headers
      (LP: #981332)
    - glance add command - incorrect help text (LP: #997565)
  * debian/patches/convert_properties_to_uuid.patch: Dropped no longer
    needed.
  * debian/patches/fix-pep8-ubuntu.patch: Dropped no longer needed.
 -- Adam Gandelman <email address hidden> Fri, 24 Jun 2012 03:14:33 -0400

Changed in glance (Ubuntu Precise):
status: Confirmed → Fix Released
Thierry Carrez (ttx) on 2012-09-27
Changed in glance:
milestone: folsom-1 → 2012.2
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers