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

Merge pull request #224 from catborise/master

Add Screenshot and one fix
This commit is contained in:
Anatoliy Guskov 2019-02-22 22:01:11 +02:00 committed by GitHub
commit a9a2e1167b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 24 additions and 6 deletions

View file

@ -1,4 +1,4 @@
## WebVirtCloud Beta ## WebVirtCloud
## Features ## Features
@ -266,6 +266,15 @@ pip install -U -r conf/requirements.txt
python manage.py migrate python manage.py migrate
sudo service supervisor restart sudo service supervisor restart
``` ```
### Screenshots
Instance Detail:</br>
<img src="doc/images/instance.PNG" width="95%" align="center"></img>
Instance List:</br>
<img src="doc/images/grouped.PNG" width="47%"></img>
<img src="doc/images/nongrouped.PNG" width="51%"></img>
Other: </br>
<img src="doc/images/hosts.PNG" width="52%"></img>
<img src="doc/images/log.PNG" width="47%"></img>
### License ### License

BIN
doc/images/grouped.PNG Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

BIN
doc/images/hosts.PNG Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
doc/images/instance.PNG Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
doc/images/log.PNG Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

BIN
doc/images/nongrouped.PNG Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

1
doc/images/readme.md Normal file
View file

@ -0,0 +1 @@
IMAGES

1
doc/readme.md Normal file
View file

@ -0,0 +1 @@
README

View file

@ -195,6 +195,8 @@ def instance(request, compute_id, vname):
return msg return msg
def get_new_disk_dev(media, disks, bus): def get_new_disk_dev(media, disks, bus):
existing_disk_devs = []
existing_media_devs = []
if bus == "virtio": if bus == "virtio":
dev_base = "vd" dev_base = "vd"
elif bus == "ide": elif bus == "ide":
@ -203,9 +205,14 @@ def instance(request, compute_id, vname):
dev_base = "fd" dev_base = "fd"
else: else:
dev_base = "sd" dev_base = "sd"
if disks:
existing_disk_devs = [disk['dev'] for disk in disks] existing_disk_devs = [disk['dev'] for disk in disks]
# cd-rom bus could be virtio/sata, because of that we should check it also # cd-rom bus could be virtio/sata, because of that we should check it also
existing_media_devs = [disk['dev'] for disk in media] if media:
existing_media_devs = [m['dev'] for m in media]
for l in string.lowercase: for l in string.lowercase:
dev = dev_base + l dev = dev_base + l
if dev not in existing_disk_devs and dev not in existing_media_devs: if dev not in existing_disk_devs and dev not in existing_media_devs:
@ -465,7 +472,7 @@ def instance(request, compute_id, vname):
meta_prealloc = request.POST.get('meta_prealloc', False) meta_prealloc = request.POST.get('meta_prealloc', False)
bus = request.POST.get('bus', default_bus) bus = request.POST.get('bus', default_bus)
cache = request.POST.get('cache', default_cache) cache = request.POST.get('cache', default_cache)
target = get_new_disk_dev(None, disks, bus) target = get_new_disk_dev(media, disks, bus)
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)
@ -487,7 +494,7 @@ def instance(request, compute_id, vname):
format = connCreate.get_volume_type(name) format = connCreate.get_volume_type(name)
path = connCreate.get_target_path() path = connCreate.get_target_path()
target = get_new_disk_dev(None, disks, bus) target = get_new_disk_dev(media, disks, bus)
source = path + "/" + name; source = path + "/" + name;
conn.attach_disk(source, target, subdriver=format, cache=cache, targetbus=bus) conn.attach_disk(source, target, subdriver=format, cache=cache, targetbus=bus)

View file

@ -222,7 +222,7 @@ def get_volumes(request, compute_id, pool):
compute.type, compute.type,
pool) pool)
conn.refresh() conn.refresh()
except libvirtError as liberr: except libvirtError:
pass pass
data['vols'] = sorted(conn.get_volumes()) data['vols'] = sorted(conn.get_volumes())
return HttpResponse(json.dumps(data)) return HttpResponse(json.dumps(data))