fix ceph_storage for building VMs and update hp01 definition

This commit is contained in:
Arif Ali 2022-01-10 10:32:39 +00:00
parent 8baf74df56
commit f11be6be55
Signed by: arif
GPG Key ID: 369608FBA1353A70
2 changed files with 8 additions and 2 deletions

View File

@ -6,6 +6,7 @@ hypervisor_tag="hp"
ip_suffix=251
storage_path="/var/lib/vz/maas"
ceph_storage_path="/var/lib/libvirt/maas"
external_ip=192.168.1.200

View File

@ -234,7 +234,7 @@ create_storage() {
file_name="$final_storage_path/$virt_node/$virt_node-d$((${disk} + 1)).img"
if [[ ! -f $file_name ]] ; then
/usr/bin/qemu-img create -f "$final_storage_format" "${file_name}" "${disks[$disk]}"G &
/usr/bin/qemu-img create -f "$storage_format" "${file_name}" "${disks[$disk]}"G &
fi
done
done
@ -392,7 +392,12 @@ build_vms() {
# disks to the VM
disk_spec=""
for ((disk=0;disk<${disk_count};disk++)); do
disk_spec+=" --disk path=$storage_path/$virt_node/$virt_node-d$((${disk} + 1)).img"
if [[ $disk -eq 0 ]] ; then
final_storage_path=$storage_path
else
final_storage_path=$ceph_storage_path
fi
disk_spec+=" --disk path=$final_storage_path/$virt_node/$virt_node-d$((${disk} + 1)).img"
disk_spec+=",format=$storage_format,size=${disks[$disk]},bus=$stg_bus,io=native,cache=directsync"
done
fi