From a048adef8e9ddab8203dd376ed3d6617441b8275 Mon Sep 17 00:00:00 2001 From: catborise Date: Wed, 28 Feb 2024 08:13:08 +0300 Subject: [PATCH 1/3] do not show warning message when instance is shutdown --- instances/templates/instances/settings_tab.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/instances/templates/instances/settings_tab.html b/instances/templates/instances/settings_tab.html index 0ea78d4..2031542 100644 --- a/instances/templates/instances/settings_tab.html +++ b/instances/templates/instances/settings_tab.html @@ -660,7 +660,9 @@
-

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

+ {% if instance.status != 5 %} +

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

+ {% endif %}
{% csrf_token %}
From d8fe9c2f64eae62050aeae38fb15cd12249a88b7 Mon Sep 17 00:00:00 2001 From: catborise Date: Wed, 28 Feb 2024 08:15:02 +0300 Subject: [PATCH 2/3] add user to libvirt group also --- webvirtcloud.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/webvirtcloud.sh b/webvirtcloud.sh index 1026a9f..3752181 100755 --- a/webvirtcloud.sh +++ b/webvirtcloud.sh @@ -197,6 +197,7 @@ create_user () { fi usermod -a -G "$nginx_group" "$APP_USER" + usermod -a -G libvirt "$nginx_group" } run_as_app_user () { From 765b759953076896bc9600511805af3ac15f3149 Mon Sep 17 00:00:00 2001 From: catborise Date: Wed, 28 Feb 2024 08:16:44 +0300 Subject: [PATCH 3/3] if nic type is default then make it virtio --- .../migrations/0011_alter_appsettings_id.py | 20 +++++++++++++++++++ instances/views.py | 3 +++ 2 files changed, 23 insertions(+) create mode 100644 appsettings/migrations/0011_alter_appsettings_id.py diff --git a/appsettings/migrations/0011_alter_appsettings_id.py b/appsettings/migrations/0011_alter_appsettings_id.py new file mode 100644 index 0000000..dfbfe60 --- /dev/null +++ b/appsettings/migrations/0011_alter_appsettings_id.py @@ -0,0 +1,20 @@ +# Generated by Django 4.2.10 on 2024-02-14 11:54 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("appsettings", "0010_auto_20231030_1305"), + ] + + operations = [ + migrations.AlterField( + model_name="appsettings", + name="id", + field=models.AutoField( + auto_created=True, primary_key=True, serialize=False, verbose_name="ID" + ), + ), + ] diff --git a/instances/views.py b/instances/views.py index cfaa157..22e34e8 100755 --- a/instances/views.py +++ b/instances/views.py @@ -1853,6 +1853,9 @@ def create_instance(request, compute_id, arch, machine): machine = "q35" firmware["secure"] = "yes" + if data["net_model"] == "default": + data["net_model"] = "virtio" + uuid = util.randomUUID() try: conn.create_instance(