mirror of
https://github.com/retspen/webvirtcloud
synced 2025-07-31 12:41:08 +00:00
Enrich Instance Create operation: -add capability to create arm, ppc, i686, aarch64 instances, -add option to choose firmware, -add options to choose chipset. -add capability to choose volume driver options. -add new default settings
This commit is contained in:
parent
28b001e7cb
commit
dd16a5b2d5
14 changed files with 828 additions and 211 deletions
|
|
@ -176,8 +176,9 @@
|
|||
{% if request.user.is_superuser %}
|
||||
<script>
|
||||
function goto_compute() {
|
||||
var compute = $("#compute_select").val();
|
||||
window.location.href = "{% url 'create_instance' 1 %}".replace(1, compute);
|
||||
let compute = $("#compute_select").val();
|
||||
{#window.location.href = "{% url 'create_instance' 1 %}".replace(1, compute);#}
|
||||
window.location.href = "{% url 'create_instance_select_type' 1 %}".replace(1, compute);
|
||||
}
|
||||
</script>
|
||||
{% endif %}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
{% if request.user.is_superuser %}
|
||||
<a href="{% url 'create_instance' compute.id %}" type="button" class="btn btn-success btn-header pull-right" data-toggle="modal">
|
||||
<a href="{% url 'create_instance_select_type' compute.id %}" type="button" class="btn btn-success btn-header pull-right" data-toggle="modal">
|
||||
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
|
||||
</a>
|
||||
{% endif %}
|
||||
|
|
@ -161,7 +161,7 @@
|
|||
<script src="{% static "js/sortable.min.js" %}"></script>
|
||||
<script>
|
||||
function open_console(uuid) {
|
||||
window.open("{% url 'console' %}?token=" + uuid, "", "width=850,height=485");
|
||||
window.open("{% url 'console' %}?token=" + uuid, "", "width=850,height=685");
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
|
|
@ -189,12 +189,4 @@
|
|||
window.location = "/instances/" + compute + "/" + instance + "/#clone";
|
||||
}
|
||||
</script>
|
||||
{% if request.user.is_superuser %}
|
||||
<script>
|
||||
function goto_compute() {
|
||||
var compute = $("#compute_select").val();
|
||||
window.location.href = "{% url 'create_instance' 1 %}".replace(1, compute);
|
||||
}
|
||||
</script>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
|
@ -22,7 +22,7 @@ from vrtManager.connection import connection_manager
|
|||
from vrtManager.create import wvmCreate
|
||||
from vrtManager.storage import wvmStorage
|
||||
from vrtManager.util import randomPasswd
|
||||
from libvirt import libvirtError, VIR_DOMAIN_XML_SECURE
|
||||
from libvirt import libvirtError, VIR_DOMAIN_XML_SECURE, VIR_DOMAIN_UNDEFINE_KEEP_NVRAM, VIR_DOMAIN_UNDEFINE_NVRAM
|
||||
from logs.views import addlogmsg
|
||||
from django.conf import settings
|
||||
from django.contrib import messages
|
||||
|
|
@ -265,6 +265,8 @@ def instance(request, compute_id, vname):
|
|||
autostart = conn.get_autostart()
|
||||
bootmenu = conn.get_bootmenu()
|
||||
boot_order = conn.get_bootorder()
|
||||
arch = conn.get_arch()
|
||||
machine = conn.get_machine_type()
|
||||
vcpu = conn.get_vcpu()
|
||||
cur_vcpu = conn.get_cur_vcpu()
|
||||
vcpus = conn.get_vcpus()
|
||||
|
|
@ -288,6 +290,7 @@ def instance(request, compute_id, vname):
|
|||
insort(memory_range, memory)
|
||||
if cur_memory not in memory_range:
|
||||
insort(memory_range, cur_memory)
|
||||
nvram = conn.get_nvram()
|
||||
telnet_port = conn.get_telnet_port()
|
||||
console_type = conn.get_console_type()
|
||||
console_port = conn.get_console_port()
|
||||
|
|
@ -330,8 +333,8 @@ def instance(request, compute_id, vname):
|
|||
# Host resources
|
||||
vcpu_host = len(vcpu_range)
|
||||
memory_host = conn.get_max_memory()
|
||||
bus_host = conn.get_disk_bus_types()
|
||||
videos_host = conn.get_video_models()
|
||||
bus_host = conn.get_disk_bus_types(arch, machine)
|
||||
videos_host = conn.get_video_models(arch, machine)
|
||||
networks_host = sorted(conn.get_networks())
|
||||
interfaces_host = sorted(conn.get_ifaces())
|
||||
nwfilters_host = conn.get_nwfilters()
|
||||
|
|
@ -374,7 +377,11 @@ def instance(request, compute_id, vname):
|
|||
for snap in snapshots:
|
||||
conn.snapshot_delete(snap['name'])
|
||||
conn.delete_all_disks()
|
||||
conn.delete()
|
||||
|
||||
if request.POST.get('delete_nvram', ''):
|
||||
conn.delete(VIR_DOMAIN_UNDEFINE_NVRAM)
|
||||
else:
|
||||
conn.delete(VIR_DOMAIN_UNDEFINE_KEEP_NVRAM)
|
||||
|
||||
instance = Instance.objects.get(compute_id=compute_id, name=vname)
|
||||
instance_name = instance.name
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue