Skip to content
This repository was archived by the owner on Dec 6, 2023. It is now read-only.

Commit 994a8d6

Browse files
authored
Updating to accommodate Premium SSD v2 and Ultra Disk (#393)
1 parent f028edd commit 994a8d6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

virtual-machine/create-managed-disk-from-snapshot/create-managed-disk-from-snapshot.ps1

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,13 @@ $diskName = 'yourManagedDiskName'
1313
#Provide the size of the disks in GB. It should be greater than the VHD file size.
1414
$diskSize = '128'
1515

16-
#Provide the storage type for Managed Disk. PremiumLRS or StandardLRS.
16+
#Provide the storage type for Managed Disk. Acceptable values are Standard_LRS, Premium_LRS, PremiumV2_LRS, StandardSSD_LRS, UltraSSD_LRS, Premium_ZRS and StandardSSD_ZRS.
1717
$storageType = 'Premium_LRS'
1818

19+
#Required for Premium SSD v2 and Ultra Disks
20+
#Provide the Availability Zone you'd like the disk to be created in, default is 1
21+
$zone=1
22+
1923
#Provide the Azure region (e.g. westus) where Managed Disks will be located.
2024
#This location should be same as the snapshot location
2125
#Get all the Azure location using command below:
@@ -27,6 +31,7 @@ Select-AzSubscription -SubscriptionId $SubscriptionId
2731

2832
$snapshot = Get-AzSnapshot -ResourceGroupName $resourceGroupName -SnapshotName $snapshotName
2933

34+
#If you're creating a Premium SSD v2 or an Ultra Disk, add "-Zone $zone" to the end of the command
3035
$diskConfig = New-AzDiskConfig -SkuName $storageType -Location $location -CreateOption Copy -SourceResourceId $snapshot.Id -DiskSizeGB $diskSize
3136

3237
New-AzDisk -Disk $diskConfig -ResourceGroupName $resourceGroupName -DiskName $diskName

0 commit comments

Comments
 (0)