I suggest to execute 'instance.deleted_at = None' after self.driver.restore(instance) or self._power_on(context, instance) finished, and the vm will not be deleted when restoring failed.
I suggest to execute 'instance. deleted_ at = None' after self.driver. restore( instance) or self._power_ on(context, instance) finished, and the vm will not be deleted when restoring failed.