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..0bb2133 100644 --- a/create/views.py +++ b/create/views.py @@ -125,12 +125,11 @@ 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']: 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) @@ -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(): 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 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 @@ - - - - - + + + + + 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()) 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:
NameStatusVCPUMemoryActions{% trans 'Name' %}{% trans 'Status' %}{% trans 'VCPU' %}{% trans 'Memory' %}{% trans 'Actions' %}