Quantcast
Channel: Virtual Machine Manager – General forum
Viewing all articles
Browse latest Browse all 728

How can I set VM property programatically when the VM is released from write-lock state?

$
0
0

Hi All,

I am creating a VM asynchronously and then I am tring to update one of VM property by following way.

New-SCVirtualMachine -Name "yy" -VMConfiguration $virtualMachineConfiguration -Cloud $cloud -Description "yy" -JobGroup "5dcffd71-7a7d-42ac-9ebe-bb23ce9e2d01" -ReturnImmediately -StartAction "NeverAutoTurnOnVM" -StopAction"SaveVM" -RunAsynchronously

$VM= Get-SCVirtualMachine -Name "yy" -Cloud $cloud

Set-SCVirtualMachine -Tag "tag1" -CostCenter "CC1" -JobGroup "5dcffd71-7a7d-42ac-9ebe-bb23ce9e2d01" -VM $VM -RunAsynchronously

Now I am getting an error saying that the VM object is write locked.

Is there any way to do this asynchronously and programatically using powershell in scvmm 2012 r2 when the object is released from write-lock ?

Thanks in advance,
Mohak Mahato


Viewing all articles
Browse latest Browse all 728

Trending Articles