Skip to content

Commit dd277b1

Browse files
Merge pull request #240757 from LouisBerner/v-lberner-ADO_96325_96327
Updated content in two articles for Hiharika.
2 parents 260b634 + 9b5e510 commit dd277b1

File tree

2 files changed

+44
-38
lines changed

2 files changed

+44
-38
lines changed

articles/databox-online/azure-stack-edge-gpu-deploy-virtual-machine-powershell.md

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ author: alkohli
77
ms.service: databox
88
ms.subservice: edge
99
ms.topic: how-to
10-
ms.date: 05/24/2022
10+
ms.date: 07/20/2023
1111
ms.author: alkohli
1212
ms.custom: devx-track-azurepowershell
1313
#Customer intent: As an IT admin, I need to understand how to create and manage virtual machines (VMs) on my Azure Stack Edge Pro device. I want to use APIs so that I can efficiently manage my VMs.
@@ -26,8 +26,8 @@ The high-level deployment workflow of the VM deployment is as follows:
2626
1. Connect to the local Azure Resource Manager of your device.
2727
1. Identify the built-in subscription on the device.
2828
1. Bring your VM image.
29-
1. Create a resource group in the built-in subscription. The resource group will contain the VM and all the related resources.
30-
1. Create a local storage account on the device to store the VHD that will be used to create a VM image.
29+
1. Create a resource group in the built-in subscription. The resource group contains the VM and all the related resources.
30+
1. Create a local storage account on the device to store the VHD that is used to create a VM image.
3131
1. Upload a Windows/Linux source image into the storage account to create a managed disk.
3232
1. Use the managed disk to create a VM image.
3333
1. Enable compute on a device port to create a virtual switch.
@@ -188,7 +188,7 @@ Start by creating a new Azure resource group and use this as a logical container
188188
```powershell
189189
$ResourceGroupName = "<Resource group name>"
190190
```
191-
1. Create a resource group for the resources that you'll create for the VM.
191+
1. Create a resource group for the resources that you create for the VM.
192192
193193
```powershell
194194
New-AzResourceGroup -Name $ResourceGroupName -Location DBELocal
@@ -260,10 +260,14 @@ Use the following commands with AzCopy 10:
260260
1. Copy the VHD from the source (in this case, local system) to the storage account that you created on your device in the earlier step.
261261
262262
```powershell
263-
$StorageAccountKey = (Get-AzStorageAccountKey -ResourceGroupName $ResourceGroupName -Name $StorageAccountName)[0].Value
264-
$endPoint = (Get-AzStorageAccount -name $StorageAccountName -ResourceGroupName $ResourceGroupName).PrimaryEndpoints.Blob
265-
$StorageAccountContext = New-AzStorageContext -StorageAccountName $StorageAccountName -StorageAccountKey $StorageAccountKey -Endpoint $endpoint
266-
$StorageAccountSAS = New-AzStorageAccountSASToken -Service Blob -ResourceType Container,Service,Object -Permission "acdlrw" -Context $StorageAccountContext -Protocol HttpsOnly
263+
$StorageAccountKey = (Get-AzStorageAccountKey -ResourceGroupName $ResourceGroupName -Name $StorageAccountName)[0].Value
264+
$blobendpoint = (Get-AzEnvironment -Name Environment Name).StorageEndpointSuffix
265+
$StorageAccountContext = New-AzStorageContext -StorageAccountName $StorageAccountName -StorageAccountKey $StorageAccountKey -Endpoint $blobendpoint
266+
<Create the container if it does not exist>
267+
$containerName = "con1"
268+
$container = New-AzStorageContainer -Name $containerName -Context $StorageAccountContext -Permission Container
269+
$StorageAccountSAS = New-AzStorageAccountSASToken -Service Blob -ResourceType Container,Service,Object -Permission "acdlrw" -Context $StorageAccountContext -Protocol HttpsOnly
270+
$endPoint = (Get-AzStorageAccount -name $StorageAccountName -ResourceGroupName $ResourceGroupName).PrimaryEndpoints.Blob
267271
<Path to azcopy.exe> cp "$VHDPath\$VHDFile" "$endPoint$ContainerName$StorageAccountSAS"
268272
```
269273
@@ -296,15 +300,15 @@ Use the following commands with AzCopy 10:
296300
Use the following commands with AzCopy 10:
297301
298302
```powershell
299-
$StorageAccountKey = (Get-AzureRmStorageAccountKey -ResourceGroupName <ResourceGroupName> -Name <StorageAccountName>)[0].Value
300-
301-
$endPoint = (Get-AzureRmStorageAccount -name <StorageAccountName> -ResourceGroupName <ResourceGroupName>).PrimaryEndpoints.Blob
302-
303-
$StorageAccountContext = New-AzureStorageContext -StorageAccountName <StorageAccountName> -StorageAccountKey <StorageAccountKey> -Endpoint <Endpoint>
304-
305-
$StorageAccountSAS = New-AzureStorageAccountSASToken -Service Blob,File,Queue,Table -ResourceType Container,Service,Object -Permission "acdlrw" -Context <StorageAccountContext> -Protocol HttpsOnly
306-
307-
<AzCopy exe path> cp "Full VHD path" "<BlobEndPoint>/<ContainerName><StorageAccountSAS>"
303+
$StorageAccountKey = (Get-AzureRmStorageAccountKey -ResourceGroupName $ResourceGroupName -Name $StorageAccountName)[0].Value
304+
$blobendpoint = (Get-AzureRmEnvironment -Name <environment name>).StorageEndpointSuffix
305+
$StorageAccountContext = New-AzureStorageContext -StorageAccountName $StorageAccountName -StorageAccountKey $StorageAccountKey -Endpoint $blobendpoint
306+
<Create the container if it does not exist>
307+
$containerName = "con1"
308+
$container = New-AzureStorageContainer -Name $containerName -Context $StorageAccountContext -Permission Container
309+
$StorageAccountSAS = New-AzureStorageAccountSASToken -Service Blob -ResourceType Container,Service,Object -Permission "acdlrw" -Context $StorageAccountContext -Protocol HttpsOnly
310+
$endPoint = (Get-AzureRmStorageAccount -name $StorageAccountName -ResourceGroupName $ResourceGroupName).PrimaryEndpoints.Blob
311+
<Path to azcopy.exe> cp "$VHDPath\$VHDFile" "$endPoint$ContainerName$StorageAccountSAS"
308312
```
309313

310314
Here's some example output:
@@ -330,7 +334,7 @@ C:\AzCopy.exe cp "$VHDPath\$VHDFile" "$endPoint$ContainerName$StorageAccountSAS
330334

331335
## Create a managed disk from the VHD
332336

333-
You will now create a managed disk from the uploaded VHD.
337+
You'll now create a managed disk from the uploaded VHD.
334338

335339
### [Az](#tab/az)
336340

@@ -549,7 +553,7 @@ $aRmVN = Get-AzureRMVirtualNetwork -Name ASEVNET -ResourceGroupName ASERG
549553

550554
### Create a virtual network interface card
551555

552-
You'll create a virtual network interface card by using the virtual network subnet ID.
556+
You create a virtual network interface card by using the virtual network subnet ID.
553557

554558
### [Az](#tab/az)
555559

@@ -567,7 +571,7 @@ You'll create a virtual network interface card by using the virtual network subn
567571
$Nic = New-AzNetworkInterface -Name $NicName -ResourceGroupName $ResourceGroupName -Location DBELocal -IpConfiguration $IpConfig
568572
```
569573
570-
By default, an IP is dynamically assigned to your network interface from the network enabled for compute. Use the `-PrivateIpAddress parameter` if you are allocating a static IP to your network interface.
574+
By default, an IP is dynamically assigned to your network interface from the network enabled for compute. Use the `-PrivateIpAddress parameter` if you're allocating a static IP to your network interface.
571575
572576
Here's an example output:
573577
@@ -645,7 +649,7 @@ $ipConfig = New-AzureRmNetworkInterfaceIpConfig -Name <IP config Name> -SubnetId
645649
$Nic = New-AzureRmNetworkInterface -Name <Nic name> -ResourceGroupName <Resource group name> -Location DBELocal -IpConfiguration $ipConfig
646650
```
647651

648-
By default, an IP is dynamically assigned to your network interface from the network enabled for compute. Use the `-PrivateIpAddress parameter` if you are allocating a static IP to your network interface.
652+
By default, an IP is dynamically assigned to your network interface from the network enabled for compute. Use the `-PrivateIpAddress parameter` if you're allocating a static IP to your network interface.
649653

650654
Here's some example output:
651655

articles/databox-online/azure-stack-edge-gpu-deploy-vm-specialized-image-powershell.md

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.service: databox
88
ms.subservice: edge
99
ms.custom: devx-track-arm-template, devx-track-azurepowershell
1010
ms.topic: how-to
11-
ms.date: 04/15/2021
11+
ms.date: 06/28/2023
1212
ms.author: alkohli
1313
#Customer intent: As an IT admin, I need to understand how to create and upload Azure VM images that I can use with my Azure Stack Edge Pro GPU device so that I can deploy VMs on the device.
1414
---
@@ -39,7 +39,7 @@ The high-level workflow to deploy a VM from a specialized image is:
3939

4040
Before you can deploy a VM on your device via PowerShell, make sure that:
4141

42-
- You have access to a client that you'll use to connect to your device.
42+
- You have access to a client that you use to connect to your device.
4343
- Your client runs a [Supported OS](azure-stack-edge-gpu-system-requirements.md#supported-os-for-clients-connected-to-device).
4444
- Your client is configured to connect to the local Azure Resource Manager of your device as per the instructions in [Connect to Azure Resource Manager for your device](azure-stack-edge-gpu-connect-resource-manager.md).
4545

@@ -53,7 +53,7 @@ Verify that your client can connect to the local Azure Resource Manager.
5353
Login-AzureRMAccount -EnvironmentName <Environment Name>
5454
```
5555
56-
2. Provide the username `EdgeArmUser` and the password to connect via Azure Resource Manager. If you do not recall the password, [Reset the password for Azure Resource Manager](azure-stack-edge-gpu-set-azure-resource-manager-password.md) and use this password to sign in.
56+
2. Provide the username `EdgeArmUser` and the password to connect via Azure Resource Manager. If you don't recall the password, [Reset the password for Azure Resource Manager](azure-stack-edge-gpu-set-azure-resource-manager-password.md) and use this password to sign in.
5757
5858
## Deploy VM from specialized image
5959
@@ -65,7 +65,7 @@ Follow these steps to copy VHD to local storage account:
6565
6666
1. Copy the source VHD to a local blob storage account on your Azure Stack Edge.
6767
68-
1. Take note of the resulting URI. You'll use this URI in a later step.
68+
1. Take note of the resulting URI. You use this URI in a later step.
6969
7070
To create and access a local storage account, see the sections [Create a storage account](azure-stack-edge-gpu-deploy-virtual-machine-powershell.md#create-a-local-storage-account) through [Upload a VHD](azure-stack-edge-gpu-deploy-virtual-machine-powershell.md#upload-a-vhd) in the article: [Deploy VMs on your Azure Stack Edge device via Azure PowerShell](azure-stack-edge-gpu-deploy-virtual-machine-powershell.md).
7171
@@ -80,7 +80,7 @@ Follow these steps to create a managed disk from a VHD that you uploaded to the
8080
$DiskRG = <managed disk resource group>
8181
$DiskName = <managed disk name>
8282
```
83-
Here is an example output.
83+
Here's an example output.
8484
8585
```powershell
8686
PS C:\WINDOWS\system32> $VHDURI = "https://myasevmsa.blob.myasegpudev.wdshcsso.com/vhds/WindowsServer2016Datacenter.vhd"
@@ -90,11 +90,13 @@ Follow these steps to create a managed disk from a VHD that you uploaded to the
9090
1. Create a new managed disk.
9191
9292
```powershell
93-
$DiskConfig = New-AzureRmDiskConfig -Location DBELocal -CreateOption Import -SourceUri $VhdURI
94-
$disk = New-AzureRMDisk -ResourceGroupName $DiskRG -DiskName $DiskName -Disk $DiskConfig
93+
$StorageAccountId = (Get-AzureRmStorageAccount -ResourceGroupName $ResourceGroupName -Name $StorageAccountName).Id
94+
95+
$DiskConfig = New-AzureRmDiskConfig -Location DBELocal -StorageAccountId $StorageAccountId -CreateOption Import -SourceUri "Source URL for your VHD"
96+
9597
```
9698
97-
Here is an example output. The location here is set to the location of the local storage account and is always `DBELocal` for all local storage accounts on your Azure Stack Edge Pro GPU device.
99+
Here's an example output. The location here is set to the location of the local storage account and is always `DBELocal` for all local storage accounts on your Azure Stack Edge Pro GPU device.
98100
99101
```powershell
100102
PS C:\WINDOWS\system32> $DiskConfig = New-AzureRmDiskConfig -Location DBELocal -CreateOption Import -SourceUri $VHDURI
@@ -121,7 +123,7 @@ Follow these steps to create a VM from a managed disk:
121123
>[!NOTE]
122124
> The `PrivateIP` parameter is optional. Use this parameter to assign a static IP else the default is a dynamic IP using DHCP.
123125
124-
Here is an example output. In this example, the same resource group is specified for all the VM resources though you can create and specify separate resource groups for the resources if needed.
126+
Here's an example output. In this example, the same resource group is specified for all the VM resources though you can create and specify separate resource groups for the resources if needed.
125127
126128
```powershell
127129
PS C:\WINDOWS\system32> $NicRG = "myasevm1rg"
@@ -135,15 +137,15 @@ Follow these steps to create a VM from a managed disk:
135137
136138
1. Get the virtual network information and create a new network interface.
137139
138-
This sample assumes you are creating a single network interface on the default virtual network `ASEVNET` that is associated with the default resource group `ASERG`. If needed, you could specify an alternate virtual network, or create multiple network interfaces. For more information, see [Add a network interface to a VM via the Azure portal](azure-stack-edge-gpu-manage-virtual-machine-network-interfaces-portal.md).
140+
This sample assumes you're creating a single network interface on the default virtual network `ASEVNET` that is associated with the default resource group `ASERG`. If needed, you could specify an alternate virtual network, or create multiple network interfaces. For more information, see [Add a network interface to a VM via the Azure portal](azure-stack-edge-gpu-manage-virtual-machine-network-interfaces-portal.md).
139141
140142
```powershell
141143
$armVN = Get-AzureRMVirtualNetwork -Name ASEVNET -ResourceGroupName ASERG
142144
$ipConfig = New-AzureRmNetworkInterfaceIpConfig -Name $IPConfigName -SubnetId $armVN.Subnets[0].Id [-PrivateIpAddress $PrivateIP]
143145
$nic = New-AzureRmNetworkInterface -Name $NicName -ResourceGroupName $NicRG -Location DBELocal -IpConfiguration $ipConfig
144146
```
145147
146-
Here is an example output.
148+
Here's an example output.
147149
148150
```powershell
149151
PS C:\WINDOWS\system32> $armVN = Get-AzureRMVirtualNetwork -Name ASEVNET -ResourceGroupName ASERG
@@ -170,15 +172,15 @@ Follow these steps to create a VM from a managed disk:
170172
```powershell
171173
$vm = Set-AzureRmVMOSDisk -VM $vm -ManagedDiskId $disk.Id -StorageAccountType StandardLRS -CreateOption Attach –[Windows/Linux]
172174
```
173-
The last flag in this command will be either `-Windows` or `-Linux` depending on which OS you are using for your VM.
175+
The last flag in this command will be either `-Windows` or `-Linux` depending on which OS you're using for your VM.
174176
175177
1. Create the VM.
176178
177179
```powershell
178180
New-AzureRmVM -ResourceGroupName $VMRG -Location DBELocal -VM $vm
179181
```
180182
181-
Here is an example output.
183+
Here's an example output.
182184
183185
```powershell
184186
PS C:\WINDOWS\system32> $vmConfig = New-AzureRmVMConfig -VMName $VMName -VMSize $VMSize
@@ -195,14 +197,14 @@ Follow these steps to create a VM from a managed disk:
195197
196198
## Delete VM and resources
197199
198-
This article used only one resource group to create all the VM resource. Deleting that resource group will delete the VM and all the associated resources.
200+
This article used only one resource group to create all the VM resource. Deleting that resource group deletes the VM and all the associated resources.
199201
200202
1. First view all the resources created under the resource group.
201203
202204
```powershell
203205
Get-AzureRmResource -ResourceGroupName <Resource group name>
204206
```
205-
Here is an example output.
207+
Here's an example output.
206208
207209
```powershell
208210
PS C:\WINDOWS\system32> Get-AzureRmResource -ResourceGroupName myasevm1rg
@@ -244,7 +246,7 @@ This article used only one resource group to create all the VM resource. Deletin
244246
```powershell
245247
Remove-AzureRmResourceGroup -ResourceGroupName <Resource group name>
246248
```
247-
Here is an example output.
249+
Here's an example output.
248250
249251
```powershell
250252
PS C:\WINDOWS\system32> Remove-AzureRmResourceGroup -ResourceGroupName myasevm1rg
@@ -261,7 +263,7 @@ This article used only one resource group to create all the VM resource. Deletin
261263
```powershell
262264
Get-AzureRmResourceGroup
263265
```
264-
Here is an example output.
266+
Here's an example output.
265267
266268
```powershell
267269
PS C:\WINDOWS\system32> Get-AzureRmResourceGroup

0 commit comments

Comments
 (0)