summaryrefslogtreecommitdiffstats
path: root/nova/exception.py
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/exception.py
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/exception.py')
-rw-r--r--nova/exception.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/nova/exception.py b/nova/exception.py
index 0e6c004d6..046df24c9 100644
--- a/nova/exception.py
+++ b/nova/exception.py
@@ -315,6 +315,10 @@ class InstanceNotInRescueMode(Invalid):
message = _("Instance %(instance_id)s is not in rescue mode")
+class InstanceNotRescuable(Invalid):
+ message = _("Instance %(instance_id)s cannot be rescued: %(reason)s")
+
+
class InstanceNotReady(Invalid):
message = _("Instance %(instance_id)s is not ready")