Change vSphere PowerCLI proxy settings
(2011-05-10 04:30:40)
标签:
杂谈 |
分类: 工作 |
02月 22, 2011
Today I was performing a report in the vSphere cluster I have in my laptop and when I tried to connect to the vCenter Server with PowerCLI I got no response at all.
—-
[vSphere PowerCLI] C:\VMScripts> .\VMCheck1.ps1 10.10.15.10
10:38:10 AM Connecting to VI Server
[vSphere PowerCLI] C:\VMScripts>
—-
My first thought after that was to check network connectivity and the firewall configuration of the vCenter Server but everything was OK. Then after a quick search in the VMware Communities I found the solution in this post.
The problem was the proxy server configuration of PowerCLI, I use to do everything directly from the vCenter desktop, where I have installed PowerCLI and the vSphere Client, but this time I tried to connect directly from my laptop and since I was connected to the corporate network PowerCLI was trying to connect through the proxy server. Following is how I fixed this thanks to the above VMTN post.
First retrieve the PowerCLI proxy configuration with the Get-PowerCLIConfiguration cmdlet.
—-
[vSphere PowerCLI] % Get-PowerCLIConfiguration
Proxy
Policy
————
UseSystemProxy
—-
As you can see Proxy Policy is set to UseSystemProxy. To set this value to NoProxy use the cmdlet Set-PowerCLIConfiguration.
—-
[vSphere PowerCLI] % Set-PowerCLIConfiguration -ProxyPolicy NoProxy
Perform operation?
Performing operation ‘Update vSphere PowerCLI configuration.’?
[Y] Yes
Proxy
Policy
————
NoProxy
—–
Now try to reconnect to the vCenter Server and everything should go without errors.
—-
[vSphere PowerCLI] C:\VMScripts> .\VMCheck1.ps1 10.10.15.10
10:59:42 AM Connecting to VI Server
WARNING: There were one or more problems with the server certificate:
* The certificate’s CN name does not match the passed value.
10:59:57 AM Collecting VM Objects
…