From af1f0c255e1b5450083ac64a7bc78534d72a6d82 Mon Sep 17 00:00:00 2001 From: Jason Andrews Date: Mon, 28 Jul 2025 11:54:33 -0500 Subject: [PATCH] Tech review of Azure Linux Learning Path --- content/install-guides/azure-cli.md | 14 ++--- .../azure-vm/_index.md | 2 +- .../azure-vm/azure-vm.md | 19 +++++-- .../azure-vm/background.md | 4 +- .../azure-vm/save-image.md | 54 +++++++++++-------- .../azure-vm/start-vm.md | 12 +++++ 6 files changed, 65 insertions(+), 40 deletions(-) diff --git a/content/install-guides/azure-cli.md b/content/install-guides/azure-cli.md index d1625082c8..ce40f2b4b1 100644 --- a/content/install-guides/azure-cli.md +++ b/content/install-guides/azure-cli.md @@ -22,11 +22,7 @@ It is available for a variety of operating systems and Linux distributions and h ## How do I prepare to install the Azure CLI on Ubuntu? -[General installation information](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots=apt) is available which covers all supported Linux distributions. Starting with version 2.46.0, Azure CLI supports Arm64 Linux distributions. The 'apt' package manager contains both x86_64 and Arm64 packages for the following linux distributions - -```output -Ubuntu 20.04, Ubuntu 22.04, Ubuntu 24.04 -``` +[General installation information](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots=apt) is available which covers all supported Linux distributions. Starting with version 2.46.0, Azure CLI supports Arm64 Linux distributions. The 'apt' package manager contains both x86_64 and Arm64 packages for Ubuntu 20.04, Ubuntu 22.04, and Ubuntu 24.04. ## How do I install the Azure CLI using the installation script? @@ -60,8 +56,8 @@ You should see an output similar to: ```output { - "azure-cli": "2.61.0", - "azure-cli-core": "2.61.0", + "azure-cli": "2.75.0", + "azure-cli-core": "2.75.0", "azure-cli-telemetry": "1.1.0", "extensions": {} } @@ -98,8 +94,8 @@ You should see an output similar to: ```output { - "azure-cli": "2.61.0", - "azure-cli-core": "2.61.0", + "azure-cli": "2.75.0", + "azure-cli-core": "2.75.0", "azure-cli-telemetry": "1.1.0", "extensions": {} } diff --git a/content/learning-paths/servers-and-cloud-computing/azure-vm/_index.md b/content/learning-paths/servers-and-cloud-computing/azure-vm/_index.md index 8a7c2f5afa..357a8bdcd5 100644 --- a/content/learning-paths/servers-and-cloud-computing/azure-vm/_index.md +++ b/content/learning-paths/servers-and-cloud-computing/azure-vm/_index.md @@ -17,7 +17,7 @@ learning_objectives: prerequisites: - A [Microsoft Azure](https://azure.microsoft.com/) account with permission to create resources, including instances using Cobalt 100 processors. - - A local Linux machine with [QEMU](https://www.qemu.org/download/) and the [Azure CLI](/install-guides/azure-cli/) installed and authenticated. + - A Linux machine with [QEMU](https://www.qemu.org/download/) and the [Azure CLI](/install-guides/azure-cli/) installed and authenticated. author: Jason Andrews diff --git a/content/learning-paths/servers-and-cloud-computing/azure-vm/azure-vm.md b/content/learning-paths/servers-and-cloud-computing/azure-vm/azure-vm.md index f7c1a0e446..0159ccae7d 100644 --- a/content/learning-paths/servers-and-cloud-computing/azure-vm/azure-vm.md +++ b/content/learning-paths/servers-and-cloud-computing/azure-vm/azure-vm.md @@ -8,7 +8,7 @@ layout: learningpathall You can view the Azure Linux 3.0 project on [GitHub](https://github.com/microsoft/azurelinux). There are links to the ISO downloads in the project README. -Using QEMU, you can create a raw disk image and boot a virtual machine with the ISO to install the OS onto the disk. +Using QEMU, you can create a raw disk image and boot a virtual machine with the ISO to install the OS on the disk. Once the installation is complete, you can convert the raw disk to a fixed-size VHD, upload it to Azure Blob Storage, and then use the Azure CLI to create a custom Arm image. @@ -20,9 +20,9 @@ Use `wget` to download the Azure Linux ISO image file. wget https://aka.ms/azurelinux-3.0-aarch64.iso ``` -Use `qemu-img` to create a 32 GB raw disk image. +Use `qemu-img` to create a 32 GB empty raw disk image to install the OS. -This step creates a 32 GB empty raw disk image to install the OS. You can increase the disk size by modifying the value passed to `qemu-img`. +You can increase the disk size by modifying the value passed to `qemu-img`. ```bash qemu-img create -f raw azurelinux-arm64.raw 34359738368 @@ -46,7 +46,14 @@ qemu-system-aarch64 \ -device virtio-net-device,netdev=net0 ``` -Once the OS boots successfully, install the Azure Linux Agent for VM provisioning, and power off the VM. +Navigate through the installer by entering the hostname, username, and password for the custom image. +You should use the username of `azureuser` if you want match the instructions on the following pages. + +Be patient, it takes some time to complete the full installation. + +At the end of installation you are prompted for confirmation to reboot the system. + +Once the newly installed OS boots successfully, install the Azure Linux Agent for VM provisioning, and power off the VM. ```bash sudo dnf install WALinuxAgent -y @@ -55,6 +62,8 @@ sudo systemctl start waagent sudo poweroff ``` +Be patient, it takes some time to install the packages and power off. + ## Convert the raw disk to VHD Format Now that the raw disk image is ready to be used, convert the image to fixed-size VHD, making it compatible with Azure. @@ -64,7 +73,7 @@ qemu-img convert -f raw -o subformat=fixed,force_size -O vpc azurelinux-arm64.ra ``` {{% notice Note %}} -VHD files have 512 bytes of footer attached at the end. The `force_size` flag ensures that the exact virtual size specified is used for the final VHD file. Without this, QEMU may round the size or adjust for footer overhead (especially when converting from raw to VHD). The `force_size` flag forces the final image to match the original size. This flag helps make the final VHD size a clean, whole number in MB or GiB, which is required for Azure. +VHD files have 512 bytes of footer attached at the end. The `force_size` flag ensures that the exact virtual size specified is used for the final VHD file. Without this, QEMU may round the size or adjust for footer overhead (especially when converting from raw to VHD). The `force_size` flag forces the final image to match the original size. This flag makes the final VHD size a whole number in MB or GB, which is required for Azure. {{% /notice %}} Next, you can save the image in your Azure account. diff --git a/content/learning-paths/servers-and-cloud-computing/azure-vm/background.md b/content/learning-paths/servers-and-cloud-computing/azure-vm/background.md index dda13eaf11..fa9b4854f7 100644 --- a/content/learning-paths/servers-and-cloud-computing/azure-vm/background.md +++ b/content/learning-paths/servers-and-cloud-computing/azure-vm/background.md @@ -36,8 +36,8 @@ You should see an output similar to: ```output { - "azure-cli": "2.61.0", - "azure-cli-core": "2.61.0", + "azure-cli": "2.75.0", + "azure-cli-core": "2.75.0", "azure-cli-telemetry": "1.1.0", "extensions": {} } diff --git a/content/learning-paths/servers-and-cloud-computing/azure-vm/save-image.md b/content/learning-paths/servers-and-cloud-computing/azure-vm/save-image.md index a9f52f461b..ab66336077 100644 --- a/content/learning-paths/servers-and-cloud-computing/azure-vm/save-image.md +++ b/content/learning-paths/servers-and-cloud-computing/azure-vm/save-image.md @@ -37,6 +37,14 @@ VM_SIZE="Standard_D4ps_v6" You can modify the environment variables such as RESOURCE_GROUP, VM_NAME, and LOCATION based on your naming preferences, region, and resource requirements. {{% /notice %}} +Make sure to login to Azure using the CLI. + +```bash +az login +``` + +If a link is printed, open it in a browser and enter the provided code to authenticate. + Create a new resource group. If you are using an existing resource group for the RESOURCE_GROUP environment variable you can skip this step. ```bash @@ -88,41 +96,41 @@ az sig create \ Create the image definition. ```bash -az sig image-definition create - --resource-group "$RESOURCE_GROUP" - --gallery-name "$GALLERY_NAME" - --gallery-image-definition "$IMAGE_DEF_NAME" - --publisher "$PUBLISHER" - --offer "$OFFER" - --sku "$SKU" - --os-type "$OS_TYPE" - --architecture "$ARCHITECTURE" +az sig image-definition create \ + --resource-group "$RESOURCE_GROUP" \ + --gallery-name "$GALLERY_NAME" \ + --gallery-image-definition "$IMAGE_DEF_NAME" \ + --publisher "$PUBLISHER" \ + --offer "$OFFER" \ + --sku "$SKU" \ + --os-type "$OS_TYPE" \ + --architecture "$ARCHITECTURE" \ --hyper-v-generation "$HYPERV_GEN" ``` Create the image version to register the VHD as a version of the custom image. ```bash -az sig image-version create - --resource-group "$RESOURCE_GROUP" - --gallery-name "$GALLERY_NAME" - --gallery-image-definition "$IMAGE_DEF_NAME" - --gallery-image-version "$IMAGE_VERSION" - --location "$LOCATION" - --os-vhd-uri "[https://${STORAGE_ACCOUNT}.blob.core.windows.net/${CONTAINER_NAME}/${VHD_NAME](https://${storage_account}.blob.core.windows.net/$%7BCONTAINER_NAME%7D/$%7BVHD_NAME)}" - --os-vhd-storage-account "$STORAGE_ACCOUNT" +az sig image-version create \ + --resource-group "$RESOURCE_GROUP" \ + --gallery-name "$GALLERY_NAME" \ + --gallery-image-definition "$IMAGE_DEF_NAME" \ + --gallery-image-version "$IMAGE_VERSION" \ + --location "$LOCATION" \ + --os-vhd-uri "https://${STORAGE_ACCOUNT}.blob.core.windows.net/${CONTAINER_NAME}/${VHD_NAME}" \ + --os-vhd-storage-account "$STORAGE_ACCOUNT" \ --storage-account-type "$STORAGE_ACCOUNT_TYPE" ``` Once the image has been versioned, you can retrieve the unique image ID for use in VM creation. ```bash -IMAGE_ID=$(az sig image-version show - --resource-group "$RESOURCE_GROUP" - --gallery-name "$GALLERY_NAME" - --gallery-image-definition "$IMAGE_DEF_NAME" - --gallery-image-version "$IMAGE_VERSION" +IMAGE_ID=$(az sig image-version show \ + --resource-group "$RESOURCE_GROUP" \ + --gallery-name "$GALLERY_NAME" \ + --gallery-image-definition "$IMAGE_DEF_NAME" \ + --gallery-image-version "$IMAGE_VERSION" \ --query "id" -o tsv) ``` -Next, you can create a virtual machine with the new image using the image ID. \ No newline at end of file +Next, you can create a virtual machine with the new image using the image ID. \ No newline at end of file diff --git a/content/learning-paths/servers-and-cloud-computing/azure-vm/start-vm.md b/content/learning-paths/servers-and-cloud-computing/azure-vm/start-vm.md index cb28839882..c8592c1f96 100644 --- a/content/learning-paths/servers-and-cloud-computing/azure-vm/start-vm.md +++ b/content/learning-paths/servers-and-cloud-computing/azure-vm/start-vm.md @@ -38,4 +38,16 @@ Use the public IP address to SSH to the VM. Replace `` with t ssh azureuser@ ``` +After you login, print the machine information. + +```bash +uname -a +``` + +The output is similar to: + +```output +Linux MyAzureLinuxARMVM 6.6.92.2-2.azl3 #1 SMP Wed Jul 2 02:43:35 UTC 2025 aarch64 aarch64 aarch64 GNU/Linux +``` + You are ready to use your Azure Linux virtual machine.