Nova doesn't allow to resize down an instance booted from a volume

Bug #1416361 reported by Roman Podoliaka on 2015-01-30
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
High
Unassigned

Bug Description

If instance is booted from a volume, Nova won't allow to resize the instance down, despite the fact root disk (ephemeral) is not even used:

http://paste.openstack.org/show/164108/

malor@ubuntu:~/devstack$ nova resize --poll demo m1.tiny

Server resizing... 100% complete
Finished

but in nova-compute.log:

2015-01-30 11:06:14.535 ERROR oslo.messaging.rpc.dispatcher [req-c788c8b2-d953-4f7f-962c-afca7ad41ff7 demo demo] Exception during message handling: Resize error: Unable to resize disk down.
2015-01-30 11:06:14.535 TRACE oslo.messaging.rpc.dispatcher Traceback (most recent call last):
2015-01-30 11:06:14.535 TRACE oslo.messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py", line 137, in _dispatch_and_reply
2015-01-30 11:06:14.535 TRACE oslo.messaging.rpc.dispatcher incoming.message))
2015-01-30 11:06:14.535 TRACE oslo.messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py", line 180, in _dispatch
2015-01-30 11:06:14.535 TRACE oslo.messaging.rpc.dispatcher return self._do_dispatch(endpoint, method, ctxt, args)
2015-01-30 11:06:14.535 TRACE oslo.messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py", line 126, in _do_dispatch
2015-01-30 11:06:14.535 TRACE oslo.messaging.rpc.dispatcher result = getattr(endpoint, method)(ctxt, **new_args)
2015-01-30 11:06:14.535 TRACE oslo.messaging.rpc.dispatcher File "/opt/stack/nova/nova/exception.py", line 88, in wrapped
2015-01-30 11:06:14.535 TRACE oslo.messaging.rpc.dispatcher payload)
2015-01-30 11:06:14.535 TRACE oslo.messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 82, in __exit__
2015-01-30 11:06:14.535 TRACE oslo.messaging.rpc.dispatcher six.reraise(self.type_, self.value, self.tb)
2015-01-30 11:06:14.535 TRACE oslo.messaging.rpc.dispatcher File "/opt/stack/nova/nova/exception.py", line 71, in wrapped
2015-01-30 11:06:14.535 TRACE oslo.messaging.rpc.dispatcher return f(self, context, *args, **kw)
2015-01-30 11:06:14.535 TRACE oslo.messaging.rpc.dispatcher File "/opt/stack/nova/nova/compute/manager.py", line 296, in decorated_function
2015-01-30 11:06:14.535 TRACE oslo.messaging.rpc.dispatcher pass
2015-01-30 11:06:14.535 TRACE oslo.messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 82, in __exit__
2015-01-30 11:06:14.535 TRACE oslo.messaging.rpc.dispatcher six.reraise(self.type_, self.value, self.tb)
2015-01-30 11:06:14.535 TRACE oslo.messaging.rpc.dispatcher File "/opt/stack/nova/nova/compute/manager.py", line 281, in decorated_function
2015-01-30 11:06:14.535 TRACE oslo.messaging.rpc.dispatcher return function(self, context, *args, **kwargs)
2015-01-30 11:06:14.535 TRACE oslo.messaging.rpc.dispatcher File "/opt/stack/nova/nova/compute/manager.py", line 346, in decorated_function
2015-01-30 11:06:14.535 TRACE oslo.messaging.rpc.dispatcher return function(self, context, *args, **kwargs)
2015-01-30 11:06:14.535 TRACE oslo.messaging.rpc.dispatcher File "/opt/stack/nova/nova/compute/manager.py", line 269, in decorated_function
2015-01-30 11:06:14.535 TRACE oslo.messaging.rpc.dispatcher migration.instance_uuid, exc_info=True)
2015-01-30 11:06:14.535 TRACE oslo.messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 82, in __exit__
2015-01-30 11:06:14.535 TRACE oslo.messaging.rpc.dispatcher six.reraise(self.type_, self.value, self.tb)
2015-01-30 11:06:14.535 TRACE oslo.messaging.rpc.dispatcher File "/opt/stack/nova/nova/compute/manager.py", line 255, in decorated_function
2015-01-30 11:06:14.535 TRACE oslo.messaging.rpc.dispatcher return function(self, context, *args, **kwargs)
2015-01-30 11:06:14.535 TRACE oslo.messaging.rpc.dispatcher File "/opt/stack/nova/nova/compute/manager.py", line 324, in decorated_function
2015-01-30 11:06:14.535 TRACE oslo.messaging.rpc.dispatcher kwargs['instance'], e, sys.exc_info())
2015-01-30 11:06:14.535 TRACE oslo.messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 82, in __exit__
2015-01-30 11:06:14.535 TRACE oslo.messaging.rpc.dispatcher six.reraise(self.type_, self.value, self.tb)
2015-01-30 11:06:14.535 TRACE oslo.messaging.rpc.dispatcher File "/opt/stack/nova/nova/compute/manager.py", line 312, in decorated_function
2015-01-30 11:06:14.535 TRACE oslo.messaging.rpc.dispatcher return function(self, context, *args, **kwargs)
2015-01-30 11:06:14.535 TRACE oslo.messaging.rpc.dispatcher File "/opt/stack/nova/nova/compute/manager.py", line 3851, in resize_instance
2015-01-30 11:06:14.535 TRACE oslo.messaging.rpc.dispatcher self.instance_events.clear_events_for_instance(instance)
2015-01-30 11:06:14.535 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.7/contextlib.py", line 35, in __exit__
2015-01-30 11:06:14.535 TRACE oslo.messaging.rpc.dispatcher self.gen.throw(type, value, traceback)
2015-01-30 11:06:14.535 TRACE oslo.messaging.rpc.dispatcher File "/opt/stack/nova/nova/compute/manager.py", line 6183, in _error_out_instance_on_exception
2015-01-30 11:06:14.535 TRACE oslo.messaging.rpc.dispatcher raise error.inner_exception
2015-01-30 11:06:14.535 TRACE oslo.messaging.rpc.dispatcher ResizeError: Resize error: Unable to resize disk down.

