From a63e9036fe28f0cd2a629ac2345c66d36ca5c00c Mon Sep 17 00:00:00 2001 From: catborise Date: Tue, 18 Dec 2018 10:18:01 +0300 Subject: [PATCH 1/5] Add trans label to headers --- instances/templates/allinstances.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/instances/templates/allinstances.html b/instances/templates/allinstances.html index 0a00e85..134c21b 100644 --- a/instances/templates/allinstances.html +++ b/instances/templates/allinstances.html @@ -55,11 +55,11 @@ - - - - - + + + + + From a5199806102dc352b9605aebc90d22fed367e90e Mon Sep 17 00:00:00 2001 From: catborise Date: Tue, 18 Dec 2018 10:46:23 +0300 Subject: [PATCH 2/5] Narrow down with pool searching existing volume while creating instance from template/flavour --- create/templates/create_instance.html | 2 +- create/views.py | 2 +- vrtManager/create.py | 7 +++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/create/templates/create_instance.html b/create/templates/create_instance.html index baaada2..34ee73c 100644 --- a/create/templates/create_instance.html +++ b/create/templates/create_instance.html @@ -441,7 +441,7 @@
- {% if storages %} {% for storage in storages %} diff --git a/create/views.py b/create/views.py index b367e95..1f8cfe3 100644 --- a/create/views.py +++ b/create/views.py @@ -130,7 +130,7 @@ def create_instance(request, compute_id): error_messages.append(lib_err.message) elif data['template']: templ_path = conn.get_volume_path(data['template']) - dest_vol = conn.get_volume_path(data["name"] + ".img") + dest_vol = conn.get_volume_path(data["name"] + ".img", data['storage']) if dest_vol: error_msg = _("Image has already exist. Please check volumes or change instance name") error_messages.append(error_msg) diff --git a/vrtManager/create.py b/vrtManager/create.py index 29d2e68..5a41a6a 100644 --- a/vrtManager/create.py +++ b/vrtManager/create.py @@ -100,8 +100,11 @@ class wvmCreate(wvmConnect): else: return 'raw' - def get_volume_path(self, volume): - storages = self.get_storages(only_actives=True) + def get_volume_path(self, volume, pool=None): + if not pool: + storages = self.get_storages(only_actives=True) + else: + storages = [pool,] for storage in storages: stg = self.get_storage(storage) if stg.info()[0] != 0: From fc3f04c2448ed3759e9fa435827697bec29728f7 Mon Sep 17 00:00:00 2001 From: catborise Date: Mon, 3 Dec 2018 16:18:41 +0300 Subject: [PATCH 3/5] Add pool refresh before getting list of volumes --- storages/views.py | 1 + 1 file changed, 1 insertion(+) diff --git a/storages/views.py b/storages/views.py index 2b3910f..ba9520e 100644 --- a/storages/views.py +++ b/storages/views.py @@ -221,6 +221,7 @@ def get_volumes(request, compute_id, pool): compute.password, compute.type, pool) + conn.refresh() except libvirtError as liberr: pass data['vols'] = sorted(conn.get_volumes()) From 4efc311dec7e76f9759a7d5973e5cab7f317a216 Mon Sep 17 00:00:00 2001 From: catborise Date: Tue, 4 Dec 2018 14:37:05 +0300 Subject: [PATCH 4/5] remove artifacts old implementation --- create/views.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/create/views.py b/create/views.py index 1f8cfe3..0bb2133 100644 --- a/create/views.py +++ b/create/views.py @@ -125,7 +125,6 @@ def create_instance(request, compute_id): volume['device'] = 'disk' volume['bus'] = 'virtio' volume_list.append(volume) - #volumes[path] = conn.get_volume_type(path) except libvirtError as lib_err: error_messages.append(lib_err.message) elif data['template']: @@ -142,7 +141,6 @@ def create_instance(request, compute_id): volume['device'] = 'disk' volume['bus'] = 'virtio' volume_list.append(volume) - #volumes[clone_path] = conn.get_volume_type(clone_path) else: if not data['images']: error_msg = _("First you need to create or select an image") @@ -158,9 +156,6 @@ def create_instance(request, compute_id): volume['device'] = request.POST.get('device' + str(idx), '') volume['bus'] = request.POST.get('bus' + str(idx), '') volume_list.append(volume) - - #volumes[path] = conn.get_volume_type(path) - except libvirtError as lib_err: error_messages.append(lib_err.message) if data['cache_mode'] not in conn.get_cache_modes(): From 867a10d0c53446f9a89e962cc233af113d663904 Mon Sep 17 00:00:00 2001 From: catborise Date: Thu, 27 Dec 2018 16:17:51 +0300 Subject: [PATCH 5/5] Ubuntu 18.04 installation support added --- dev/libvirt-bootstrap.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/dev/libvirt-bootstrap.sh b/dev/libvirt-bootstrap.sh index 66eb6de..e3dd702 100644 --- a/dev/libvirt-bootstrap.sh +++ b/dev/libvirt-bootstrap.sh @@ -590,15 +590,23 @@ daemons_running_opensuse() { # install_ubuntu() { apt-get update || return 1 - apt-get -y install kvm libvirt-bin bridge-utils sasl2-bin python-guestfs supervisor || return 1 + if [ $DISTRO_MAJOR_VERSION -lt 18 ]; then + apt-get -y install kvm libvirt-bin bridge-utils sasl2-bin python-guestfs supervisor || return 1 + else + apt install -y qemu-kvm libvirt-bin bridge-utils virt-manager sasl2-bin python-guestfs supervisor || return 1 + fi + + return 0 } install_ubuntu_post() { if [ -f /etc/default/libvirt-bin ]; then sed -i 's/libvirtd_opts="-d"/libvirtd_opts="-d -l"/g' /etc/default/libvirt-bin + elif [ -f /etc/default/libvirtd ]; then + sed -i 's/libvirtd_opts="-d"/libvirtd_opts="-d -l"/g' /etc/default/libvirtd else - echoerror "/etc/default/libvirt-bin not found. Exiting..." + echoerror "/etc/default/libvirt-bin or /etc/default/libvirtd not found. Exiting..." exit 1 fi if [ -f /etc/libvirt/libvirtd.conf ]; then
NameStatusVCPUMemoryActions{% trans 'Name' %}{% trans 'Status' %}{% trans 'VCPU' %}{% trans 'Memory' %}{% trans 'Actions' %}