From 4ef21778eab8ecc0c15bb6426bc351f53d89437d Mon Sep 17 00:00:00 2001 From: Tao Xu Date: Thu, 12 Sep 2024 16:21:41 +0000 Subject: [PATCH] libvirt: support aarch64 arch VM Get correct yq package name and specify virt machine type for aarch64. Signed-off-by: Tao Xu Reviewed-by: Seunguk Shin Reviewed-by: Nick Connolly --- src/cloud-api-adaptor/libvirt/config_libvirt.sh | 1 + src/cloud-api-adaptor/libvirt/kcli_cluster.sh | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/cloud-api-adaptor/libvirt/config_libvirt.sh b/src/cloud-api-adaptor/libvirt/config_libvirt.sh index 891fb5a219..9d17695b45 100755 --- a/src/cloud-api-adaptor/libvirt/config_libvirt.sh +++ b/src/cloud-api-adaptor/libvirt/config_libvirt.sh @@ -12,6 +12,7 @@ set -o pipefail source /etc/os-release || source /usr/lib/os-release ARCH=$(uname -m) TARGET_ARCH=${ARCH/x86_64/amd64} +TARGET_ARCH=${ARCH/aarch64/arm64} OS_DISTRO=ubuntu if [[ "$ID" == "rhel" || "$ID" == "centos" || "$ID" == "fedora" ]]; then OS_DISTRO=rhel diff --git a/src/cloud-api-adaptor/libvirt/kcli_cluster.sh b/src/cloud-api-adaptor/libvirt/kcli_cluster.sh index 360fb682bd..d864849f3b 100755 --- a/src/cloud-api-adaptor/libvirt/kcli_cluster.sh +++ b/src/cloud-api-adaptor/libvirt/kcli_cluster.sh @@ -62,6 +62,11 @@ create () { -P multus=false \ -P autolabeller=false " fi + if [[ ${TARGET_ARCH} == "aarch64" ]]; then + parameters="$parameters \ + -P arch=$ARCH \ + -P machine=virt" + fi echo "Download $CLUSTER_IMAGE ${TARGET_ARCH} image" # kcli support download image with archs: 'x86_64', 'aarch64', 'ppc64le', 's390x' kcli download image $CLUSTER_IMAGE -P arch=${ARCH}