November 2017
Intermediate to advanced
276 pages
7h 6m
English
Before starting the resizing process, you have to create a new disk and attach it to the VM we are working with. Then, using the same session, we will run the following cmdlets. The newly created disk name, in this case, is PacktPub-DataDiskPS1 with a small size, so you can expand it:
$ResizeDisk = $VM.StorageProfile.DataDisks | Where {$_.Lun -eq 0 -and $_.Name -eq "PacktPub-DataDiskPS1"}$ResizeDisk.DiskSizeGB = 4095Update-AzureRmVM -VM $VM -ResourceGroupName PacktPub
With the first variable, I specified which data disk I was going to resize and to which Lun it is assigned, then I resized it. Finally, I updated the VM to save the new configuration.
Read now
Unlock full access