I am running a portion of a script to increase the allocated resources to certain VM's within a vCloud vApp. The script does successfully complete sometimes and then errors other times - although it does seem to be more prone to error once the vApp is powered on.
This is the error I get:
ERROR: Exception calling "GetResponse" with "0" argument(s): "The remote server returned an error: (400) Bad Request."
ERROR: + $RAMresponse = $RAMrequest.GetResponse()
ERROR: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I have attached the portion of the script I have pieced together. I have included the IF statement within the function as it appears as though the error may be due to a task still being in progress on the VM?
Managed to do this using $vmHardware = $CIVM.ExtensionData.GetVirtualHardwareSection() and then pushing the updates through using $vmHardware.UpdateServerdata() and this seems to work more consistently.
Managed to do this using $vmHardware = $CIVM.ExtensionData.GetVirtualHardwareSection() and then pushing the updates through using $vmHardware.UpdateServerdata() and this seems to work more consistently.