summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorNikola Dipanov <ndipanov@redhat.com>2013-03-07 17:48:54 +0100
committerNikola Dipanov <ndipanov@redhat.com>2013-03-09 11:24:08 +0100
commitcbc0df73015702a2503f83885ea11355c8f2bcc4 (patch)
tree7d77ad773476b541895c6fa7f8e77b6b8ad37450 /nova/api
parent7477bbfdad9cfa6383a1ef1824f630a2c9938212 (diff)
downloadnova-cbc0df73015702a2503f83885ea11355c8f2bcc4.tar.gz
nova-cbc0df73015702a2503f83885ea11355c8f2bcc4.tar.xz
nova-cbc0df73015702a2503f83885ea11355c8f2bcc4.zip
Prevent rescue for volume-backed instances
This patch prevents rescuing of volume_backed instances, by checking for it in the API layer and raising an exception if instance on which a rescue was attempted is volume backed. Rescue is supposed to just be a way to log into a wayward instance if something goes wrong with the base image that may have had some data (logfiles etc.) and make it possible to grab that - block devices are assumed to be accessible by re-attaching them, and are considered persistant so no need for rescue there. Fixes bug: #1067744 blueprint: improve-boot-from-volume Change-Id: I8a4b1ccff7406837de3086aa413034e8e647b8fa
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/compute/contrib/rescue.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/nova/api/openstack/compute/contrib/rescue.py b/nova/api/openstack/compute/contrib/rescue.py
index b6cf3a918..d8699e0e0 100644
--- a/nova/api/openstack/compute/contrib/rescue.py
+++ b/nova/api/openstack/compute/contrib/rescue.py
@@ -63,6 +63,9 @@ class RescueController(wsgi.Controller):
except exception.InstanceInvalidState as state_error:
common.raise_http_conflict_for_instance_invalid_state(state_error,
'rescue')
+ except exception.InstanceNotRescuable as non_rescuable:
+ raise exc.HTTPBadRequest(explanation=unicode(non_rescuable))
+
return {'adminPass': password}
@wsgi.action('unrescue')