Resize OPNFV VM Disk 31/60731/1
authorFatih Degirmenci <fdegir@gmail.com>
Wed, 8 Aug 2018 09:23:10 +0000 (11:23 +0200)
committerFatih Degirmenci <fdegir@gmail.com>
Wed, 8 Aug 2018 09:23:10 +0000 (11:23 +0200)
OPNFV VM creation is separated from the rest of the nodes, resulting
in its disk being left without resizing. It is important to resize
its disk to the value defined in its PDF opnfv_vm.yml so the installation
of the other tools does not fail due to lack of space.

Change-Id: I8300e6e355d11788cc983fcebca56076e89918e1
Signed-off-by: Fatih Degirmenci <fdegir@gmail.com>
xci/playbooks/roles/create-vm-nodes/tasks/create_vm.yml

index d8169c2..ab427c6 100644 (file)
         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