Commit 19ec0a15 by Őry Máté

one: add Instance.save_as

parent ddfe345d
......@@ -477,6 +477,12 @@ class Instance(models.Model):
self._change_state("POWEROFF")
def restart(self):
self._change_state("RESTART")
def save_as(self):
"""
Save image and shut down.
"""
self._update_vm('<DISK id="0"><SAVE_AS name="template-%d"/></DISK>' % self.template.id)
self._change_state("SHUTDOWN")
class Meta:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment