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