Closed liorkrispin closed 7 months ago
Hi @liorkrispin ,
Could you please elaborate on this issue? Is the payload correct?
Please paste the WebServer.log for this API request.
sorry, this is my code:
$requestbody = @' { "destinationClient": { "clientName": "vcenter" }, "destinationInfo": [ { "vmware": { "esxHost": "ESXiHost", "newName": "new for |VM", "dataStore": "DATASTORE", "resourcePool": "/" } } ] } '@ | ConvertFrom-Json
Restore-CVVirtualMachine -Name SOURCE VM-ClientName vcenter -SubclientName Subclient -outofPlace -Requestbody $requestbody -OverwriteExisting
here is the error:
Are you sure you want to perform this action? Performing the operation "Restore-CVVirtualMachine" on target "SOURCEVM". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): A ValidateResponse : Status: ProtocolError Message: The remote server returned an error: (500) Internal Server Error. ErrorMessage: RecommendedAction: At C:\Program Files\WindowsPowerShell\Modules\Commvault.RESTSession\2.0.22\Commvault.RESTSession.psm1:465 char:17
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,ValidateResponse
If there is a space in the name of the VM , can we please use it via the variables and try?
$sourceVM = 'SOURCE VM'
Restore-CVVirtualMachine -Name $sourceVM -ClientName vcenter -SubclientName Subclient -outofPlace -Requestbody $requestbody -OverwriteExisting
Could you please share the log file -> WebServer.log when running this command?
Archiving this issue
got error when run the next code powershell
$requestbody = @' { "destinationClient": { "clientName": "clientName" }, "destinationInfo": [ { "vmware": { "esxHost": "ESX", "newName": "BLABLA", "dataStore": "VMFS", "resourcePool": "/" } } ] } '@ | ConvertFrom-Json
Restore-CVVirtualMachine -Name VM1-ClientName VC -SubclientName VC-outofPlace -Requestbody $requestbody -OverwriteExisting