mirror of
https://github.com/retspen/webvirtcloud
synced 2024-12-24 23:25:24 +00:00
commit
b3928d5026
5 changed files with 32 additions and 24 deletions
|
@ -525,6 +525,7 @@
|
||||||
<div role="tabpanel">
|
<div role="tabpanel">
|
||||||
<!-- Nav tabs -->
|
<!-- Nav tabs -->
|
||||||
<ul class="nav nav-tabs" role="tablist">
|
<ul class="nav nav-tabs" role="tablist">
|
||||||
|
{% if request.user.is_superuser %}
|
||||||
<li role="presentation" class="active">
|
<li role="presentation" class="active">
|
||||||
<a href="#boot_opt" aria-controls="boot" role="tab" data-toggle="tab">
|
<a href="#boot_opt" aria-controls="boot" role="tab" data-toggle="tab">
|
||||||
{% trans "Boot" %}
|
{% trans "Boot" %}
|
||||||
|
@ -535,7 +536,7 @@
|
||||||
{% trans "Disk" %}
|
{% trans "Disk" %}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
{% endif %}
|
||||||
{% if request.user.is_superuser or userinstance.is_vnc %}
|
{% if request.user.is_superuser or userinstance.is_vnc %}
|
||||||
<li role="presentation">
|
<li role="presentation">
|
||||||
<a href="#vncsettings" aria-controls="vncsettings" role="tab" data-toggle="tab">
|
<a href="#vncsettings" aria-controls="vncsettings" role="tab" data-toggle="tab">
|
||||||
|
|
|
@ -476,7 +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)
|
||||||
msg = _('Attach new disk: ' + target)
|
msg = _('Attach new disk {} ({})'.format(name, format))
|
||||||
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')
|
||||||
|
|
||||||
|
|
|
@ -58,6 +58,9 @@ class wvmCreate(wvmConnect):
|
||||||
stg = self.get_storage(storage)
|
stg = self.get_storage(storage)
|
||||||
storage_type = util.get_xml_path(stg.XMLDesc(0), "/pool/@type")
|
storage_type = util.get_xml_path(stg.XMLDesc(0), "/pool/@type")
|
||||||
if storage_type == 'dir':
|
if storage_type == 'dir':
|
||||||
|
if image_format in ('qcow', 'qcow2'):
|
||||||
|
name += '.' + image_format
|
||||||
|
else:
|
||||||
name += '.img'
|
name += '.img'
|
||||||
alloc = 0
|
alloc = 0
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -871,7 +871,6 @@ class wvmInstance(wvmConnect):
|
||||||
<allocation>0</allocation>
|
<allocation>0</allocation>
|
||||||
<target>
|
<target>
|
||||||
<format type='%s'/>
|
<format type='%s'/>
|
||||||
</target>
|
|
||||||
<permissions>
|
<permissions>
|
||||||
<owner>%s</owner>
|
<owner>%s</owner>
|
||||||
<group>%s</group>
|
<group>%s</group>
|
||||||
|
@ -882,7 +881,9 @@ class wvmInstance(wvmConnect):
|
||||||
<features>
|
<features>
|
||||||
<lazy_refcounts/>
|
<lazy_refcounts/>
|
||||||
</features>
|
</features>
|
||||||
|
</target>
|
||||||
</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)
|
||||||
|
|
||||||
|
|
|
@ -213,6 +213,9 @@ class wvmStorage(wvmConnect):
|
||||||
if vol_fmt == 'unknown':
|
if vol_fmt == 'unknown':
|
||||||
vol_fmt = 'raw'
|
vol_fmt = 'raw'
|
||||||
if storage_type == 'dir':
|
if storage_type == 'dir':
|
||||||
|
if vol_fmt in ('qcow', 'qcow2'):
|
||||||
|
name += '.' + vol_fmt
|
||||||
|
else:
|
||||||
name += '.img'
|
name += '.img'
|
||||||
alloc = 0
|
alloc = 0
|
||||||
xml = """
|
xml = """
|
||||||
|
|
Loading…
Reference in a new issue