diff options
author | Jonathan Race <jrace@augusta.edu> | 2022-02-08 10:55:44 -0500 |
---|---|---|
committer | Jonathan Race <jrace@augusta.edu> | 2022-02-25 16:55:43 -0500 |
commit | 1b2ff083eb62e15a5a371c8362184147954ff975 (patch) | |
tree | adce25f286f73330522b0076f2f3299a2165ac6c /playbooks/nova-emulation | |
parent | 22a47b466261f1336d1c2a381a5e0fed3275b622 (diff) | |
download | nova-1b2ff083eb62e15a5a371c8362184147954ff975.tar.gz |
zuul-job for Adds Pick guest CPU architecture based on host arch
in libvirt driver support
This is split 3 of 3 for the architecture emulation feature.
Added initial ci content for tempest test.
Implements: blueprint pick-guest-arch-based-on-host-arch-in-libvirt-driver
Signed-off-by: Jonathan Race <jrace@augusta.edu>
Change-Id: I0159baa99ccf1e76040c197becf2a56c3d69d026
Diffstat (limited to 'playbooks/nova-emulation')
-rw-r--r-- | playbooks/nova-emulation/pre.yaml | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/playbooks/nova-emulation/pre.yaml b/playbooks/nova-emulation/pre.yaml new file mode 100644 index 0000000000..f763f82458 --- /dev/null +++ b/playbooks/nova-emulation/pre.yaml @@ -0,0 +1,35 @@ +- hosts: controller + tasks: + - name: create local.sh + become: yes + blockinfile: + path: /opt/stack/devstack/local.sh + create: True + mode: 0777 + block: | + #!/bin/bash + sudo apt update + sudo apt install -yy qemu-system qemu-efi-aarch64 qemu-efi-arm + # This changes the default image metadata to enable emulation + source /opt/stack/devstack/openrc admin + + image_id=$(openstack image list -f value -c ID | awk 'NR==1{print $1}') + + echo "Setting required image metadata properties" + openstack image set --property hw_emulation_architecture=aarch64 ${image_id} + openstack image set --property hw_firmware_type=uefi ${image_id} + openstack image set --property hw_machine_type=virt ${image_id} + + meta_props=$(openstack image show ${image_id} | grep properties | sed 's/,\||/\n/g' | grep hw_) + + for prop in ${meta_props}; + do + if [ -z "${prop}" ] + then + echo "Image Properties not set" + exit 5 + else + echo ${prop} + fi + done + |