1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-11-01 03:54:15 +00:00

Fix disk clone xml for proper disk properties

This commit is contained in:
catborise 2019-04-04 16:04:34 +03:00
parent 3ad520209f
commit 3cffa6e505
2 changed files with 11 additions and 14 deletions

View file

@ -476,11 +476,7 @@ def instance(request, compute_id, vname):
path = connCreate.create_volume(storage, name, size, format, meta_prealloc, default_owner) path = connCreate.create_volume(storage, name, size, format, meta_prealloc, default_owner)
conn.attach_disk(path, target, subdriver=format, cache=cache, targetbus=bus) conn.attach_disk(path, target, subdriver=format, cache=cache, targetbus=bus)
<<<<<<< HEAD
msg = _('Attach new disk: ' + target)
=======
msg = _('Attach new disk {} ({})'.format(name, format)) msg = _('Attach new disk {} ({})'.format(name, format))
>>>>>>> 13ce824... wvmStorage.create_volume, wvmCreate.create_volume image naming respects image/volume format (qcow,qcow2)
addlogmsg(request.user.username, instance.name, msg) addlogmsg(request.user.username, instance.name, msg)
return HttpResponseRedirect(request.get_full_path() + '#disks') return HttpResponseRedirect(request.get_full_path() + '#disks')

View file

@ -871,18 +871,19 @@ class wvmInstance(wvmConnect):
<allocation>0</allocation> <allocation>0</allocation>
<target> <target>
<format type='%s'/> <format type='%s'/>
<permissions>
<owner>%s</owner>
<group>%s</group>
<mode>0644</mode>
<label>virt_image_t</label>
</permissions>
<compat>1.1</compat>
<features>
<lazy_refcounts/>
</features>
</target> </target>
<permissions>
<owner>%s</owner>
<group>%s</group>
<mode>0644</mode>
<label>virt_image_t</label>
</permissions>
<compat>1.1</compat>
<features>
<lazy_refcounts/>
</features>
</volume>""" % (target_file, vol_format, owner['uid'], owner['guid']) </volume>""" % (target_file, vol_format, owner['uid'], owner['guid'])
stg = vol.storagePoolLookupByVolume() stg = vol.storagePoolLookupByVolume()
stg.createXMLFrom(vol_clone_xml, vol, meta_prealloc) stg.createXMLFrom(vol_clone_xml, vol, meta_prealloc)