Skip to content

Commit

Permalink
libvirt: support aarch64 arch VM
Browse files Browse the repository at this point in the history
Get correct yq package name and specify virt machine type for aarch64.

Signed-off-by: Tao Xu <tao.xu@arm.com>
Reviewed-by: Seunguk Shin <seunguk.shin@arm.com>
Reviewed-by: Nick Connolly <nick.connolly@arm.com>
  • Loading branch information
xutao323 authored and stevenhorsman committed Sep 13, 2024
1 parent 453846c commit 5f93228
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/cloud-api-adaptor/libvirt/config_libvirt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ set -o pipefail

source /etc/os-release || source /usr/lib/os-release
ARCH=$(uname -m)
TARGET_ARCH=${ARCH/x86_64/amd64}
if [[ "${ARCH}" == "x86_64" ]]; then
TARGET_ARCH=amd64
elif [[ "${ARCH}" == "aarch64" ]]; then
TARGET_ARCH=arm64
else
TARGET_ARCH=${ARCH}
fi
OS_DISTRO=ubuntu
if [[ "$ID" == "rhel" || "$ID" == "centos" || "$ID" == "fedora" ]]; then
OS_DISTRO=rhel
Expand Down
4 changes: 4 additions & 0 deletions src/cloud-api-adaptor/libvirt/kcli_cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ create () {
-P arch=$ARCH \
-P multus=false \
-P autolabeller=false "
elif [[ ${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'
Expand Down

0 comments on commit 5f93228

Please sign in to comment.