Skip to content

Commit 77b58eb

Browse files
committed
Kim latest comments
1 parent 419de57 commit 77b58eb

File tree

1 file changed

+85
-75
lines changed

1 file changed

+85
-75
lines changed

azure-stack/hci/manage/virtual-machine-image-azure-marketplace.md

Lines changed: 85 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.service: azure-stack
88
ms.subservice: azure-stack-hci
99
ms.custom:
1010
- devx-track-azurecli
11-
ms.date: 08/19/2024
11+
ms.date: 09/24/2024
1212
---
1313

1414
# Create Azure Stack HCI VM image using Azure Marketplace images
@@ -53,9 +53,9 @@ Follow these steps to create a VM image using the Azure CLI.
5353
```azurecli
5454
$subscription = "<Subscription ID>"
5555
$resource_group = "<Resource group>"
56+
$mktplaceImage = "<Marketplace image name>"
5657
$customLocationName = "<Custom location name>"
57-
$customLocationID
58-
/subscriptions/<Subscription ID>/resourcegroups/$resource_group/providers/microsoft.extendedlocation/customlocations/$customLocationName
58+
$customLocationID = (az customlocation show --resource-group $resource_group --name "<custom_location_name_for_Azure_Stack_HCI_cluster>" --query id -o tsv)
5959
$location = "<Location for your Azure Stack HCI cluster>"
6060
$osType = "<OS of source image>"
6161
```
@@ -65,7 +65,10 @@ Follow these steps to create a VM image using the Azure CLI.
6565
| Parameter | Description |
6666
|----------------|--------------------------------------------------------------------------------------------|
6767
| `subscription` | Subscription associated with your Azure Stack HCI cluster. |
68-
| `resource-group` | Resource group for Azure Stack HCI cluster that you associate with this image. |
68+
| `resource-group` | Resource group for Azure Stack HCI cluster that you associate with this image. |
69+
| `mktplaceImage` | Name of the Marketplace Image for Azure Stack HCI cluster. |
70+
| `customLocationName` | Name of Custom Location for Azure Stack HCI cluster. |
71+
| `customLocationID` | Resource ID of Custom Location for Azure Stack HCI cluster. |
6972
| `location` | Location for your Azure Stack HCI cluster. For example, this could be `eastus`. |
7073
| `os-type` | Operating system associated with the source image. This can be Windows or Linux. |
7174
@@ -74,20 +77,22 @@ Follow these steps to create a VM image using the Azure CLI.
7477
```
7578
PS C:\Users\azcli> $subscription = "<Subscription ID>"
7679
PS C:\Users\azcli> $resource_group = "myhci-rg"
80+
PS C:\Users\azcli> $mktplaceImage= "myhci-marketplaceimage"
7781
PS C:\Users\azcli> $customLocationName = "myhci-cl"
82+
PS C:\Users\azcli> $customerLocationID /subscriptions$subscription/resourcegroups/$resource_group/providers/microsoft.extendedlocation/customlocations/$customLocationName
7883
PS C:\Users\azcli> $location = "eastus"
7984
PS C:\Users\azcli> $ostype = "Windows"
8085
```
8186
8287
### Create VM image from marketplace image
8388
84-
1. Select a custom location to deploy your VM image. The custom location should correspond to the custom location for your Azure Stack HCI cluster. Get the custom location ID for your Azure Stack HCI cluster. Run the following command:
89+
1. Set additional parameters that specify the intended VM image you would like to create. You will need to include the offer, publisher, SKU, and version for the marketplace image:
8590
86-
```azurecli
87-
$customLocationID=(az customlocation show --resource-group $resource_group --name "<custom_location_name_for_Azure_Stack_HCI_cluster>" --query id -o tsv)
88-
```
91+
%publisher = “Publisher name”
92+
$offer = “OS offer”
93+
$sku = “Image SKU”
8994
90-
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. Use the following table to find the available marketplace images and their attribute values:
95+
Use the following table to find the available marketplace images and their attribute values:
9196
9297
| Name | Publisher | Offer | SKU |
9398
|------|-----------|-------|------|
@@ -103,81 +108,86 @@ Follow these steps to create a VM image using the Azure CLI.
103108
| Windows Server 2019 | microsoftwindowsserver | windowsserver | 2019-datacenter-gensecond<br>2019-datacenter-core-g2 |
104109
| SQL Server 2022 Enterprise on Windows Server 2022 | microsoftsqlserver | sql2022-ws2022 | enterprise-gen2<br>standard-gen2 |
105110
111+
If you wanted to create a Windows Server 2019 Datacenter image, you would have the following parameters:
106112
107-
```azurecli
108-
az stack-hci-vm image create --subscription $subscription --resource-group $resource_group --custom-location $customLocationID --location $location --name "<VM_image_name>" --os-type $ostype --offer "windowsserver" --publisher "<publisher_name>" --sku "<SKU>"
109-
```
110-
111-
A deployment job starts for the VM image.
112-
113-
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.
113+
114+
```azurecli
115+
$publisher = “microsoftwindowsserver”
116+
$offer = “windowsserver”
117+
$sku = “2019-datacenter-gensecond”
118+
```
114119

115-
If the flag is not specified, the workload data is automatically placed in a high availability storage path.
120+
1. Create the VM image starting with a specified marketplace image:
116121

117-
The image deployment takes a few minutes to complete. The time taken to download the image depends on the size of the Marketplace image and the network bandwidth available for the download.
122+
```azurecli
123+
az stack-hci-vm image create --resource-group $resource_group --custom-location $customLocationID --name $mktplaceImage --os-type $ostype --offer $offer --publisher $publisher --sku $sku
124+
```
118125
119126
Here's a sample output:
120127
121128
```
122-
PS C:\Users\azcli> $customLocationID=(az customlocation show --resource-group $resource_group --name "myhci-cl" --query id -o tsv)
123-
PS C:\Users\azcli> $customLocationID
124-
/subscriptions/<Subscription ID>/resourcegroups/myhci-rg/providers/microsoft.extendedlocation/customlocations/myhci-cl
125-
PS C:\Users\azcli> az stack-hci-vm image create --subscription $subscription --resource-group $resource_group --custom-location $customLocationID --location $location --name "myhci-marketplaceimage" --os-type $ostype --offer "windowsserver" --publisher "microsoftwindowsserver" --sku "2022-datacenter-azure-edition-core" --version "20348.2031.231006" --storage-path-id $storagepathid
126-
{
127-
"extendedLocation": {
128-
"name": "/subscriptions/<Subscription ID>/resourceGroups/myhci-rg/providers/Microsoft.ExtendedLocation/customLocations/myhci-cl",
129-
"type": "CustomLocation"
130-
},
131-
"id": "/subscriptions/<Subscription ID>/resourceGroups/myhci-rg/providers/Microsoft.AzureStackHCI/marketplacegalleryimages/myhci-marketplaceimage",
132-
"location": "eastus",
133-
"name": "myhci-marketplaceimage",
134-
"properties": {
135-
"identifier": {
136-
"offer": "windowsserver",
137-
"publisher": "microsoftwindowsserver",
138-
"sku": "2022-datacenter-azure-edition-core"
139-
},
140-
"imagePath": null,
141-
"osType": "Windows",
142-
"provisioningState": "Succeeded",
143-
"status": {
144-
"downloadStatus": {
145-
"downloadSizeInMB": 6750
146-
},
147-
"progressPercentage": 98,
148-
"provisioningStatus": {
149-
"operationId": "13be90e0-a780-45bf-a84a-ae91b6e5e468*A380D53083FF6B0A3A157ED7DFD00D33F6B3D40D5559D11AEAED6AD68F7F1A4A",
150-
"status": "Succeeded"
151-
}
152-
},
153-
"storagepathId": "/subscriptions/<Subscription ID>/resourceGroups/myhci-rg/providers/Microsoft.AzureStackHCI/storagecontainers/myhci-storagepath",
154-
"version": {
155-
"name": "20348.2031.231006",
156-
"properties": {
157-
"storageProfile": {
158-
"osDiskImage": {
159-
"sizeInMB": 130050
160-
}
161-
}
162-
}
163-
}
164-
},
165-
"resourceGroup": "myhci-rg",
166-
"systemData": {
167-
"createdAt": "2023-10-27T21:43:15.920502+00:00",
168-
"createdBy": "[email protected]",
169-
"createdByType": "User",
170-
"lastModifiedAt": "2023-10-27T22:06:15.092321+00:00",
171-
"lastModifiedBy": "319f651f-7ddb-4fc6-9857-7aef9250bd05",
172-
"lastModifiedByType": "Application"
173-
},
174-
"tags": null,
175-
"type": "microsoft.azurestackhci/marketplacegalleryimages"
176-
}
177-
178-
PS C:\Users\azcli>
129+
PS C:\Users\azcli> az stack-hci-vm image create --custom-location $cl --name $mktplaceImage --os-type $ostype --resource-group $rg --publisher $publisher --offer $offer --sku $sku
130+
{
131+
"extendedLocation": {
132+
"name": “/subscriptions/<Subscription ID>/resourceGroups/myhci-rg/providers/Microsoft.ExtendedLocation/customLocations/myhci-cl",
133+
"type": "CustomLocation"
134+
},
135+
"id": "/subscriptions/<Subscription ID>/resourceGroups/myhci-rg/providers/Microsoft.AzureStackHCI/marketplacegalleryimages/myhci-marketplaceimage",
136+
\
137+
"location": "eastus",
138+
"name": "myhci-marketplaceimage",
139+
"properties": {
140+
"cloudInitDataSource": null,
141+
"containerId": null,
142+
"hyperVGeneration": null,
143+
"identifier": {
144+
"offer": "windowsserver",
145+
"publisher": "microsoftwindowsserver",
146+
"sku": "2019-datacenter-gensecond"
147+
},
148+
"osType": "Windows",
149+
"provisioningState": "Succeeded",
150+
"status": {
151+
"downloadStatus": {
152+
"downloadSizeInMb": 10832
153+
},
154+
"errorCode": "",
155+
"errorMessage": "",
156+
"progressPercentage": 100,
157+
"provisioningStatus": {
158+
"operationId": "13efc468-7473-429f-911b-858c1e6fc1d5*B11A62EE76B08EF194F8293CDD40F7BC71BFB93255D5A99DD11B4167690752D9",
159+
"status": "Succeeded"
160+
}
161+
},
162+
"version": {
163+
"name": "17763.6293.240905",
164+
"properties": {
165+
"storageProfile": {
166+
"osDiskImage": {
167+
"sizeInMb": 130050
168+
}
169+
}
170+
}
171+
172+
}
173+
},
174+
"resourceGroup": "myhci-rg",
175+
"systemData": {
176+
"createdAt": "2024-09-23T18:53:13.734389+00:00",
177+
"createdBy": "[email protected]",
178+
"createdByType": "User",
179+
"lastModifiedAt": "2024-09-23T19:06:07.532276+00:00",
180+
"lastModifiedBy": "319f651f-7ddb-4fc6-9857-7aef9250bd05",
181+
"lastModifiedByType": "Application"
182+
},
183+
184+
"tags": null,
185+
"type": "microsoft.azurestackhci/marketplacegalleryimages"
186+
}
179187
```
180188
189+
For more information on this CLI command, see [az stack-hci-vm image](/cli/azure/stack-hci-vm/image).
190+
181191
# [Azure portal](#tab/azureportal)
182192
183193
Follow these steps to create a VM image using the Azure portal. In the Azure portal of your Azure Stack HCI cluster resource, take the following steps:

0 commit comments

Comments
 (0)