description: updated
description: updated
Changed in nova:
assignee: nobody → Mike Durnosvistov (mdurnosvistov)
Changed in nova:
status: New → Confirmed
importance: Undecided → Low

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

Changed in nova:
status: Confirmed → In Progress
Jay Pipes (jaypipes) wrote :

Changing to High because this actually produces a bad return: the user sees success even though nothing happened.

Changed in nova:
importance: Low → High
tags: added: migration
Matt Riedemann (mriedem) wrote :

Resize is a cast, and it looks like when this fails in the driver it raises an exception back to the compute manager which should set the instance vm_state back to 'ACTIVE' and then raise another ResizeError exception which the compute manager should handle. The migration record should go to 'ERROR' status and there should be an instance fault recorded with the instance before the compute manager exits. So the instance is back in ACTIVE status on failure (which is good so the user doesn't have to open a support request to their admin to get the state changed back to ACTIVE via reset-state API), but they'd have to get the instance faults to see what failed and why.

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

commit 8e1be7c05a4cbcc189c47b76d46024cbc7e9655e
Author: Mike Durnosvistov <email address hidden>
Date: Wed Feb 4 17:59:30 2015 +0200

    libvirt: Resize down an instance booted from a volume

    When we boot instance from volume, it doesn't use root disk and
    we should provide the possibility to resize down this instance.
    This patch allows to change the size down of the instance
    booted from volume.

    Also this patch got rid of duplicate code in test-cases.

    Closes-Bug: #1416361
    Change-Id: I0f890de69d268218d44a6ab4117a5c69cf6fbf8f

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2015-04-10
Changed in nova:
milestone: none → kilo-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2015-04-30
Changed in nova:
milestone: kilo-rc1 → 2015.1.0
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers