wip: Provision aarch64 fake-bare-metal-vms

Steps:
- Ironic devstack plugin loads the right arch disk images.
- Ironic-Python-Agent can build ARM ramdisks and provision ARM machines.
- A possible change at the emulator level in Sushy tools since it’s the most relevant to ARM in the real world.
- Configure Ironic CI to add/enable one or more ARM jobs.

Change-Id: Ie4bff8892228275ad0fb940c30e8071f7f4c423f
This commit is contained in:
cid 2024-04-10 12:09:34 +01:00
parent c1f3daf7b0
commit 89d787732d
4 changed files with 156 additions and 134 deletions

View File

@ -260,7 +260,11 @@ if [[ "$IRONIC_VM_ENGINE" == "auto" ]]; then
echo "WARNING: Switching to QEMU"
IRONIC_VM_ENGINE=qemu
if [[ -z "$IRONIC_VM_EMULATOR" ]]; then
IRONIC_VM_EMULATOR='/usr/bin/qemu-system-x86_64'
if [[ $IRONIC_HW_ARCH == "aarch64" ]]; then
IRONIC_VM_EMULATOR='/usr/bin/qemu-system-aarch64'
else
IRONIC_VM_EMULATOR='/usr/bin/qemu-system-x86_64'
fi
fi
else
IRONIC_VM_ENGINE=kvm
@ -658,13 +662,24 @@ IRONIC_UEFI_FILES_DIR=${IRONIC_UEFI_FILES_DIR:-/var/lib/libvirt/images}
UEFI_LOADER_PATH=$IRONIC_UEFI_FILES_DIR/OVMF_CODE.fd
UEFI_NVRAM_PATH=$IRONIC_UEFI_FILES_DIR/OVMF_VARS.fd
if [[ $IRONIC_HW_ARCH == "aarch64" ]]; then
UEFI_LOADER_PATH=$IRONIC_UEFI_FILES_DIR/AAVMF_CODE.fd
UEFI_NVRAM_PATH=$IRONIC_UEFI_FILES_DIR/AAVMF_VARS.fd
fi
# Handle architecture specific package installs
if [[ $IRONIC_HW_ARCH == "x86_64" ]]; then
install_package shim
if is_ubuntu; then
if is_ubuntu; then
if [[ $IRONIC_HW_ARCH == "x86_64" ]]; then
install_package shim
install_package grub-efi-amd64-signed shim-signed
elif is_fedora; then
elif [[ $IRONIC_HW_ARCH == "aarch64" ]]; then
install_package qemu-system-arm qemu-efi qemu-efi-aarch64 shim-signed
fi
elif is_fedora; then
if [[ $IRONIC_HW_ARCH == "x86_64" ]]; then
install_package grub2 grub2-efi
elif [[ $IRONIC_HW_ARCH == "aarch64" ]]; then
install_package grub2-arm64-efi
fi
fi
@ -678,14 +693,34 @@ if [[ "$IRONIC_BOOT_MODE" == "uefi" ]]; then
die $LINENO "Boot mode UEFI only works in Ubuntu or Fedora for now."
fi
if is_ubuntu && [[ -z $IRONIC_GRUB2_FILE ]]; then
IRONIC_GRUB2_SHIM_FILE=/usr/lib/shim/shimx64.efi.signed
IRONIC_GRUB2_FILE=/usr/lib/grub/x86_64-efi-signed/grubx64.efi.signed
IRONIC_GRUB2_NETWORK_FILE=/usr/lib/grub/x86_64-efi-signed/grubnetx64.efi.signed
elif is_fedora && [[ -z $IRONIC_GRUB2_FILE ]]; then
IRONIC_GRUB2_SHIM_FILE=/boot/efi/EFI/fedora/shimx64.efi
IRONIC_GRUB2_FILE=/boot/efi/EFI/fedora/grubx64.efi
IRONIC_GRUB2_NETWORK_FILE=/boot/efi/EFI/fedora/grubx64.efi
if is_ubuntu; then
if [[ $IRONIC_HW_ARCH == "x86_64" ]]; then
if [[ -z $IRONIC_GRUB2_FILE ]]; then
IRONIC_GRUB2_SHIM_FILE=/usr/lib/shim/shimx64.efi.signed
IRONIC_GRUB2_FILE=/usr/lib/grub/x86_64-efi-signed/grubx64.efi.signed
IRONIC_GRUB2_NETWORK_FILE=/usr/lib/grub/x86_64-efi-signed/grubnetx64.efi.signed
fi
elif [[ $IRONIC_HW_ARCH == "aarch64" ]]; then
if [[ -z $IRONIC_GRUB2_FILE ]]; then
IRONIC_GRUB2_SHIM_FILE=/usr/lib/shim/shimaa64.efi.signed
IRONIC_GRUB2_FILE=/usr/lib/grub/arm64-efi-signed/grubaa64.efi.signed
IRONIC_GRUB2_NETWORK_FILE=/usr/lib/grub/arm64-efi-signed/grubnetaa64.efi.signed
fi
fi
elif is_fedora; then
if [[ $IRONIC_HW_ARCH == "x86_64" ]]; then
if [[ -z $IRONIC_GRUB2_FILE ]]; then
IRONIC_GRUB2_SHIM_FILE=/boot/efi/EFI/fedora/shimx64.efi
IRONIC_GRUB2_FILE=/boot/efi/EFI/fedora/grubx64.efi
IRONIC_GRUB2_NETWORK_FILE=/boot/efi/EFI/fedora/grubx64.efi
fi
elif [[ $IRONIC_HW_ARCH == "aarch64" ]]; then
if [[ -z $IRONIC_GRUB2_FILE ]]; then
IRONIC_GRUB2_SHIM_FILE=/boot/efi/EFI/fedora/shimaa64.efi
IRONIC_GRUB2_FILE=/boot/efi/EFI/fedora/grubaa64.efi
IRONIC_GRUB2_NETWORK_FILE=/boot/efi/EFI/fedora/grubaa64.efi
fi
fi
fi
if [[ "$IRONIC_IPXE_ENABLED" == "False" ]]; then
@ -771,18 +806,34 @@ IRONIC_AGENT_IMAGE_DOWNLOAD_SOURCE=${IRONIC_AGENT_IMAGE_DOWNLOAD_SOURCE:-$IRONIC
# UEFI related functions
function get_uefi_loader {
if is_ubuntu; then
echo /usr/share/OVMF/OVMF_CODE.fd
elif is_fedora; then
echo /usr/share/edk2/ovmf/OVMF_CODE.fd
if [[ $IRONIC_HW_ARCH == "aarch64" ]]; then
if is_ubuntu; then
echo /usr/share/AAVMF/AAVMF_CODE.fd
elif is_fedora; then
echo /usr/share/edk2/aarch64/QEMU_EFI.fd
fi
else
if is_ubuntu; then
echo /usr/share/OVMF/OVMF_CODE.fd
elif is_fedora; then
echo /usr/share/edk2/ovmf/OVMF_CODE.fd
fi
fi
}
function get_uefi_nvram {
if is_ubuntu; then
echo /usr/share/OVMF/OVMF_VARS.fd
elif is_fedora; then
echo /usr/share/edk2/ovmf/OVMF_VARS.fd
if [[ $IRONIC_HW_ARCH == "aarch64" ]]; then
if is_ubuntu; then
echo /usr/share/AAVMF/AAVMF_VARS.fd
elif is_fedora; then
echo /usr/share/edk2/aarch64/QEMU_VARS.fd
fi
else
if is_ubuntu; then
echo /usr/share/OVMF/OVMF_VARS.fd
elif is_fedora; then
echo /usr/share/edk2/ovmf/OVMF_VARS.fd
fi
fi
}
@ -1114,13 +1165,18 @@ function configure_redfish {
mkdir -p $(dirname $IRONIC_REDFISH_EMULATOR_CONFIG)
fi
local ironic_node_arch="x86_64"
if [[ $IRONIC_HW_ARCH == "aarch64" ]]; then
ironic_node_arch="aarch64"
fi
cat - <<EOF > $IRONIC_REDFISH_EMULATOR_CONFIG
SUSHY_EMULATOR_BOOT_LOADER_MAP = {
'UEFI': {
'x86_64': '$UEFI_LOADER_PATH'
'$ironic_node_arch': '$UEFI_LOADER_PATH'
},
'Legacy': {
'x86_64': None
'$ironic_node_arch': None
}
}
SUSHY_EMULATOR_FEATURE_SET = "$IRONIC_REDFISH_EMULATOR_FEATURE_SET"
@ -1308,10 +1364,13 @@ function configure_ironic_dirs {
fi
fi
if [ -f $IRONIC_GRUB2_SHIM_FILE ]; then
update_loader_copy_paths "bootx64.efi:$IRONIC_GRUB2_SHIM_FILE"
fi
if [ -f $IRONIC_GRUB2_SHIM_FILE ]; then
update_loader_copy_paths "grubx64.efi:$IRONIC_GRUB2_NETWORK_FILE"
if [[ "$IRONIC_HW_ARCH" == "aarch64" ]]; then
update_loader_copy_paths "bootaa64.efi:$IRONIC_GRUB2_SHIM_FILE"
update_loader_copy_paths "grubaa64.efi:$IRONIC_GRUB2_FILE"
else
update_loader_copy_paths "bootx64.efi:$IRONIC_GRUB2_SHIM_FILE"
update_loader_copy_paths "grubx64.efi:$IRONIC_GRUB2_FILE"
fi
fi
else
if [[ -f /usr/lib/ipxe/undionly.kpxe ]]; then
@ -2459,7 +2518,7 @@ function enroll_nodes {
local ironic_node_ram=$IRONIC_VM_SPECS_RAM
local ironic_node_disk=$IRONIC_VM_SPECS_DISK
local ironic_ephemeral_disk=$IRONIC_VM_EPHEMERAL_DISK
local ironic_node_arch=x86_64
local ironic_node_arch=$IRONIC_HW_ARCH
if [[ ! -f $IRONIC_VM_MACS_CSV_FILE ]]; then
touch $IRONIC_VM_MACS_CSV_FILE
fi
@ -2981,6 +3040,9 @@ function upload_image_if_needed {
local dest
IRONIC_PARTITIONED_IMAGE_NAME=cirros-${CIRROS_VERSION}-x86_64-partition
if [[ $IRONIC_HW_ARCH == "aarch64" ]]; then
IRONIC_PARTITIONED_IMAGE_NAME=cirros-${CIRROS_VERSION}-aarch64-partition
fi
dest="$IRONIC_DATA_DIR/$IRONIC_PARTITIONED_IMAGE_NAME.img"
# Export some variables that the script is using.

View File

@ -63,9 +63,9 @@ def main():
help='Use a custom image file (must be qcow2).')
parser.add_argument('--engine', default='qemu',
help='The virtualization engine to use')
parser.add_argument('--arch', default='i686',
parser.add_argument('--arch', default='aarch64',
help='The architecture to use')
parser.add_argument('--machine_type', default='q35',
parser.add_argument('--machine_type', default='virt',
help='Machine type based on architecture')
parser.add_argument('--memory', default='2097152',
help="Maximum memory for the VM in KB.")

View File

@ -101,6 +101,68 @@
s-object: False
s-proxy: False
- job:
name: ironic-standalone-aarch64
description:
Test ironic standalone configured with ipmi hardware type, ramdisk and
direct deploy interfaces, rescue enabled.
parent: ironic-base
irrelevant-files:
- ^.*\.rst$
- ^api-ref/.*$
- ^doc/.*$
- ^install-guide/.*$
- ^ironic/locale/.*$
- ^ironic/tests/.*$
- ^releasenotes/.*$
- ^setup.cfg$
- ^test-requirements.txt$
- ^tools/.*$
- ^tox.ini$
vars:
tempest_test_regex: BaremetalPxeIpmitoolWholedisk
tempest_concurrency: 2
devstack_localrc:
FORCE_CONFIG_DRIVE: False
IRONIC_AGENT_IMAGE_DOWNLOAD_SOURCE: http
IRONIC_AUTOMATED_CLEAN_ENABLED: False
IRONIC_DEFAULT_RESCUE_INTERFACE: agent
IRONIC_ENABLED_HARDWARE_TYPES: ipmi
IRONIC_ENABLED_DEPLOY_INTERFACES: "direct,ramdisk"
IRONIC_ENABLED_RESCUE_INTERFACES: "agent,no-rescue"
IRONIC_BOOT_MODE: uefi
IRONIC_CALLBACK_TIMEOUT: 800
IRONIC_GRUB2_SHIM_FILE: https://mirror.stream.centos.org/9-stream/BaseOS/aarch64/os/EFI/BOOT/BOOTAA64.EFI
IRONIC_GRUB2_FILE: https://mirror.stream.centos.org/9-stream/BaseOS/aarch64/os/EFI/BOOT/grubaa64.efi
IRONIC_GRUB2_CONFIG_PATH: EFI/BOOT/grub.cfg
IRONIC_HW_ARCH: aarch64
IRONIC_JSON_RPC_AUTH_STRATEGY: 'http_basic'
IRONIC_RAMDISK_TYPE: tinyipa
IRONIC_RPC_TRANSPORT: json-rpc
IRONIC_VM_EMULATOR: /usr/bin/qemu-system-aarch64
IRONIC_VM_SPECS_CPU_ARCH: aarch64
IRONIC_VM_SPECS_RAM: 1024
IRONIC_VM_SPECS_CPU: 1
IRONIC_VM_COUNT: 4
IRONIC_VM_VOLUME_COUNT: 2
# We're using a lot of disk space in this job. Some testing nodes have
# a small root partition, so use /opt which is mounted from a bigger
# ephemeral partition on such nodes
LIBVIRT_STORAGE_POOL_PATH: /opt/libvirt/images
devstack_services:
n-api: False
n-api-meta: False
n-cond: False
n-cpu: False
n-novnc: False
n-sch: False
nova: False
placement-api: False
s-account: False
s-container: False
s-object: False
s-proxy: False
# NOTE(TheJulia): This job is being phased out as it ends up executing
# the wholedisk standalone deploy, the partition standalone deploy,
# software raid tests, and ramdisk iso boot tests. All of this while in

View File

@ -10,109 +10,7 @@
- release-notes-jobs-python3
check:
jobs:
- ironic-tox-bandit
- ironic-tox-codespell
- ironic-tox-unit-mysql-migrations
- ironic-tox-unit-with-sqlalchemy-2x
- ironic-tox-unit-with-driver-libs
- ironic-cross-sushy:
voting: false
- ironic-tempest-functional-python3
# NOTE(rpittau) moving to non-voting until we fix the tests
# see also https://review.opendev.org/c/openstack/ironic-tempest-plugin/+/882312
- ironic-tempest-functional-rbac-scope-enforced:
voting: false
# NOTE(TheJulia): Disabling grenade job on 20240227 from voting
# because we need to backport the same fix to the prior release branch.
- ironic-grenade:
voting: false
- ironic-grenade-skip-level:
voting: false
- ironic-standalone-redfish:
voting: false
- ironic-tempest-bios-redfish-pxe
- ironic-tempest-uefi-redfish-vmedia
- ironic-tempest-ramdisk-bios-snmp-pxe
- ironic-tempest-uefi-redfish-https
- ironic-tempest-ovn-uefi-ipmi-pxe
# NOTE(TheJulia) Marking multinode non-voting on 20210311
# Due to a high failure rate on limestone where the compute1
# machine never appears to be able to communicate across the
# vxlan tunnel, possible mtu issue, but non-voting until we
# understand it in mind for the upcoming release.
- ironic-tempest-ipa-wholedisk-direct-tinyipa-multinode:
voting: false
- ironic-tempest-ipa-wholedisk-direct-tinyipa-multinode-shard:
voting: false
- ironic-tempest-bios-ipmi-direct-tinyipa
- ironic-tempest-bfv
- ironic-tempest-ipa-partition-uefi-pxe-grub2
# NOTE(rpittau): Currently broken because of an issue with parted
- metalsmith-integration-glance-centos9-legacy:
voting: false
# NOTE(TheJulia): At present, metal3 doesn't leverage
# stable branches, and as far as we are aware these jobs
# can be removed once this branch is made stable.
- metal3-integration
# Non-voting jobs
- ironic-inspector-tempest:
voting: false
- ironic-inspector-tempest-uefi-redfish-vmedia:
voting: false
- ironic-tempest-ipa-wholedisk-bios-ipmi-direct-dib:
voting: false
- ironic-tempest-ipxe-ipv6:
voting: false
- ironic-standalone-anaconda:
voting: false
- ironic-inspector-tempest-rbac-scope-enforced:
voting: false
- bifrost-integration-tinyipa-ubuntu-jammy:
voting: false
- bifrost-integration-redfish-vmedia-uefi-centos-9:
voting: false
- ironic-tempest-pxe_ipmitool-postgres:
voting: false
- bifrost-benchmark-ironic:
voting: false
- ironic-standalone-aarch64
gate:
jobs:
- ironic-tox-bandit
- ironic-tox-codespell
- ironic-tox-unit-mysql-migrations
- ironic-tox-unit-with-sqlalchemy-2x
- ironic-tox-unit-with-driver-libs
- ironic-tempest-functional-python3
# NOTE(rpittau) disabled until we fix the tests
# see also https://review.opendev.org/c/openstack/ironic-tempest-plugin/+/882312
# - ironic-tempest-functional-rbac-scope-enforced
# NOTE(TheJulia): Disabling until we get a dnsmasq handling fix backported.
# - ironic-grenade
# NOTE(JayF): Disabling standalone jobs on 20240228 from voting, there's a
# dnsmasq bug only exposed on these jobs.
#- ironic-standalone-redfish
- ironic-tempest-bios-redfish-pxe
- ironic-tempest-uefi-redfish-vmedia
- ironic-tempest-ramdisk-bios-snmp-pxe
- ironic-tempest-uefi-redfish-https
- ironic-tempest-ovn-uefi-ipmi-pxe
# NOTE(TheJulia): Disabled multinode on 20210311 due to Limestone
# seeming to be
# - ironic-tempest-ipa-wholedisk-direct-tinyipa-multinode
- ironic-tempest-bios-ipmi-direct-tinyipa
- ironic-tempest-bfv
- ironic-tempest-ipa-partition-uefi-pxe-grub2
# NOTE(rpittau): Currently broken because of an issue with parted
#- metalsmith-integration-glance-centos9-legacy
# NOTE(TheJulia): At present, metal3 doesn't leverage
# stable branches, and as far as we are aware these jobs
# can be removed once this branch is made stable.
- metal3-integration
experimental:
jobs:
# TODO(dtantsur): these jobs are useful but currently hopelessly
# broken. Fix them and bring back to the gate.
- ironic-grenade-multinode-multitenant:
voting: false
- ironic-inspector-tempest-discovery-fast-track:
voting: false
- ironic-standalone-aarch64