Commit 700fbcf7 by Guba Sándor

storage: set iso base when cloning

parent 6c04efc6
...@@ -508,9 +508,12 @@ class Disk(AclBase, TimeStampedModel): ...@@ -508,9 +508,12 @@ class Disk(AclBase, TimeStampedModel):
if not self.ready: if not self.ready:
raise self.DiskIsNotReady(self) raise self.DiskIsNotReady(self)
if not disk: if not disk:
base = None
if self.type == "iso":
base = self
disk = Disk.create(datastore=self.datastore, disk = Disk.create(datastore=self.datastore,
name=self.name, size=self.size, name=self.name, size=self.size,
type=self.type) type=self.type, base=base)
with disk_activity(code_suffix="clone", disk=self, with disk_activity(code_suffix="clone", disk=self,
user=user, task_uuid=task_uuid): user=user, task_uuid=task_uuid):
......
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