summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xci/playbooks/roles/create-vm-nodes/tasks/create_vm.yml6
-rwxr-xr-xxci/scripts/vm/start-new-vm.sh11
2 files changed, 10 insertions, 7 deletions
diff --git a/xci/playbooks/roles/create-vm-nodes/tasks/create_vm.yml b/xci/playbooks/roles/create-vm-nodes/tasks/create_vm.yml
index d8169c2f..ab427c69 100644
--- a/xci/playbooks/roles/create-vm-nodes/tasks/create_vm.yml
+++ b/xci/playbooks/roles/create-vm-nodes/tasks/create_vm.yml
@@ -40,6 +40,12 @@
path: "{{ opnfv_image_path }}/{{ vm_name }}.qcow2"
register: _vm_volume_prepared
+ - name: Resize opnfv VM image to {{ item.disks[0].disk_capacity }}
+ command: "qemu-img resize {{ opnfv_image_path }}/opnfv.qcow2 {{ item.disks[0].disk_capacity }}"
+ when:
+ - vm_name == 'opnfv'
+ - _vm_volume_prepared.stat.exists
+
# NOTE(pas-ha) Ansible still lacks modules to operate on libvirt volumes
# mbuil: Assuming there is only one disk [0]
- name: create volume for vm
diff --git a/xci/scripts/vm/start-new-vm.sh b/xci/scripts/vm/start-new-vm.sh
index ecc2998d..9eab0e5a 100755
--- a/xci/scripts/vm/start-new-vm.sh
+++ b/xci/scripts/vm/start-new-vm.sh
@@ -119,17 +119,14 @@ COMMON_DISTRO_PKGS=(vim strace gdb htop dnsmasq docker iptables ebtables virt-ma
case ${ID,,} in
*suse*)
- pkg_mgr_cmd="sudo zypper -q -n ref"
- pkg_mgr_cmd+=" && sudo zypper -q -n install ${COMMON_DISTRO_PKGS[@]} qemu-tools libvirt-daemon libvirt-client libvirt-daemon-driver-qemu"
+ pkg_mgr_cmd="sudo zypper -q -n install ${COMMON_DISTRO_PKGS[@]} qemu-tools libvirt-daemon libvirt-client libvirt-daemon-driver-qemu"
;;
centos)
- pkg_mgr_cmd="yum updateinfo"
- pkg_mgr_cmd+=" && sudo yum install -q -y epel-release"
- pkg_mgr_cmd+=" && sudo yum install -q -y in ${COMMON_DISTRO_PKGS[@]} qemu-kvm-tools qemu-img libvirt-daemon-kvm"
+ pkg_mgr_cmd="sudo yum install -C -q -y epel-release"
+ pkg_mgr_cmd+=" && sudo yum install -C -q -y in ${COMMON_DISTRO_PKGS[@]} qemu-kvm-tools qemu-img libvirt-daemon-kvm"
;;
ubuntu)
- pkg_mgr_cmd="sudo apt-get update"
- pkg_mgr_cmd+=" && sudo apt-get install -y -q=3 ${COMMON_DISTRO_PKGS[@]} libvirt-bin qemu-utils docker.io"
+ pkg_mgr_cmd="sudo apt-get install --no-upgrade -y -q=3 ${COMMON_DISTRO_PKGS[@]} libvirt-bin qemu-utils docker.io"
;;
esac