File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
articles/virtual-machines Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -77,12 +77,15 @@ $region=desiredRegion
77
77
$sku=desiredSKU
78
78
#Size must be 513 or larger
79
79
$size=513
80
+ $lun=desiredLun
80
81
81
82
Set-AzContext -SubscriptionName <yourSubscriptionName>
82
83
83
84
$diskConfig = New-AzDiskConfig -Location $region -CreateOption Empty -DiskSizeGB $size -SkuName $sku -PerformancePlus $true
84
85
85
- $dataDisk = New-AzDisk -ResourceGroupName $myRG -DiskName $myDisk -Disk $diskConfig
86
+ $dataDisk = New-AzDisk -ResourceGroupName $myRG -DiskName $myDisk -Disk $diskConfig
87
+
88
+ Add-AzVMDataDisk -VMName $myVM -ResourceGroupName $myRG -DiskName $myDisk -Lun $lun -CreateOption Empty -ManagedDiskId $dataDisk.Id
86
89
```
87
90
88
91
To migrate data from an existing disk or snapshot to a new disk with performance plus enabled, use the following script:
@@ -96,12 +99,14 @@ $sku=desiredSKU
96
99
#Size must be 513 or larger
97
100
$size=513
98
101
$sourceURI=diskOrSnapshotURI
102
+ $lun=desiredLun
99
103
100
104
Set-AzContext -SubscriptionName <<yourSubscriptionName>>
101
105
102
106
$diskConfig = New-AzDiskConfig -Location $region -CreateOption Copy -DiskSizeGB $size -SkuName $sku -PerformancePlus $true -SourceResourceID $sourceURI
103
107
104
108
$dataDisk = New-AzDisk -ResourceGroupName $myRG -DiskName $myDisk -Disk $diskconfig
109
+ Add-AzVMDataDisk -VMName $myVM -ResourceGroupName $myRG -DiskName $myDisk -Lun $lun -CreateOption Empty -ManagedDiskId $dataDisk.Id
105
110
```
106
111
---
107
112
You can’t perform that action at this time.
0 commit comments