Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
f68d53f
upgrade chartjs 1.0.2 -> 1.1.1
catborise Oct 31, 2018
69be623
upgrade bootstrap-multiselect to v0.9.15
catborise Oct 31, 2018
fab3b28
add filter bar to 'add disk' dropdown. Limit the size of dropdown list.
catborise Oct 31, 2018
8ecd453
fix: initialize used_size variable. it causes error if instance disks…
catborise Nov 5, 2018
d3b43b2
add hide/show all instances funtionality
catborise Nov 7, 2018
5872700
remove caret: bootstrap-multiselect, inheritClass
catborise Nov 7, 2018
605d24d
define allow_admin_or_not_template variable, template cannot use pare…
catborise Nov 8, 2018
40ada89
add log message when an instance is created
catborise Nov 14, 2018
45c3f9b
index_grouped: remove unused data-sortable. index_nongrouped: add tra…
catborise Nov 14, 2018
4eda0fb
add chevron-toggle to collapse_all on grouped_index
catborise Nov 14, 2018
6573319
add volumes url to get volume list of specified storage pool
catborise Nov 16, 2018
5b60dd7
fix validation error message of network.
catborise Nov 16, 2018
91f01d8
add get_volumes function to view. And Remove unused 'get' artifact.
catborise Nov 16, 2018
45720d3
convert HDD selection of new instance creation to user request. Befor…
catborise Nov 16, 2018
44d73cc
Add ability to resize only vm memory while it is running.
catborise Nov 20, 2018
84bf04a
add getting list of disk device types. Rename getting disk bus types …
catborise Nov 22, 2018
08451a0
remove font-weight on labels. Increase max volume size limit to 3-5.
catborise Nov 22, 2018
469cc05
rename type variable, add bus info while getting media devices. remov…
catborise Nov 23, 2018
eb8aae9
Bundle: Add/Delete Cdrom function added. Add disk device type/bus cho…
catborise Nov 23, 2018
be75381
Change column sizes. Add icon for deselecting of disks/networks. add …
catborise Nov 23, 2018
7672cc0
Merge branch 'online_resize'
catborise Nov 23, 2018
a67acc5
Merge branch 'master' of https://github.com/catborise/webvirtcloud
catborise Nov 26, 2018
62908f4
Qemu Guest Agent channel add option while creating instance
catborise Nov 26, 2018
04d3568
add instance count to host collapse
catborise Dec 4, 2018
c98f0b1
Add lib and qemu version info to compute overview
catborise Dec 5, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion computes/templates/overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ <h3 class="page-header">{% trans "Basic details" %}</h3>
<p>{% trans "Hostname" %}</p>
<p>{% trans "Hypervisors" %}</p>
<p>{% trans "Emulator" %}</p>
<p>{% trans "Version" %}</p>
<p>{% trans "Memory" %}</p>
<p>{% trans "Architecture" %}</p>
<p>{% trans "Logical CPUs" %}</p>
Expand All @@ -55,10 +56,17 @@ <h3 class="page-header">{% trans "Basic details" %}</h3>
<span class="glyphicon glyphicon-chevron-right"></span>
<span class="label label-default">{{ arch }}</span>
{% for h in hpv %}
<span class="label label-primary">{{ h }}</span>{% endfor %}
<span class="label label-primary">{{ h }}</span>
{% endfor %}
{% endfor %}
</p>
<p>{{ emulator }}</p>
<p>
<span class="label label-default">{% trans 'Qemu' %} </span>
<span class="label label-primary">{{ version }}</span> &nbsp;
<span class="label label-default">{% trans 'Libvirt' %} </span>
<span class="label label-primary">{{ lib_version }}</span> &nbsp;
</p>
<p>{{ host_memory|filesizeformat }}</p>
<p>{{ host_arch }}</p>
<p>{{ logical_cpu }}</p>
Expand Down
6 changes: 4 additions & 2 deletions computes/urls.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from django.conf.urls import url
from storages.views import storages, storage
from storages.views import storages, storage, get_volumes
from networks.views import networks, network
from secrets.views import secrets
from create.views import create_instance
from interfaces.views import interfaces, interface
from computes.views import overview, compute_graph, computes
from computes.views import overview, compute_graph, computes, get_compute_disk_buses
from instances.views import instances
from nwfilters.views import nwfilter, nwfilters

