[noHA] Add dedicated cinder volume for virtual cmp 41/52441/4
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Thu, 22 Feb 2018 02:02:05 +0000 (03:02 +0100)
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Thu, 22 Feb 2018 02:34:56 +0000 (03:34 +0100)
Replace loop device LVM-backed cinder volume with a dedicated
/dev/vdb drive.
This is another small step towards bringing noHA to baremetal.

Change-Id: I80f9c2bee42e933a36ab7a8f9b4c5247d1652b42
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
mcp/reclass/classes/cluster/mcp-pike-common-ha/openstack_compute_pdf.yml.j2
mcp/reclass/classes/cluster/mcp-pike-common-noha/openstack_compute.yml
mcp/scripts/lib.sh

index ca9bcb1..d0457ba 100644 (file)
@@ -16,9 +16,9 @@ parameters:
     # Should later be determined via PDF/IDF, AArch64 has ESP on /dev/sda1
 {%- if conf.nodes[nm.cmp001.idx].node.arch == 'aarch64' or
        conf.nodes[nm.cmp001.idx].disks.0.disk_capacity | storage_size_num | float > 2000000000000 %}
-    ~cinder_lvm_devices: [ '/dev/sda2' ]
+    ~cinder_lvm_devices: ['/dev/sda2']
 {%- else %}
-    ~cinder_lvm_devices: [ '/dev/sda1' ]
+    ~cinder_lvm_devices: ['/dev/sda1']
 {%- endif %}
   linux:
     network:
index ea2275a..61ba1ac 100644 (file)
@@ -7,7 +7,6 @@
 ##############################################################################
 ---
 classes:
-  - system.linux.storage.loopback
   - service.nfs.client
   - system.nova.compute.single
   - service.cinder.volume.single
@@ -20,7 +19,7 @@ parameters:
   _param:
     interface_mtu: 9000
     linux_system_codename: xenial
-    loopback_device_size: 20
+    ~cinder_lvm_devices: ['/dev/vdb']
   nova:
     compute:
       libvirt_service: libvirtd
index 20d466f..eb0ad88 100644 (file)
@@ -293,6 +293,10 @@ function prepare_vms {
        -u "${user_data}" -h "${node}" "${image_dir}/mcp_${node}.iso"
     cp "${image_dir}/${image}" "${image_dir}/mcp_${node}.qcow2"
     qemu-img resize "${image_dir}/mcp_${node}.qcow2" 100G
+    # Prepare dedicated drive for cinder on cmp nodes
+    if [[ "${node}" =~ ^(cmp) ]]; then
+      qemu-img create "${image_dir}/mcp_${node}_storage.qcow2" 100G
+    fi
   done
 
   # VCP VMs base image specific changes
@@ -399,11 +403,18 @@ function create_vms {
       net_args="${net_args} --network bridge=${net},model=virtio"
     done
 
+    # dedicated storage drive for cinder on cmp nodes
+    virt_extra_storage=
+    if [[ "${vnode_data[0]}" =~ ^(cmp) ]]; then
+      virt_extra_storage="--disk path=${image_dir}/mcp_${vnode_data[0]}_storage.qcow2,format=qcow2,bus=virtio,cache=none,io=native"
+    fi
+
     # shellcheck disable=SC2086
     virt-install --name "${vnode_data[0]}" \
     --ram "${vnode_data[1]}" --vcpus "${vnode_data[2]}" \
     --cpu host-passthrough --accelerate ${net_args} \
     --disk path="${image_dir}/mcp_${vnode_data[0]}.qcow2",format=qcow2,bus=virtio,cache=none,io=native \
+    ${virt_extra_storage} \
     --os-type linux --os-variant none \
     --boot hd --vnc --console pty --autostart --noreboot \
     --disk path="${image_dir}/mcp_${vnode_data[0]}.iso",device=cdrom \