|
| 1 | +--- |
| 2 | +title: Azure Local virtual machine placement in a Rack Aware Cluster (Preview) |
| 3 | +description: Use this topic to learn how to place your Azure Local VMs on a Rack Aware Cluster (Preview). |
| 4 | +author: alkohli |
| 5 | +ms.author: alkohli |
| 6 | +ms.topic: overview |
| 7 | +ms.service: azure-local |
| 8 | +ms.date: 04/07/2025 |
| 9 | +--- |
| 10 | + |
| 11 | +# Place Azure Local VMs on a Rack Aware Cluster (Preview) |
| 12 | + |
| 13 | +[!INCLUDE [applies-to](../includes/hci-applies-to-23h2.md)] |
| 14 | + |
| 15 | +This article describes how to place an Azure Local virtual machine (VM) enabled by Azure Arc, on a Rack Aware Cluster. |
| 16 | + |
| 17 | +[!INCLUDE [important](../includes/hci-preview.md)] |
| 18 | + |
| 19 | +## About Rack Aware Cluster and Azure Local VMs |
| 20 | + |
| 21 | +You can run Azure Local VMs on a Rack Aware Cluster running on an Azure Local instance. A Rack Aware Cluster is designed to enhance fault tolerance and data distribution within an Azure Local instance. |
| 22 | + |
| 23 | +Before you place Azure VMs on a Rack Aware Cluster, make sure to create 2 or more zones. |
| 24 | + |
| 25 | +<Availability zones expands the level of control you have to maintain the availability of the applications and data on your VMs. An Availability Zone is a physically separate zone, within an Azure region. There are three Availability Zones per supported Azure region. |
| 26 | + |
| 27 | +Each Availability Zone has a distinct power source, network, and cooling. By designing your solutions to use replicated VMs in zones, you can protect your apps and data from the loss of a data center. If one zone is compromised, then replicated apps and data are instantly available in another zone.> |
| 28 | + |
| 29 | +Once you have the placement zones, you can assign those to the VMs to reduce latency, improve performance, ensure redundancy and meet compliance requirements. |
| 30 | + |
| 31 | +> [!IMPORTANT] |
| 32 | +> Updating zone configuration of existing virtual machines is not supported. |
| 33 | +
|
| 34 | +## Prerequisites |
| 35 | + |
| 36 | +- Make sure that you've access to a Rack Aware Cluster. For more information, see [Deploy a Rack Aware Cluster](../index.yml). |
| 37 | +- Ensure that the Rack Aware Cluster has 2 or more availability zones configured. For more information, see [Configuring availability zones](../index.yml). |
| 38 | + - Go to the **Settings** blade of the Azure Local instance in the Azure portal, and select **Availability zones**. You can see the availability zones configured for your Rack Aware Cluster. Insert image here. |
| 39 | +- Before you create an Azure Local VM for a rack aware cluster, make sure that all prerequisites listed in [Create Azure Local virtual machines enabled by Azure Arc](../manage/create-arc-virtual-machines.md) are met. |
| 40 | + |
| 41 | +## Create and place the Azure Local VM |
| 42 | + |
| 43 | +### Sign in and set the subscription |
| 44 | + |
| 45 | +[!INCLUDE [hci-vm-sign-in-set-subscription](../includes/hci-vm-sign-in-set-subscription.md)] |
| 46 | + |
| 47 | +### Set the parameters |
| 48 | + |
| 49 | +1. Set the parameters: |
| 50 | + |
| 51 | + ```azurecli |
| 52 | + $vmName ="local-vm" |
| 53 | + $subscription = "<Subscription ID>" |
| 54 | + $resource_group = "local-rg" |
| 55 | + $customLocationName = "local-cl" |
| 56 | + $customLocationID ="/subscriptions/$subscription/resourceGroups/$resource_group/providers/Microsoft.ExtendedLocation/customLocations/$customLocationName" |
| 57 | + $location = "eastus" |
| 58 | + $computerName = "mycomputer" |
| 59 | + $userName = "local-user" |
| 60 | + $password = "<password for the VM>" |
| 61 | + $imageName ="ws22server" |
| 62 | + $nicName ="local-vnic" |
| 63 | + $storagePathName = "local-sp" |
| 64 | + $storagePathId = "/subscriptions/<Subscription ID>/resourceGroups/local-rg/providers/Microsoft.AzureStackHCI/storagecontainers/local-sp" |
| 65 | + $zone = "local-zone" |
| 66 | + ``` |
| 67 | +
|
| 68 | +You can now create the Azure Local VM in a specific availability zone with or without strict placement. |
| 69 | +
|
| 70 | +### Create a VM in a specific availability zone without strict placement |
| 71 | +
|
| 72 | +Once you have set up availability zones in a rack aware cluster, you can create Azure Local VMs on a specific availability zone to reduce latency, improve performance, ensure redundancy, and meet compliance requirements. |
| 73 | +
|
| 74 | +When you create a VM in a specific availability zone, the default option is without strict placement. The VM is created on a machine within the specified zone (using the `--zone` flag). |
| 75 | +
|
| 76 | +If all machines within a zone are down, the VM can migrate to another machine outside of the zone. However, the VM attempts to fail back to a machine within the original zone when that availability zone recovers. |
| 77 | +
|
| 78 | +> [!NOTE] |
| 79 | +> If no zone is specified when creating an Azure Local VM, the system automatically chooses an optimal placement within the rack aware cluster. |
| 80 | +
|
| 81 | +
|
| 82 | +1. Run the following command: |
| 83 | +
|
| 84 | + ```azurecli |
| 85 | + az stack-hci-vm create --name $vmName --resource-group $resource_group --admin-username $userName --admin-password $password --computer-name $computerName --image $imageName --location $location --authentication-type all --nics $nicName --custom-location $customLocationID --hardware-profile memory-mb="8192" processors="4" --storage-path-id $storagePathId –zone $zone |
| 86 | + ``` |
| 87 | + |
| 88 | +1. Verify that the VM is created in the desired zone. Look under the `placementProfile` in the output. |
| 89 | +
|
| 90 | + ```azurecli |
| 91 | + "placementProfile": { |
| 92 | + "strictPlacementPolicy": null, |
| 93 | + "zone": "local-zone" |
| 94 | + }, |
| 95 | + ``` |
| 96 | +
|
| 97 | +### Create a VM in a specific availability zone with strict placement enabled |
| 98 | +
|
| 99 | +To create a VM in a specific availability zone and ensure it stays within that availability zone, you can specify another flag `--strict-placement` to `true`. The VM is created on a node within the specified zone (`--zone`). If all machines within a zone are down, the VM also goes down. |
| 100 | +
|
| 101 | +> [!TIP] |
| 102 | +> Only enable strict placement if the VM isn't required to be always running or needs to adhere to a specific availability zone due to compliance requirements. |
| 103 | +
|
| 104 | +Follow these steps to create a VM in a specific availability zone with strict placement enabled: |
| 105 | +
|
| 106 | +1. Run the following command: |
| 107 | +
|
| 108 | + ```azurecli |
| 109 | + az stack-hci-vm create --name $vmName --resource-group $resource_group --admin-username $userName --admin-password $password --computer-name $computerName --image $imageName --location $location --authentication-type all --nics $nicName --custom-location $customLocationID --hardware-profile memory-mb="8192" processors="4" --storage-path-id $storagePathId –zone $zone –strict-placement true |
| 110 | + ``` |
| 111 | +
|
| 112 | +1. Verify that the VM has strict placement enabled and was created in the desired zone. Look under `placementProfile` in the output. |
| 113 | +
|
| 114 | + ```azurecli |
| 115 | + "placementProfile": { |
| 116 | + "strictPlacementPolicy": true, |
| 117 | + "zone": "local-zone" |
| 118 | + }, |
| 119 | + ``` |
| 120 | +
|
| 121 | +## Next steps |
| 122 | +
|
| 123 | +- See [Rack Aware Cluster networking overview](../plan/rack-aware-clustering-overview.md). |
0 commit comments