diff --git a/computes/views.py b/computes/views.py index bb9c55e..7bc7700 100644 --- a/computes/views.py +++ b/computes/views.py @@ -177,7 +177,7 @@ def compute_graph(request, compute_id): datasets = {} cookies = {} compute = get_object_or_404(Compute, pk=compute_id) - curent_time = time.strftime("%H:%M:%S") + current_time = time.strftime("%H:%M:%S") try: conn = wvmHostDetails(compute.hostname, @@ -208,7 +208,7 @@ def compute_graph(request, compute_id): datasets['mem'] = eval(cookies['mem']) datasets['timer'] = eval(cookies['timer']) - datasets['timer'].append(curent_time) + datasets['timer'].append(current_time) datasets['cpu'].append(int(cpu_usage['usage'])) datasets['mem'].append(int(mem_usage['usage']) / 1048576) diff --git a/conf/requirements.txt b/conf/requirements.txt index 49903c0..d8c5a5f 100644 --- a/conf/requirements.txt +++ b/conf/requirements.txt @@ -1,7 +1,7 @@ -Django==1.11.14 +Django==1.11.17 websockify==0.8.0 gunicorn==19.9.0 -lxml==4.2.3 -libvirt-python==4.4.0 +lxml==4.2.5 +libvirt-python==4.10.0 pytz diff --git a/create/templates/create_instance.html b/create/templates/create_instance.html index 34ee73c..bb3b0a2 100644 --- a/create/templates/create_instance.html +++ b/create/templates/create_instance.html @@ -441,7 +441,7 @@
- {% if storages %} {% for storage in storages %} @@ -458,6 +458,20 @@
+
+ +
+ +
+
@@ -697,6 +711,9 @@ }); }); $("#template").removeAttr("disabled"); + $("#storage").val(pool).change(); + $("#storage").removeAttr("disabled"); + } function get_disk_bus_choices(compute_id, dev_idx, disk_type){ diff --git a/create/views.py b/create/views.py index 0bb2133..9bd881a 100644 --- a/create/views.py +++ b/create/views.py @@ -134,7 +134,7 @@ def create_instance(request, compute_id): error_msg = _("Image has already exist. Please check volumes or change instance name") error_messages.append(error_msg) else: - clone_path = conn.clone_from_template(data['name'], templ_path, metadata=meta_prealloc) + clone_path = conn.clone_from_template(data['name'], templ_path, data['storage'], metadata=meta_prealloc) volume = dict() volume['path'] = clone_path volume['type'] = conn.get_volume_type(clone_path) diff --git a/instances/templates/add_instance_volume.html b/instances/templates/add_instance_volume.html index 9cea2fc..6b0fed3 100644 --- a/instances/templates/add_instance_volume.html +++ b/instances/templates/add_instance_volume.html @@ -1,6 +1,6 @@ {% load i18n %} {% if request.user.is_superuser %} - + diff --git a/instances/templates/instance.html b/instances/templates/instance.html index f0a6388..bd6bb78 100644 --- a/instances/templates/instance.html +++ b/instances/templates/instance.html @@ -40,7 +40,7 @@
{% if user_quota_msg %} - {{ user_quota_msg|capfirst }} quota reached. + {{ user_quota_msg|capfirst }} {% trans "quota reached" %}. {% endif %}
@@ -187,23 +187,18 @@ {% endif %} {% endifequal %} {% ifequal status 3 %} - {% if request.user.is_superuser %} -
+
+
{% csrf_token %} + {% if request.user.is_superuser %}

{% trans "This action restore the instance after suspend." %}

- {% csrf_token %} - -
-
-
- {% else %} -
+ + {% else %}

{% trans "Administrator blocked your instance." %}

-
{% csrf_token %} - -
-
-
- {% endif %} + + {% endif %} +
+ +
{% endifequal %} {% ifequal status 5 %}
@@ -270,7 +265,6 @@
  • {% trans "Console - Full" %}
  • - {% else %} {% endifequal %} @@ -350,7 +344,7 @@
    {% if request.user.is_superuser or request.user.is_staff or userinstance.is_change %}
    {% csrf_token %} -

    {% trans "Logical host CPUs:" %} {{ vcpu_host }}

    +

    {% trans "Logical host CPUs" %} : {{ vcpu_host }}

    @@ -381,8 +375,7 @@
    @@ -392,7 +385,6 @@
    -
    - {% if media_iso %} - {% for iso in media_iso %} - - {% endfor %} - {% else %} - - {% endif %} - -
    -
    - {% if media_iso and allow_admin_or_not_template %} - - {% if status == 5 %} - - {% endif %} - {% else %} - - {% endif %} -
    +
    +

    {% trans "Autostart your instance when host server is power on " %} + {% ifequal autostart 0 %} + {% else %} -

    - -
    -
    - - {% if allow_admin_or_not_template %} - - {% else %} - - {% endif %} -
    - {% endif %} + + {% endifequal %} +

    +
    - {% endfor %} -
    -
    -
    -

    - {% trans "Instance Volumes" %} - {% include 'add_instance_volume.html' %} -

    +

    {% trans 'Boot Order' %}

    +
    {% csrf_token %} +
    +
    + {% ifequal status 5 %} +

    {% trans "Enable Boot Menu for your instance when it starts up " %} + {% ifequal bootmenu 0 %} + + {% else %} + + {% endifequal %} + {% else %} +

    {% trans "**** Please shutdown instance to modify boot menu ****" %} + {% endifequal %} +

    +
    +
    +
    + {% ifequal bootmenu 1 %} +
    +
    + {% for idx, val in boot_order.items %} + + {% endfor %} +
    +
    +
    {% csrf_token %} + +
    +
    +
    + {% for disk in disks %} + + {% endfor %} + {% for cd in media %} + + {% endfor %} + {% for net in networks %} + + {% endfor %} +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + {% endifequal %} +
    +
    +
    + {% if status == 5 %} +
    {% csrf_token %} +

    + {% trans "Instance Media" %} + +

    +
    + {% endif %} + {% for cd in media %} +
    {% csrf_token %} +
    + + {% trans "CDROM" %} {{ forloop.counter }} + + {% if not cd.image %} +
    + +
    +
    + {% if media_iso and allow_admin_or_not_template %} + + {% else %} + + {% endif %} + {% if status == 5 and allow_admin_or_not_template %} + + {% endif %} +
    + {% else %} +
    + +
    +
    + + {% if allow_admin_or_not_template %} + + {% else %} + + {% endif %} +
    + {% endif %} +
    +
    + {% endfor %} -
    +

    + {% trans "Instance Volume" %} + {% include 'add_instance_volume.html' %} +

    + +
    @@ -685,7 +741,9 @@ data-trigger="focus" data-toggle="popover" data-html="true" - data-content="Bus: {{ disk.bus }}
    Format: {{ disk.format }}"> + data-content="Bus: {{ disk.bus }}
    + Format: {{ disk.format }}
    + Cache: {{ disk.cache }}"> {{ disk.dev }} @@ -724,21 +782,167 @@
    {% trans "Device" %}
    -
    -
    +
    +
    +
    +

    + {% trans "Assign network device to bridge" %} + {% include 'add_instance_network_block.html' %} +

    +

    {% trans "Network devices" %}

    +
    +
    {% csrf_token %} + {% for network in networks %} +
    +
    + +
    +
    +
    + + + + +
    +
    + + + + +
    +
    + + + + +
    +
    - {% if request.user.is_superuser %} -
    -

    {% trans "Autostart your instance when host server is power on" %}

    - {% csrf_token %} - {% ifequal autostart 0 %} - + +
    + {% endfor %} + +
    +
    + +
    +
    +

    {% trans "For migration both host servers must have equal settings and OS type" %}

    +
    {% csrf_token %} +
    + +
    +

    {{ compute.name }}

    +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    + {% if computes_count != 1 %} + {% else %} - + + {% endif %} +
    +

    +
    +
    +

    {% trans "If you need to edit xml please Power Off the instance" %}

    +
    {% csrf_token %} +
    + +
    + {% ifequal status 5 %} + + + {% else %} + {% endifequal %}
    +
    +
    +

    + {% trans "Instance owners" %} + {% include 'add_instance_owner_block.html' %} +

    +
    +
    + + + {% for userinstance in userinstances %} + + + + + {% endfor %} + +
    {{ userinstance.user }} +
    {% csrf_token %} + + +
    +
    +
    +
    +
    {% endif %} {% if request.user.is_superuser or userinstance.is_vnc %}
    @@ -855,65 +1059,6 @@
    {% endif %} - {% if request.user.is_superuser %} -
    -

    - {% trans "Assign network device to bridge" %} - {% include 'add_instance_network_block.html' %} -

    -

    {% trans "Network devices" %}

    -
    -
    {% csrf_token %} - {% for network in networks %} -
    -
    - -
    -
    -
    - - - - -
    -
    - - - - -
    -
    - - - - -
    -
    - - -
    - {% endfor %} -
    -
    -
    - -
    - {% endif %} {% if request.user.is_superuser or request.user.userattributes.can_clone_instances %}

    {% trans "Create a clone" %}

    @@ -921,25 +1066,25 @@
    {% if request.user.is_superuser %} -
    - -
    -
    - -
    +
    + +
    +
    + +
    {% elif clone_instance_auto_name %} -
    - -
    +
    + +
    {% else %} -
    - -
    +
    + +
    {% endif %}
    {% if request.user.is_superuser %} @@ -1004,84 +1149,6 @@
    - {% endif %} - {% if request.user.is_superuser %} -
    -

    {% trans "For migration both host servers must have equal settings and OS type" %}

    -
    {% csrf_token %} -
    - -
    -

    {{ compute.name }}

    -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    - {% if computes_count != 1 %} - - {% else %} - - {% endif %} -
    -

    -
    -
    -

    {% trans "If you need to edit xml please Power Off the instance" %}

    -
    {% csrf_token %} -
    - -
    - {% ifequal status 5 %} - - - {% else %} - - {% endifequal %} -
    -
    -
    - {% endif %} - {% if request.user.is_superuser or request.user.userattributes.can_clone_instances %}
    {% csrf_token %}
    @@ -1111,36 +1178,6 @@
    {% endif %} - {% if request.user.is_superuser %} -
    -
    -

    - {% trans "Instance owners" %} - {% include 'add_instance_owner_block.html' %} -

    -
    -
    - - - {% for userinstance in userinstances %} - - - - - {% endfor %} - -
    {{ userinstance.user }} - {% csrf_token %} - - - -
    -
    -
    -
    - {% endif %}
    @@ -1215,7 +1252,7 @@ - None ... + {% trans 'None' %}...
    @@ -1269,8 +1306,6 @@ @@ -1413,7 +1446,6 @@ }); $(document).ready(function () { // set vdi url - $.get("{% url 'vdi_url' vname %}", function(data) { $("#vdi_url_input").attr("value", data); $("#vdi_url").attr("href", data); @@ -1443,6 +1475,69 @@ $(document).ready(function(){ }); }); +