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
10 changed files with 24 additions and 6 deletions

View File

@@ -1,4 +1,4 @@
## WebVirtCloud Beta
## WebVirtCloud
## Features
@@ -266,6 +266,15 @@ pip install -U -r conf/requirements.txt
python manage.py migrate
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

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
def get_new_disk_dev(media, disks, bus):
existing_disk_devs = []
existing_media_devs = []
if bus == "virtio":
dev_base = "vd"
elif bus == "ide":
@@ -203,9 +205,14 @@ def instance(request, compute_id, vname):
dev_base = "fd"
else:
dev_base = "sd"
existing_disk_devs = [disk['dev'] for disk in disks]
if 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
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:
dev = dev_base + l
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)
bus = request.POST.get('bus', default_bus)
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)
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)
path = connCreate.get_target_path()
target = get_new_disk_dev(None, disks, bus)
target = get_new_disk_dev(media, disks, bus)
source = path + "/" + name;
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,
pool)
conn.refresh()
except libvirtError as liberr:
except libvirtError:
pass
data['vols'] = sorted(conn.get_volumes())
return HttpResponse(json.dumps(data))