Commit 026be873 by Őry Máté Committed by Bach Dániel

vm: allow suspending diskless vms

parent a42666e0
...@@ -487,9 +487,10 @@ class Instance(AclBase, VirtualMachineDescModel, StatusModel, OperatedMixin, ...@@ -487,9 +487,10 @@ class Instance(AclBase, VirtualMachineDescModel, StatusModel, OperatedMixin,
""" """
try: try:
datastore = self.disks.all()[0].datastore datastore = self.disks.all()[0].datastore
except: except IndexError:
return None from storage.models import DataStore
else: datastore = DataStore.objects.get()
path = datastore.path + '/' + self.vm_name + '.dump' path = datastore.path + '/' + self.vm_name + '.dump'
return {'datastore': datastore, 'path': path} return {'datastore': datastore, 'path': path}
......
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