I am trying to use the Add-ESXSoftwareDepot function and it appears to be ignoring that I have proxy configured. I told PowerCLI to use the System Proxy using the Set-PowerCLIConfiguration command but when I try the Add-ESXSoftwareDepot while running netstat I can see that it is trying to go out directly which fails. I am using the ESXi-Customizer-PS script v2.8 but it timesout trying to go out to hostupdate.vmware.com since our network is not setup for direct connections.
The script was working about a month ago and I have been unable to get it to work the last couple of weeks. I did update PowerCLI to the latest version and that did not help. I alos tried downgrading PowerCLI all the way back to 6.5 but each version did the same thing. Anyone have any other ideas?
Thanks
Scott
One more thing, if I do an Invoke-Webrequest to the same URL the script uses it works and uses the proxy.
Did you already try calling Add-EsxSoftwareDepot outside that script?
And does it change when you run the following just before that?
[system.net.webrequest]::defaultwebproxy.credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials
[system.net.webrequest]::defaultwebproxy.BypassProxyOnLocal = $true
What errors do you get, if any?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I did try just running Add-ESXSoftwareDepot outside the script as well as trying the commands you mention and get the same error:
hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml"
Add-EsxSoftwareDepot : Could not download from depot at https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml, skipping
(('https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml', '', '<urlopen error [WinError 10060] A connection attempt failed because the connected
party did not properly respond after a period of time, or established connection failed because connected host has failed to respond>'))
At line:1 char:1
+ Add-EsxSoftwareDepot "https://hostupdate.vmware.com/software/VUM/PROD ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ReadError: (System.String[]:String[]) [Add-EsxSoftwareDepot], Exception
+ FullyQualifiedErrorId : ConnectDepotError,VMware.ImageBuilder.Commands.AddDepot
Get-PowerCLIConfiguration
Scope ProxyPolicy DefaultVIServerMode InvalidCertificateAction DisplayDeprecationWarnings WebOperationTimeout
Seconds
----- ----------- ------------------- ------------------------ -------------------------- -------------------
Session UseSystemProxy Multiple Ignore True 300
User UseSystemProxy Multiple Ignore
AllUsers UseSystemProxy
I also set the proxy using netsh as well.
Best I can tell when I monitor netstat, I see a process if-server.exe that is actually trying to make the connection out. When I look for that it is part of the ImageBuilder Module so not sure how to configure that to use the system proxy.
Have you already looked at Andreas's blog post ImageBuilder Deep Dive, Part 2: A closer look and advanced functions
It seems to discuss some of the issues related to proxies.
Perhaps you could also raise your issue in the comments on his blog?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I did but that being from 2012 I wasn't sure if it would get seen. I will try it and see. I am thinking I may have to call support.
Hi,
I had the same issues with version of VMware.ImageBuilder 7.x
Temporary Workaround:
With a version 6.x it works.
Install-Module -Name VMware.ImageBuilder -RequiredVersion 6.7.0.11233116 -SkipPublisherCheck
Import-Module VMware.ImageBuilder -RequiredVersion 6.7.0.11233116
Add-EsxSoftwareDepot -DepotUrl http://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml
If someone has a fix ... do not hesitate 😉