|
| 1 | +--- |
| 2 | +title: Prepare SUSE Linux image for Azure Stack HCI VM via Azure CLI (preview) |
| 3 | +description: Learn how to prepare SUSE Linux images to create an Azure Stack HCI VM image (preview) by using Azure CLI. |
| 4 | +author: ronmiab |
| 5 | +ms.author: robess |
| 6 | +ms.topic: how-to |
| 7 | +ms.service: azure-stack |
| 8 | +ms.subservice: azure-stack-hci |
| 9 | +ms.custom: |
| 10 | + - devx-track-azurecli |
| 11 | +ms.date: 08/01/2024 |
| 12 | +#Customer intent: As a Senior Content Developer, I want to provide customers with content and steps to help them successfully use SUSE Linux to create images on Azure Stack HCI. |
| 13 | +--- |
| 14 | + |
| 15 | +# Prepare SUSE Linux image for Azure Stack HCI virtual machines (preview) |
| 16 | + |
| 17 | +[!INCLUDE [hci-applies-to-23h2](../../includes/hci-applies-to-23h2.md)] |
| 18 | + |
| 19 | +This article describes how to use a SUSE Linux image to create a virtual machine (VM) on your Azure Stack HCI cluster. You use Azure CLI for the VM image creation. |
| 20 | + |
| 21 | +## Prerequisites |
| 22 | + |
| 23 | +Before you begin, meet the following prerequisites: |
| 24 | + |
| 25 | +- Have access to an Azure Stack HCI cluster. This cluster is deployed, registered, and connected to Azure Arc. Go to the **Overview** page in the Azure Stack HCI cluster resource. On the **Server** tab in the right-pane, the **Azure Arc** should show as **Connected**. |
| 26 | + |
| 27 | +- [Download the SUSE QCOW2](https://download.opensuse.org/repositories/Cloud:/Images:/Leap_15.6/images/openSUSE-Leap-15.6.x86_64-NoCloud.qcow2) image file to your local system. Alternatively, you can run the following PowerShell command to download the image: |
| 28 | + |
| 29 | + ```powershell |
| 30 | + PS C:\temp\images> wget "https://download.opensuse.org/repositories/Cloud:/Images:/Leap_15.6/images/openSUSE-Leap-15.6.x86_64-NoCloud.qcow2" -OutFile c:\temp\images\openSUSE-Leap-15.6.x86_64-NoCloud.qcow |
| 31 | + ``` |
| 32 | +
|
| 33 | +## Workflow |
| 34 | +
|
| 35 | +To convert the QCOW2 image to VHDX and create a VM image from the VHDX image. |
| 36 | +
|
| 37 | +1. [Convert QCOW2 to VHDX](#step-1-convert-qcow2-to-vhdx). |
| 38 | +2. [Create a SUSE VM image](#step-2-create-a-suse-vm-image). |
| 39 | +
|
| 40 | +The following sections provide detailed instructions for each step in the workflow. |
| 41 | +
|
| 42 | +## Step 1: Convert QCOW2 to VHDX |
| 43 | +
|
| 44 | +After the QCOW2 image is downloaded, use the **QEMU disk image utility for Windows** tool to convert the image to VHDX. |
| 45 | +
|
| 46 | +The QEMU disk image utility for Windows tool is used to convert, create, and consistently check various virtual disk formats. It's compatible with Hyper-V and other solutions and is optimized for Windows Server (x64). |
| 47 | +
|
| 48 | +Follow these steps to download the tool and convert the QCOW2 image file to VHDX. |
| 49 | +
|
| 50 | +1. Download the [QEMU disk image utility for Windows](https://cloudbase.it/qemu-img-windows/) tool by clicking the **Download binaries** button for file. Alternatively, you can run the following PowerShell command to download the tool: |
| 51 | +
|
| 52 | + ```powershell |
| 53 | + PS C:\temp\tool> wget https://cloudbase.it/downloads/qemu-img-win-x64-2_3_0.zip -OutFile C:\temp\tool\qemu-img-win-x64-2_3_0.zip |
| 54 | + ``` |
| 55 | +
|
| 56 | +2. After the tool is downloaded, extract the files from the zip by running this command: |
| 57 | +
|
| 58 | + ```powershell |
| 59 | + PS C:\temp\tool |
| 60 | + Expand-Archive 'c:\temp\tool\qemu-img-win-x64-2_3_0.zip' |
| 61 | + ``` |
| 62 | +
|
| 63 | + Here's an example: |
| 64 | +
|
| 65 | + :::image type="content" source="../manage/media/virtual-machine-image-suse/suse-qemu-extracted-zip.png" alt-text="Screenshot that shows the downloaded QEMU Disk Utility tool." lightbox="../manage/media/virtual-machine-image-suse/suse-qemu-extracted-zip.png"::: |
| 66 | +
|
| 67 | +3. Then using the QEMU tool, convert and save the QCOW2 to VHDX by running this command: |
| 68 | +
|
| 69 | + ```PowerShell |
| 70 | + PS C:\temp\tool\qemu-img-win-x64-2_3_0> ./qemu-img.exe convert c:\temp\images\openSUSE-Leap-15.6.x86_64-NoCloud.qcow2 -O vhdx -o subformat=dynamic c:\temp\images\openSUSE-Leap-15.6.x86_64-NoCloud.vhdx |
| 71 | + PS C:\temp\tool\qemu-img-win-x64-2_3_0> |
| 72 | + ``` |
| 73 | +
|
| 74 | + Here's an example: |
| 75 | +
|
| 76 | + :::image type="content" source="../manage/media/virtual-machine-image-suse/suse-qcow-2-to-vhdx.png" alt-text="Screenshot that shows the original QCOW2 image and the new VHDX image." lightbox="../manage/media/virtual-machine-image-suse/suse-qcow-2-to-vhdx.png"::: |
| 77 | +
|
| 78 | +Now, you're ready to create your VM image. |
| 79 | +
|
| 80 | +## Step 2: Create a SUSE VM image |
| 81 | +
|
| 82 | +[!INCLUDE [hci-create-a-vm-image](../../includes/hci-create-a-vm-image.md)] |
| 83 | +
|
| 84 | +## Related content |
| 85 | +
|
| 86 | +- [Create logical networks for Azure Stack HCI](../manage/create-logical-networks.md) on your Azure Stack HCI cluster. |
0 commit comments