Skip to content

Instantly share code, notes, and snippets.

@astaykov
Created March 10, 2015 07:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save astaykov/8400c8c91ec8dd78e401 to your computer and use it in GitHub Desktop.
Save astaykov/8400c8c91ec8dd78e401 to your computer and use it in GitHub Desktop.
Clear-AzureProfile -Force
cls
Add-AzureAccount
Select-AzureSubscription -SubscriptionName '<your subscription name here>'
Set-AzureSubscription -SubscriptionName '<your subscription name here>' -CurrentStorageAccountName '<storage account name where disks should be placed>'
$vm = Get-AzureVM | Where-Object { $_.Name -eq '<name of the VM to update>' }
Add-AzureDataDisk -CreateNew -DiskSizeInGB 50 -DiskLabel '<label of data disk 1>' -HostCaching ReadOnly -LUN 2 -VM $vm.VM
Add-AzureDataDisk -CreateNew -DiskSizeInGB 50 -DiskLabel '<label of data disk 2>' -HostCaching ReadOnly -LUN 3 -VM $vm.VM
Add-AzureDataDisk -CreateNew -DiskSizeInGB 50 -DiskLabel '<label of data disk 3>' -HostCaching ReadOnly -LUN 4 -VM $vm.VM
Update-AzureVM -Name $vm.Name -ServiceName $vm.ServiceName -VM $vm.VM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment