Skip to content

Commit 0e22de8

Browse files
Merge pull request #2175 from jasonrandrews/review
First review of Azure Linux 3.0 on Cobalt 100 Learning Path
2 parents c202f50 + 7f61f30 commit 0e22de8

File tree

6 files changed

+244
-191
lines changed

6 files changed

+244
-191
lines changed

content/install-guides/azure-cli.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Execute the following command to verify the Azure CLI is installed correctly
5656
az version
5757
```
5858

59-
You should see an output similar to below
59+
You should see an output similar to:
6060

6161
```output
6262
{
@@ -94,7 +94,7 @@ The pip install updates $HOME/.profile with the path the `az` executable. Check
9494
source $HOME/.profile
9595
az version
9696
```
97-
You should see an output similar to below
97+
You should see an output similar to:
9898

9999
```output
100100
{

content/learning-paths/servers-and-cloud-computing/azure-vm/_index.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
---
2-
title: Create Azure Linux 3.0 custom Arm VM
2+
title: Create an Azure Linux 3.0 virtual machine with Cobalt 100 processors
33

44
draft: true
55
cascade:
66
draft: true
77

88
minutes_to_complete: 120
99

10-
who_is_this_for: This Learning Path helps developers create a custom Azure Linux 3.0 virtual machine for Arm and utilize the default software stack provided by Microsoft.
10+
who_is_this_for: This Learning Path explains how to create a virtual machine on Azure running Azure Linux 3.0 on Cobalt 100 processors.
1111

1212

1313
learning_objectives:
14-
- Use the qemu-img utility to create a raw disk image, boot a VM with Aarch64 ISO to install the OS onto that disk, and convert the raw disk image into VHD
15-
- Upload the VHD to Azure and use the Azure Shared Image Gallery to create a custom image.
16-
- Use Azure CLI to create Azure Linux 3.0 VM for Arm, using the custom image from Azure SIG.
14+
- Use QEMU to create a raw disk image, boot a VM using an Aarch64 ISO, install the OS, and convert the raw disk image to VHD format.
15+
- Upload the VHD file to Azure and use the Azure Shared Image Gallery (SIG) to create a custom image.
16+
- Use the Azure CLI to create an Azure Linux 3.0 VM for Arm, using the custom image from the Azure SIG.
1717

1818
prerequisites:
19-
- A [Microsoft Azure](https://azure.microsoft.com/) account with permission to create resources, including Cobalt 100 (Arm64) instances (Dpsv6).
20-
- A local Linux machine with [QEMU](https://www.qemu.org/download/) installed to emulate Aarch64.
21-
- An [Azure CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli) installed and authenticated on your local machine.
19+
- A [Microsoft Azure](https://azure.microsoft.com/) account with permission to create resources, including instances using Cobalt 100 processors.
20+
- A local Linux machine with [QEMU](https://www.qemu.org/download/) and the [Azure CLI](/install-guides/azure-cli/) installed and authenticated.
2221

2322
author: Jason Andrews
2423

Lines changed: 30 additions & 177 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,39 @@
11
---
2-
title: Create custom Azure Linux 3.0 Arm image for the VM
2+
title: Create an Azure Linux image for Arm
33
weight: 3
44

55
### FIXED, DO NOT MODIFY
66
layout: learningpathall
77
---
88

9-
## Roadmap to the Azure Linux 3.0 Arm VM image
9+
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.
1010

11-
In this learning path, we will start by [downloading the Aarch64 ISO of Azure Linux 3.0](https://github.com/microsoft/azurelinux#iso). Using qemu-img, we’ll create a raw disk image and boot a virtual machine with the ISO to install the OS onto the disk. Once the installation is complete, we will 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. This custom image will enable us to launch Azure Linux 3.0 virtual machines on Arm-based infrastructure, even though the Azure Marketplace currently provides this image only for x64 systems.
11+
Using QEMU, you can create a raw disk image and boot a virtual machine with the ISO to install the OS onto the disk.
1212

13-
Next, switch to a Linux-based environment and proceed with the following steps.
13+
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.
14+
15+
## Download and create a virtual disk file
16+
17+
Use `wget` to download the Azure Linux ISO image file.
1418

15-
#### 1. Install the Dependencies
16-
```bash
17-
$ sudo apt update && sudo apt install qemu-system-arm qemu-system-aarch64 qemu-efi-aarch64 qemu-utils ovmf -y
18-
```
19-
#### 2. Download the Azure Linux 3.0 ISO
2019
```bash
21-
$ wget https://aka.ms/azurelinux-3.0-aarch64.iso
20+
wget https://aka.ms/azurelinux-3.0-aarch64.iso
2221
```
23-
#### 3. Use qemu-img to create a 32 GB raw disk image
22+
23+
Use `qemu-img` to create a 32 GB raw disk image.
24+
25+
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`.
26+
2427
```bash
25-
$ qemu-img create -f raw azurelinux-arm64.raw 34359738368
28+
qemu-img create -f raw azurelinux-arm64.raw 34359738368
2629
```
27-
This step creates a 32 GB empty raw disk image to install the OS.
2830

29-
#### 4. Boot the ISO and install the OS to the raw image
31+
## Boot and install the OS
32+
33+
Use QEMU to boot the operating system in an emulated Arm VM.
34+
3035
```bash
31-
$ qemu-system-aarch64 \
36+
qemu-system-aarch64 \
3237
-machine virt \
3338
-cpu cortex-a72 \
3439
-m 4096 \
@@ -41,177 +46,25 @@ $ qemu-system-aarch64 \
4146
-device virtio-net-device,netdev=net0
4247
```
4348

44-
This step boots the Azure Linux 3.0 ISO on an emulated Arm VM and installs the OS onto the raw disk.
45-
46-
Once the OS boots successfully, install Azure Linux Agent required for VM provisioning, and poweroff the VM, as below:
49+
Once the OS boots successfully, install the Azure Linux Agent for VM provisioning, and power off the VM.
4750

4851
```bash
49-
$ sudo dnf install WALinuxAgent -y
50-
$ sudo systemctl enable waagent
51-
$ sudo systemctl start waagent
52-
$ sudo poweroff
52+
sudo dnf install WALinuxAgent -y
53+
sudo systemctl enable waagent
54+
sudo systemctl start waagent
55+
sudo poweroff
5356
```
54-
#### 5. Convert Raw Disk to VHD Format
55-
Now that the raw disk image is all set to be used, convert the image to fixed-size VHD, campatible to Azure.
5657

57-
```bash
58-
$ qemu-img convert -f raw -o subformat=fixed,force_size -O vpc azurelinux-arm64.raw azurelinux-arm64.vhd
59-
```
60-
61-
{{% notice Note %}}
62-
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 (in our case, 32 GiB). Without this, qemu-img may round the size or adjust for footer overhead (especially when converting from raw to VHD). “force_size” 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 Azure requires.
63-
{{% /notice %}}
58+
## Convert the raw disk to VHD Format
6459

65-
#### 6. Set environment variables
66-
Below uploading the VHD file to Azure Blob storage, set the Environment Variables for the Azure CLI.
60+
Now that the raw disk image is ready to be used, convert the image to fixed-size VHD, making it compatible with Azure.
6761

6862
```bash
69-
RESOURCE_GROUP="MyCustomARM64Group"
70-
LOCATION="centralindia"
71-
STORAGE_ACCOUNT="mycustomarm64storage"
72-
CONTAINER_NAME="mycustomarm64container"
73-
VHD_NAME="azurelinux-arm64.vhd"
74-
GALLERY_NAME="MyCustomARM64Gallery"
75-
IMAGE_DEF_NAME="MyAzureLinuxARM64Def"
76-
IMAGE_VERSION="1.0.0"
77-
PUBLISHER="custom"
78-
OFFER="custom-offer"
79-
SKU="custom-sku"
80-
OS_TYPE="Linux"
81-
ARCHITECTURE="Arm64"
82-
HYPERV_GEN="V2"
83-
STORAGE_ACCOUNT_TYPE="Standard_LRS"
84-
VM_NAME="MyAzureLinuxARMVM"
85-
ADMIN_USER="azureuser"
86-
VM_SIZE="Standard_D4ps_v6"
63+
qemu-img convert -f raw -o subformat=fixed,force_size -O vpc azurelinux-arm64.raw azurelinux-arm64.vhd
8764
```
8865

8966
{{% notice Note %}}
90-
You can modify the values of these environment variables—such as RESOURCE_GROUP, VM_NAME, LOCATION, and others—based on your naming preferences, region, and resource requirements.
67+
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.
9168
{{% /notice %}}
9269

93-
#### 7. Create a Resource Group on Azure
94-
After [installing the Azure CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest), create a new resource group.
95-
96-
```bash
97-
$ az group create --name "$RESOURCE_GROUP" --location "$LOCATION"
98-
```
99-
100-
#### 8. Create Azure Blob Storage on Azure
101-
102-
```bash
103-
$ az storage account create \
104-
--name "$STORAGE_ACCOUNT" \
105-
--resource-group "$RESOURCE_GROUP" \
106-
--location "$LOCATION" \
107-
--sku Standard_LRS \
108-
--kind StorageV2
109-
```
110-
111-
#### 9. Create Blob Container in the Blob Storage Account
112-
113-
```bash
114-
$ az storage container create \
115-
--name "$CONTAINER_NAME" \
116-
--account-name "$STORAGE_ACCOUNT"
117-
```
118-
119-
#### 10. Upload VHD to the Blob container created in step 9
120-
121-
```bash
122-
$ az storage blob upload \
123-
--account-name "$STORAGE_ACCOUNT" \
124-
--container-name "$CONTAINER_NAME" \
125-
--name "$VHD_NAME" \
126-
--file ./azurelinux-arm64.vhd
127-
```
128-
129-
This successfully uploads the VHD to the Azure Blob Storage account. Confirm the same after visiting the blob storage of your Azure account.
130-
131-
Now, let’s create a custom VM image from this VHD, using Azure Shared Image Gallery.
132-
133-
#### 11. Create Azure Shared Image Gallery
134-
```bash
135-
$ az sig create \
136-
--resource-group "$RESOURCE_GROUP" \
137-
--gallery-name "$GALLERY_NAME" \
138-
--location "$LOCATION"
139-
```
140-
141-
#### 12. Create the Image Definition
142-
```bash
143-
$ az sig image-definition create
144-
--resource-group "$RESOURCE_GROUP"
145-
--gallery-name "$GALLERY_NAME"
146-
--gallery-image-definition "$IMAGE_DEF_NAME"
147-
--publisher "$PUBLISHER"
148-
--offer "$OFFER"
149-
--sku "$SKU"
150-
--os-type "$OS_TYPE"
151-
--architecture "$ARCHITECTURE"
152-
--hyper-v-generation "$HYPERV_GEN"
153-
```
154-
155-
#### 13. Create Image Version
156-
```bash
157-
$ az sig image-version create
158-
--resource-group "$RESOURCE_GROUP"
159-
--gallery-name "$GALLERY_NAME"
160-
--gallery-image-definition "$IMAGE_DEF_NAME"
161-
--gallery-image-version "$IMAGE_VERSION"
162-
--location "$LOCATION"
163-
--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)}"
164-
--os-vhd-storage-account "$STORAGE_ACCOUNT"
165-
--storage-account-type "$STORAGE_ACCOUNT_TYPE"
166-
```
167-
168-
This registers the VHD as a version of your custom image.
169-
170-
#### 14. Retrieve the Image ID
171-
Once the image has been versioned, retrieve the unique ID for use in VM creation.
172-
173-
```bash
174-
$ IMAGE_ID=$(az sig image-version show
175-
--resource-group "$RESOURCE_GROUP"
176-
--gallery-name "$GALLERY_NAME"
177-
--gallery-image-definition "$IMAGE_DEF_NAME"
178-
--gallery-image-version "$IMAGE_VERSION"
179-
--query "id" -o tsv)
180-
```
181-
182-
#### 15. Create the VM Using the Custom Image
183-
Finally, create the VM with this custom image.
184-
185-
```bash
186-
$ az vm create \
187-
--resource-group "$RESOURCE_GROUP" \
188-
--name "$VM_NAME" \
189-
--image "$IMAGE_ID" \
190-
--size "$VM_SIZE" \
191-
--admin-username "$ADMIN_USER" \
192-
--generate-ssh-keys \
193-
--public-ip-sku Standard
194-
```
195-
196-
This deploys Azure Linux 3.0 Arm64 VM from the custom image. Confirm the same after visiting your Azure account “Virtual Machines” section.
197-
198-
After the VM is successfully created, fetch the Public IP of the VM.
199-
200-
```bash
201-
$ az vm show \
202-
--resource-group "$RESOURCE_GROUP" \
203-
--name "$VM_NAME" \
204-
--show-details \
205-
--query "publicIps" \
206-
-o tsv
207-
```
208-
With the Public IP retrieved, SSH into the VM.
209-
210-
```bash
211-
$ ssh azureuser@<public-ip-address>
212-
```
213-
214-
Replace **public-ip-address** with the IP returned in the previous command.
215-
216-
You can now log into your custom Azure Linux 3.0 Arm64 VM and start using it!
217-
70+
Next, you can save the image in your Azure account.
Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,46 @@
11
---
2-
title: "Background"
2+
title: "About Azure Linux"
33

44
weight: 2
55

66
layout: "learningpathall"
77
---
88

9-
## Introduction to Azure Linux 3.0
9+
## What is Azure Linux 3.0?
1010

11-
Azure Linux 3.0 is Microsoft's in-house, lightweight Linux distribution optimized for running cloud-native workloads on Azure. Designed with performance, security, and reliability in mind, it is fully supported by Microsoft and tailored for containers, microservices, and Kubernetes. With native support for Arm64 (Aarch64) architecture, Azure Linux 3.0 enables efficient execution of workloads on energy-efficient ARM-based infrastructure, making it a powerful choice for scalable and cost-effective cloud deployments.
11+
Azure Linux 3.0 is a Linux distribution developed and maintained by Microsoft, specifically designed for use on the Azure cloud platform. It is optimized for running cloud-native workloads, such as containers, microservices, and Kubernetes clusters, and emphasizes performance, security, and reliability. Azure Linux 3.0 provides native support for the Arm (AArch64) architecture, enabling efficient, scalable, and cost-effective deployments on Arm-based infrastructure within Azure.
1212

13-
As of now, the Azure Marketplace offers official VM images of Azure Linux 3.0 only for x64-based architectures, published by Ntegral Inc. However, native Arm64 (Aarch64) images are not yet officially available. This learning path bridges that gap by guiding developers through the process of building a custom Arm VM image using the Azure Linux 3.0 ISO. By the end of this path, you'll be able to deploy and run Azure Linux 3.0 VMs on Arm-based Azure infrastructure with confidence.
13+
Currently, Azure Linux 3.0 is not available as a ready-made virtual machine image for Arm-based VMs in the Azure Marketplace. Only x86_64 images, published by Ntegral Inc., are offered. This means you cannot directly create an Azure Linux 3.0 VM for Arm from the Azure portal or CLI.
1414

15+
However, you can still run Azure Linux 3.0 on Arm-based Azure VMs by creating your own disk image. Using QEMU, an open-source machine emulator and virtualizer, you can build a custom Azure Linux 3.0 Arm image locally. After building the image, you can upload it to your Azure account as a managed disk or custom image. This process allows you to deploy and manage Azure Linux 3.0 VMs on Arm infrastructure, even before official images are available.
16+
17+
This Learning Path guides you through the steps to build an Azure Linux 3.0 disk image with QEMU, upload it to Azure, and prepare it for use in creating virtual machines.
18+
19+
Following this process, you'll be able to create and run Azure Linux 3.0 VMs on Arm-based Azure infrastructure.
20+
21+
To get started install the dependencies on your local Linux machine. The instructions work for both Arm or x86 running Ubuntu.
22+
23+
```bash
24+
sudo apt update && sudo apt install qemu-system-arm qemu-system-aarch64 qemu-efi-aarch64 qemu-utils ovmf -y
25+
```
26+
27+
You also need to install the Azure CLI. Refer to [How to install the Azure CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest). You can also use the [Azure CLI install guide](/install-guides/azure-cli/) for Arm Linux systems.
28+
29+
Make sure the CLI is working by running the version command and confirm the version is printed.
30+
31+
```bash
32+
az version
33+
```
34+
35+
You should see an output similar to:
36+
37+
```output
38+
{
39+
"azure-cli": "2.61.0",
40+
"azure-cli-core": "2.61.0",
41+
"azure-cli-telemetry": "1.1.0",
42+
"extensions": {}
43+
}
44+
```
45+
46+
Continue to learn how to prepare the Azure Linux disk image.

0 commit comments

Comments
 (0)