when unshelve a vm, if this vm has been offloaded, the process would involve re-scheduling.
in nova/conductor/manager.py def unshelve_instance(self, context, instance):
elif instance.vm_state == vm_states.SHELVED_OFFLOADED:
try: with compute_utils.EventReporter(context, self.db, 'get_image_info', instance.uuid): image = self._get_image(context, sys_meta['shelved_image_id'])
except exception.ImageNotFound: with excutils.save_and_reraise_exception(): LOG.error(_('Unshelve attempted but vm_state not SHELVED ' 'or SHELVED_OFFLOADED'), instance=instance) instance.vm_state = vm_states.ERROR instance.save()
filter_properties = {}
hosts = self._schedule_instances(context, image, filter_properties, instance) <<<<<this would cause exception,when it occurs, the instance wil <<<<<stuck in task_state: unshelving forever
host = hosts.pop(0)['host'] self.compute_rpcapi.unshelve_instance(context, instance, host, image)
when unshelve a vm, if this vm has been offloaded, the process would involve re-scheduling. manager. py def unshelve_ instance( self, context, instance):
in nova/conductor/
elif instance.vm_state == vm_states. SHELVED_ OFFLOADED:
with compute_ utils.EventRepo rter(context, self.db,
'get_ image_info' , instance.uuid):
image = self._get_ image(context,
sys_meta[ 'shelved_ image_id' ]) ImageNotFound:
with excutils. save_and_ reraise_ exception( ):
LOG. error(_ ('Unshelve attempted but vm_state not SHELVED '
'or SHELVED_ OFFLOADED' ), instance=instance)
instance. vm_state = vm_states.ERROR
instance. save()
try:
except exception.
hosts = self._schedule_
host = hosts.pop(