mirror of
https://github.com/retspen/webvirtcloud
synced 2026-12-02 17:06:09 +00:00
refactor(vrtManager): a new VM's copy of a template is made by clone_volume
clone_from_template wrote its own copy XML next to wvmStorage.clone_volume, which the volume and VM clones use. clone_volume now takes the volume to copy, of its pool or another, so the template's copy goes through it too; it leaves metadata unallocated in a pool of no files, as the template copy did. A qcow2 template's copy in a file pool is now named <vm>.qcow2, like a new empty disk, not <vm>.img.
This commit is contained in:
parent
0d68888510
commit
dd258888d2
6 changed files with 19 additions and 36 deletions
|
|
@ -2673,7 +2673,7 @@ class wvmInstance(wvmConnect):
|
|||
vol = self.get_volume_by_path(source.get("dev"))
|
||||
pool_name = util.get_xml_path(vol.storagePoolLookupByVolume().XMLDesc(0), "/pool/name")
|
||||
storage = self.get_wvmStorage(pool_name)
|
||||
name = storage.clone_volume(vol.name(), target_file)
|
||||
name = storage.clone_volume(vol, target_file)
|
||||
new_path = storage.get_volume(name).path()
|
||||
created.append(new_path)
|
||||
paths[dev] = new_path
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue