Cannot boot from volume-backed instance snapshot

Bug #1481220 reported by Feodor Tersin
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Critical
Feodor Tersin

Bug Description

Since that https://review.openstack.org/#/c/188789/ is merged, Nova fails to boot an instance from a volume-backed instance snapshot.

Steps to reproduce against DevStack:
1 boot an instance from a volume:
nova boot inst --block-device source=image,dest=volume,size=1,bootindex=0,id=<xxx> --flavor m1.nano

2 create a volume-backed snapshot
nova image-create inst volback

3 boot a new instance from the snapshot
nova boot inst1 --image volback --flavor m1.nano

Expected result: the new instance attributes.
Actual result:
ERROR (ClientException): The server has either erred or is incapable of performing the requested operation. (HTTP 500)

n-api log:
   File "/opt/stack/nova/nova/compute/api.py", line 1488, in create
     check_server_group_quota=check_server_group_quota)
   File "/opt/stack/nova/nova/compute/api.py", line 1097, in _create_instance
     auto_disk_config, reservation_id, max_count)
   File "/opt/stack/nova/nova/compute/api.py", line 854, in _validate_and_build_base_options
     image_meta = objects.ImageMeta.from_dict(boot_meta)
   File "/opt/stack/nova/nova/objects/image_meta.py", line 91, in from_dict
     return cls(**image_meta)
   File "/opt/stack/nova/nova/objects/base.py", line 188, in __init__
     setattr(self, key, kwargs[key])
   File "/usr/local/lib/python2.7/dist-packages/oslo_versionedobjects/base.py", line 70, in setter
     field_value = field.coerce(self, name, value)
   File "/usr/local/lib/python2.7/dist-packages/oslo_versionedobjects/fields.py", line 184, in coerce
     return self._null(obj, attr)
   File "/usr/local/lib/python2.7/dist-packages/oslo_versionedobjects/fields.py", line 162, in _null
     raise ValueError(_("Field `%s' cannot be None") % attr)
 ValueError: Field `container_format' cannot be None

!!! This blocks gating of stackforge/ec2-api project !!!

Feodor Tersin (ftersin)
Changed in nova:
assignee: nobody → Feodor Tersin (ftersin)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Changed in nova:
status: New → In Progress
Feodor Tersin (ftersin)
description: updated
Changed in nova:
importance: Undecided → High
Jay Pipes (jaypipes)
Changed in nova:
importance: High → Critical
Revision history for this message
Matt Riedemann (mriedem) wrote :

How did test_volume_boot_pattern not catch this? It boots and instance from a volume, then takes a snapshot of the volume and then boots another instances from that volume snapshot.

http://git.openstack.org/cgit/openstack/tempest/tree/tempest/scenario/test_volume_boot_pattern.py#n26

tags: added: unified-objects volumes
Revision history for this message
Jordan Pittier (jordan-pittier) wrote :

The Tempest scenario is not the same. The tempest scenario creates a volume snapshot through cinder. Here we create an instance snapshot through nova (which result in a volume snapshot).

Revision history for this message
Feodor Tersin (ftersin) wrote :

The test boots an instance from the volume snapshot (which is stored in Cinder). But the bug scenario boots an instance from instance snapshot (which is stored in Glance, but has its parts in Cinder as well).

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/208932
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=a59f22d27819bc02d548b92198243e20bb2e0014
Submitter: Jenkins
Branch: master

commit a59f22d27819bc02d548b92198243e20bb2e0014
Author: Feodor Tersin <email address hidden>
Date: Tue Aug 4 11:54:39 2015 +0300

    Honour nullability constraints of Glance schema in ImageMeta

    Currently ImageMeta object doesn't allow Null values in fields, which
    are nullable in Glance DB schema.

    By this reason since that Iac034d864cd0265759aaa7c8049fafa276763cc0 is
    merged, Nova fails to boot from any volume-backed image.

    This patch makes ImageMeta class to accept Null values to these fields,
    but converts Null to default empty values for backward compatibility.

    Closes-Bug: #1481220
    Closes-Bug: #1479869
    Change-Id: I770d394f65e5be6a5f8f36c673806f91509e0abe

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to nova (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/211048

Thierry Carrez (ttx)
Changed in nova:
milestone: none → liberty-3
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Michael Still (<email address hidden>) on branch: master
Review: https://review.openstack.org/211048
Reason: This patch has been stalled for quite a while, so I am going to abandon it to keep the code review queue sane. Please restore the change when it is ready for review.

Thierry Carrez (ttx)
Changed in nova:
milestone: liberty-3 → 12.0.0
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.