Hello,
I use Resource Manage framework. I want to add existing data disk to existing VM. VM is Stopped.
1. afterSwitch-AzureMode AzureResourceManager
$vm = Get-AzureVM -ResourceGroupName 'myrg' -Name 'myvm' Add-AzureVMDataDisk -VM $vm ` -Name 'mydatadisk' ` -SourceImageUri 'https://myacc.blob.core.windows.net/vhds/mydatadisk.vhd' ` -VhdUri 'https://myacc.blob.core.windows.net/vhds/mydatadisk.vhd' ` -CreateOption attach ` -Caching ReadOnly ` -DiskSizeInGB $null ` -Lun 0
Update-AzureVM -ResourceGroupName 'myrg' -Name 'myvm' -VM $vm
I get an error:
Update-AzureVM : A parameter cannot be found that matches parameter name 'Name'.2. after
$vm | Update-AzureVM
I get another error:
Update-AzureVM : PropertyChangeNotAllowed: Changing property 'windowsConfiguration.additionalUnattendContent' is not allowed. OperationID : 'dcb83bc8-4077-40b2-97fa-38cad5bfacf2' At line:1 char:7+ $vm | Update-AzureVM+ ~~~~~~~~~~~~~~+ CategoryInfo : CloseError: (:) [Update-AzureVM], ComputeCloudException+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Compute.UpdateAzureVMCommand
How I can add an existing data disk?
Thank you in advance,
Vadim.