diff options
| author | Josh Kearney <josh@jk0.org> | 2011-08-04 09:40:51 -0500 |
|---|---|---|
| committer | Josh Kearney <josh@jk0.org> | 2011-08-04 09:40:51 -0500 |
| commit | dbbc07750c2624b61af4f824d29c99bffe5f722f (patch) | |
| tree | d9fecb2ffed5c79bce1882dca0f75bcb7d7a3b6d | |
| parent | 7974365eba03f4cc45fc3e30af1e57270a61cf51 (diff) | |
Fixed rescue and unrescue.
| -rw-r--r-- | nova/compute/manager.py | 25 | ||||
| -rw-r--r-- | nova/exception.py | 3 | ||||
| -rw-r--r-- | nova/virt/xenapi/vmops.py | 3 |
3 files changed, 16 insertions, 15 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 8780ad921..cf4ee229d 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -648,38 +648,37 @@ class ComputeManager(manager.SchedulerDependentManager): @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id()) @checks_instance_lock - def rescue_instance(self, context, instance_uuid): + def rescue_instance(self, context, instance_id): """Rescue an instance on this host.""" context = context.elevated() - instance_ref = self.db.instance_get_by_uuid(context, instance_uuid) - LOG.audit(_('instance %s: rescuing'), instance_uuid, context=context) + instance_ref = self.db.instance_get(context, instance_id) + LOG.audit(_('instance %s: rescuing'), instance_id, context=context) self.db.instance_set_state(context, - instance_uuid, + instance_id, power_state.NOSTATE, 'rescuing') _update_state = lambda result: self._update_state_callback( - self, context, instance_uuid, result) + self, context, instance_id, result) network_info = self._get_instance_nw_info(context, instance_ref) self.driver.rescue(context, instance_ref, _update_state, network_info) - self._update_state(context, instance_uuid) + self._update_state(context, instance_id) @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id()) @checks_instance_lock - def unrescue_instance(self, context, instance_uuid): + def unrescue_instance(self, context, instance_id): """Rescue an instance on this host.""" context = context.elevated() - instance_ref = self.db.instance_get_by_uuid(context, instance_uuid) - LOG.audit(_('instance %s: unrescuing'), instance_uuid, - context=context) + instance_ref = self.db.instance_get(context, instance_id) + LOG.audit(_('instance %s: unrescuing'), instance_id, context=context) self.db.instance_set_state(context, - instance_uuid, + instance_id, power_state.NOSTATE, 'unrescuing') _update_state = lambda result: self._update_state_callback( - self, context, instance_uuid, result) + self, context, instance_id, result) network_info = self._get_instance_nw_info(context, instance_ref) self.driver.unrescue(instance_ref, _update_state, network_info) - self._update_state(context, instance_uuid) + self._update_state(context, instance_id) @staticmethod def _update_state_callback(self, context, instance_id, result): diff --git a/nova/exception.py b/nova/exception.py index 68e6ac937..8503f8e3e 100644 --- a/nova/exception.py +++ b/nova/exception.py @@ -122,7 +122,8 @@ def wrap_exception(notifier=None, publisher_id=None, event_type=None, LOG.exception(_('Uncaught exception')) #logging.error(traceback.extract_stack(exc_traceback)) raise Error(str(e)) - raise + # Don't mask the real exception. + raise Exception(e) return wraps(f)(wrapped) return inner diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py index b3b812a48..9979a0165 100644 --- a/nova/virt/xenapi/vmops.py +++ b/nova/virt/xenapi/vmops.py @@ -935,7 +935,8 @@ class VMOps(object): self.spawn_rescue(context, instance, network_info) rescue_vm_ref = VMHelper.lookup(self._session, instance.name) - vbd_ref = self._session.get_xenapi().VM.get_VBDs(vm_ref)[0] + #NOTE(jk0): Find the root partition, not swap. + vbd_ref = self._session.get_xenapi().VM.get_VBDs(vm_ref)[1] vdi_ref = self._session.get_xenapi().VBD.get_record(vbd_ref)["VDI"] rescue_vbd_ref = VMHelper.create_vbd(self._session, rescue_vm_ref, vdi_ref, 1, False) |
