- This topic has 1 reply, 3 voices, and was last updated August 26, 2024 by .
Connect to Vcenter with powershell script from ZVM
You must be logged in to create new topics.
Click here to login
Hello,
I would like some help regarding an issue I’m encountering when attempting to connect from a ZVM to a VCenter via a PowerShell script.
For context, I’m performing a failover using the prescript and postscript options provided by Zerto. I use these options to execute PowerShell scripts. Our Zerto version is Zerto version 9 update 4 patch 1 Build 090419021
The failover, from My_VCenter_A to My_VCenter_B, works, but the PowerShell postscript does not function correctly.
In my script, which is on my ZVM, one of the first actions is the Connect-VIServer command. This command returns the following error:
Connect-VIServer : 13/08/2024 16:07:25 Connect-VIServer Could not resolve the requested VC server.
Additional Information: There was no endpoint listening at XXX that could accept the message.
This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
At line:79 char:9
+ Connect-VIServer -Server XXXX -User XXXX …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (:) [Connect-VIServer], ViServerConnectionException
+ FullyQualifiedErrorId : Client20_ConnectivityServiceImpl_Reconnect_NameResolutionFailure,VMware.VimAutomation.ViCo
re.Cmdlets.Commands.ConnectVIServer
However, when I manually execute the same PowerShell command from a terminal on the same ZVM, I don’t have any issues. Therefore, it’s not a network flow or other similar problem…
Is there ant options that I can check to solve this issue ?
The message that comes back indicates a failure to resolve. Maybe the way the server’s FQDN/hostname is handed to the connect-viserver isn’t correct. I would try copying and pasting that line from the script right into PowerShell to see what happens.