Cannot resize down instance booted from volume backed snapshot with ephemeral

Bug #1596957 reported by Feodor Tersin on 2016-06-28
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Undecided
Feodor Tersin

Bug Description

If an instance is booted from a volume backed snapshot with ephemeral(s), it cannot be resized down to a flawor with disk size is lesser than original flavor disk size.

Steps to reproduce:

1 Prepare flavors
$ nova flavor-create t1.nano-2-e auto 64 2 1 --ephemeral 1
$ nova flavor-create t1.nano-1-e auto 64 1 1 --ephemeral 1

2 Prepare a volume backed snapshot
$ cinder create 2 --image-id cirros-0.3.4-x86_64-disk --name boot-vol
$ nova boot --boot-volume <boot-vol-id> --flavor t1.nano-2-e inst-1
$ nova image-create inst-1 snap-1

3 Boot an instace from the snapshot
$ nova boot --image snap-1 --flavor t1.nano-2-e inst-2

4 Resize the instance
$ nova resize inst-2 t1.nano-1-e

5 Check status of the instance
$ nova list

Expected status: VERIFY_RESIZE
Actual status: ACITVE

Environment:
DevStack on current (the last Nova commit a7efa47ec91479c6cc77087cd5b86d2bbf5a0654) Newton OpenStack.

n-cpu.log fragment:
------------
[req-4de3bbd2-a717-4f76-bca0-607573ae46b9 admin admin] Exception during message handling
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/server.py", line 133, in _process_incoming
    res = self.dispatcher.dispatch(message)
...
  File "/opt/stack/nova/nova/compute/manager.py", line 6464, in _error_out_instance_on_exception
    raise error.inner_exception
ResizeError: Resize error: Unable to resize disk down.

Changed in nova:
assignee: nobody → Feodor Tersin (ftersin)
status: New → In Progress

Change abandoned by Feodor Tersin (<email address hidden>) on branch: master
Review: https://review.openstack.org/334609
Reason: in favor of Ie424d172

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

commit ed994bb4d72b5f93cfb76a5f726264e4896ad4ed
Author: Feodor Tersin <email address hidden>
Date: Tue Oct 4 20:17:17 2016 +0300

    libvirt: Improve _is_booted_from_volume implementation

    Currently this method cannot be used widely due to its parameters. It
    requires device_info - the dict which can not be easily obtained in many
    cases. Since it is often needed to figure out if an instance is booted
    from volume, and the method name is "appropriate", this sometimes leads
    to errors (when string result of get_instance_disk_info is passed as an
    argument to _is_booted_from_volume; see also Id5901254).

    This patch makes _is_booted_from_volume to use standard
    block_device_info structure, which is accessible in almost any driver
    method.

    Closes-bug: 1596957
    Closes-bug: 1587802
    Change-Id: Ie424d172ac9d6aeb42d83e512f2a18713134be3b

Changed in nova:
status: In Progress → Fix Released

This issue was fixed in the openstack/nova 15.0.0.0b2 development milestone.

Reviewed: https://review.openstack.org/416558
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=c9ea2e179e7408f8b8f41579c6915be519c0b04e
Submitter: Jenkins
Branch: stable/newton

commit c9ea2e179e7408f8b8f41579c6915be519c0b04e
Author: Feodor Tersin <email address hidden>
Date: Tue Oct 4 20:17:17 2016 +0300

    libvirt: Improve _is_booted_from_volume implementation

    Currently this method cannot be used widely due to its parameters. It
    requires device_info - the dict which can not be easily obtained in many
    cases. Since it is often needed to figure out if an instance is booted
    from volume, and the method name is "appropriate", this sometimes leads
    to errors (when string result of get_instance_disk_info is passed as an
    argument to _is_booted_from_volume; see also Id5901254).

    This patch makes _is_booted_from_volume to use standard
    block_device_info structure, which is accessible in almost any driver
    method.

    Closes-bug: 1596957
    Closes-bug: 1587802
    Change-Id: Ie424d172ac9d6aeb42d83e512f2a18713134be3b
    (cherry picked from commit ed994bb4d72b5f93cfb76a5f726264e4896ad4ed)

tags: added: in-stable-newton

This issue was fixed in the openstack/nova 14.0.4 release.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers