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,17 +525,18 @@
|
|||
<div role="tabpanel">
|
||||
<!-- Nav tabs -->
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li role="presentation" class="active">
|
||||
<a href="#boot_opt" aria-controls="boot" role="tab" data-toggle="tab">
|
||||
{% trans "Boot" %}
|
||||
</a>
|
||||
</li>
|
||||
<li role="presentation">
|
||||
<a href="#disks" aria-controls="disks" role="tab" data-toggle="tab">
|
||||
{% trans "Disk" %}
|
||||
</a>
|
||||
</li>
|
||||
|
||||
{% if request.user.is_superuser %}
|
||||
<li role="presentation" class="active">
|
||||
<a href="#boot_opt" aria-controls="boot" role="tab" data-toggle="tab">
|
||||
{% trans "Boot" %}
|
||||
</a>
|
||||
</li>
|
||||
<li role="presentation">
|
||||
<a href="#disks" aria-controls="disks" role="tab" data-toggle="tab">
|
||||
{% 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,7 +58,10 @@ class wvmCreate(wvmConnect):
|
|||
stg = self.get_storage(storage)
|
||||
storage_type = util.get_xml_path(stg.XMLDesc(0), "/pool/@type")
|
||||
if storage_type == 'dir':
|
||||
name += '.img'
|
||||
if image_format in ('qcow', 'qcow2'):
|
||||
name += '.' + image_format
|
||||
else:
|
||||
name += '.img'
|
||||
alloc = 0
|
||||
else:
|
||||
alloc = size
|
||||
|
|
|
@ -871,18 +871,19 @@ class wvmInstance(wvmConnect):
|
|||
<allocation>0</allocation>
|
||||
<target>
|
||||
<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>
|
||||
<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)
|
||||
|
||||
|
|
|
@ -213,7 +213,10 @@ class wvmStorage(wvmConnect):
|
|||
if vol_fmt == 'unknown':
|
||||
vol_fmt = 'raw'
|
||||
if storage_type == 'dir':
|
||||
name += '.img'
|
||||
if vol_fmt in ('qcow', 'qcow2'):
|
||||
name += '.' + vol_fmt
|
||||
else:
|
||||
name += '.img'
|
||||
alloc = 0
|
||||
xml = """
|
||||
<volume>
|
||||
|
|
Loading…
Reference in a new issue