Expand All @@ -14,6 +14,7 @@
url(r'^(?P<compute_id>[0-9]+)/statistics$', compute_graph, name='compute_graph'),
url(r'^(?P<compute_id>[0-9]+)/instances/$', instances, name='instances'),
url(r'^(?P<compute_id>[0-9]+)/storages/$', storages, name='storages'),
url(r'^(?P<compute_id>[0-9]+)/storage/(?P<pool>[\w\-\.\/]+)/volumes$', get_volumes, name='volumes'),
url(r'^(?P<compute_id>[0-9]+)/storage/(?P<pool>[\w\-\.\/]+)/$', storage, name='storage'),
url(r'^(?P<compute_id>[0-9]+)/networks/$', networks, name='networks'),
url(r'^(?P<compute_id>[0-9]+)/network/(?P<pool>[\w\-\.]+)/$', network, name='network'),
Expand All @@ -23,4 +24,5 @@
url(r'^(?P<compute_id>[0-9]+)/nwfilter/(?P<nwfltr>[\w\-\.\:]+)/$', nwfilter, name='nwfilter'),
url(r'^(?P<compute_id>[0-9]+)/secrets/$', secrets, name='secrets'),
url(r'^(?P<compute_id>[0-9]+)/create/$', create_instance, name='create_instance'),
url(r'^(?P<compute_id>[0-9]+)/disk/(?P<disk>[\w\-\.\/]+)/buses$', get_compute_disk_buses, name='buses'),
]
33 changes: 32 additions & 1 deletion computes/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from accounts.models import UserInstance
from computes.forms import ComputeAddTcpForm, ComputeAddSshForm, ComputeEditHostForm, ComputeAddTlsForm, ComputeAddSocketForm
from vrtManager.hostdetails import wvmHostDetails
from vrtManager.connection import CONN_SSH, CONN_TCP, CONN_TLS, CONN_SOCKET, connection_manager
from vrtManager.connection import CONN_SSH, CONN_TCP, CONN_TLS, CONN_SOCKET, connection_manager, wvmConnect
from libvirt import libvirtError


Expand Down Expand Up @@ -157,6 +157,8 @@ def overview(request, compute_id):
hypervisor = conn.hypervisor_type()
mem_usage = conn.get_memory_usage()
emulator = conn.get_emulator(host_arch)
version = conn.get_version()
lib_version = conn.get_lib_version()
conn.close()
except libvirtError as lib_err:
error_messages.append(lib_err)
Expand Down Expand Up @@ -225,3 +227,32 @@ def compute_graph(request, compute_id):
response.cookies['mem'] = datasets['mem']
response.write(data)
return response


@login_required
def get_compute_disk_buses(request, compute_id, disk):
data = {}
compute = get_object_or_404(Compute, pk=compute_id)
try:
conn = wvmConnect(compute.hostname,
compute.login,
compute.password,
compute.type)

disk_device_types = conn.get_disk_device_types()
disk_bus_types = conn.get_disk_bus_types()

if disk in disk_device_types:
if disk == 'disk':
data['bus'] = sorted(disk_device_types)
elif disk == 'cdrom':
data['bus'] = ['ide', 'sata', 'scsi',]
elif disk == 'floppy':
data['bus'] = ['fdc',]
elif disk == 'lun':
data['bus'] = ['scsi',]
except libvirtError:
pass

return HttpResponse(json.dumps(data))

3 changes: 2 additions & 1 deletion create/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class NewVMForm(forms.Form):
host_model = forms.BooleanField(required=False)
disk = forms.IntegerField(required=False)
memory = forms.IntegerField(error_messages={'required': _('No RAM size has been entered')})
networks = forms.CharField(error_messages={'required': _('No Network pool has been choice')})
networks = forms.CharField(error_messages={'required': _('No Network pool has been choosen')})
nwfilter = forms.CharField(required=False)
storage = forms.CharField(max_length=20, required=False)
template = forms.CharField(required=False)
Expand All @@ -46,6 +46,7 @@ class NewVMForm(forms.Form):
hdd_size = forms.IntegerField(required=False)
meta_prealloc = forms.BooleanField(required=False)
virtio = forms.BooleanField(required=False)
qemu_ga = forms.BooleanField(required=False)
mac = forms.CharField(required=False)
console_pass = forms.CharField(required=False,empty_value="", widget=forms.PasswordInput())
video = forms.CharField(error_messages={'required': _('Please select a graphic display')})
Expand Down
Loading