You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: azure-local/manage/virtual-machine-image-azure-compute-gallery.md
+115-2Lines changed: 115 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ ms.topic: how-to
7
7
ms.service: azure-local
8
8
ms.custom:
9
9
- devx-track-azurecli
10
-
ms.date: 05/06/2025
10
+
ms.date: 05/21/2025
11
11
---
12
12
13
13
# Create Azure Local VM image using Azure Compute Gallery images
@@ -40,11 +40,124 @@ To transfer your Azure Compute Gallery image to be an Azure Local compatible ima
40
40
az disk grant-access --resource-group $resourceGroupName --name $diskName --duration-in-seconds $sasExpiryDuration --query [accessSas] -o tsv
41
41
```
42
42
43
+
## Set some parameters
44
+
45
+
### Set some parameters
46
+
47
+
1. Set your subscription, resource group, location, path to the image in local share, and OS type for the image. Replace the parameters in `< >` with the appropriate values.
48
+
49
+
```azurecli
50
+
$subscription = "<Subscription ID>"
51
+
$resource_group = "<Resource group>"
52
+
$location = "<Location for your Azure Local>"
53
+
$osType = "<OS of source image>"
54
+
$imageName = "<VM image name>"
55
+
```
56
+
57
+
The parameters are described in the following table:
|`subscription`| Subscription for Azure Local that you associate with this image. |
62
+
|`resource_group`| Resource group for Azure Local that you associate with this image. |
63
+
|`location`| Location for your Azure Local instance. For example, this could be `eastus`. |
64
+
|`imageName`| Name of the VM image created starting with the image in your local share. <br> **Note**: Azure rejects all the names that contain the keyword Windows. |
65
+
|`os-type`| Operating system associated with the source image. This can be Windows or Linux. |
1. Follow the steps in [Create Azure Local VM image in Azure Storage account](virtual-machine-image-storage-account.md#set-some-parameters), using the SAS token from the managed disk instead of the storage account container.
81
+
1. Select a custom location to deploy your VM image. The custom location should correspond to the custom location for your Azure Local. Get the custom location ID for your Azure Local. Run the following command:
82
+
83
+
```azurecli
84
+
$customLocationID=(az customlocation show --resource-group $resource_group --name "<custom location name for your Azure Local>" --query id -o tsv)
85
+
```
86
+
87
+
1. Create the VM image starting with a specified marketplace image. Make sure to specify the offer, publisher, sku and version for the marketplace image.
In this example, the storage path was specified using the `--storage-path-id` flag and that ensured that the workload data (including the VM, VM image, non-OS data disk) is placed in the specified storage path.
96
+
97
+
If the flag is not specified, the workload data is automatically placed in a high availability storage path.
98
+
99
+
The image deployment takes a few minutes to complete. The time taken to download the image depends on the size of the image and the network bandwidth available for the download.
100
+
101
+
Here's a sample output:
102
+
103
+
```
104
+
PS > $customLocationID=(az customlocation show --resource-group $resource_group --name "mylocal-cl" --query id -o tsv)
0 commit comments