1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-10-31 19:44:16 +00:00

add performance parameters and owner properties to clone_template and create volume

This commit is contained in:
catborise 2018-10-05 17:07:25 +03:00
parent 016e93ebca
commit f2d88b9c65
2 changed files with 17 additions and 1 deletions

View file

@ -76,6 +76,10 @@ class wvmCreate(wvmConnect):
<mode>0644</mode>
<label>virt_image_t</label>
</permissions>
<compat>1.1</compat>
<features>
<lazy_refcounts/>
</features>
</target>
</volume>""" % (name, size, alloc, image_format, owner['uid'], owner['guid'])
stg.createXML(xml, metadata)

View file

@ -10,6 +10,7 @@ from datetime import datetime
from vrtManager.connection import wvmConnect
from vrtManager.storage import wvmStorage
from webvirtcloud.settings import QEMU_CONSOLE_TYPES
from webvirtcloud.settings import INSTANCE_VOLUME_DEFAULT_OWNER as owner
class wvmInstances(wvmConnect):
@ -721,6 +722,7 @@ class wvmInstance(wvmConnect):
if vol_format == 'qcow2' and meta_prealloc:
meta_prealloc = True
vol_clone_xml = """
<volume>
<name>%s</name>
@ -729,7 +731,17 @@ class wvmInstance(wvmConnect):
<target>
<format type='%s'/>
</target>
</volume>""" % (target_file, vol_format)
<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'])
stg = vol.storagePoolLookupByVolume()
stg.createXMLFrom(vol_clone_xml, vol, meta_prealloc)