vmware / pyvmomi

VMware vSphere API Python Bindings
Apache License 2.0
2.22k stars 766 forks source link

IPv6 only vCenter registration fails when IPv6 proxy is configured. #1053

Closed rutuja-chaudhary closed 1 year ago

rutuja-chaudhary commented 1 year ago

Describe the bug

We are trying to connect to a IPV6 only vcenter server from IPv6 only VM which has a IPv6 only proxy server configured on it. below code snippet we are using to connect to the vCenter server. Note: we are adding square brackets for ipv6 proxy server address.

 SmartConnect(host=server_url,
                               user=username,
                               pwd=password,
                               sslContext=context,
                               httpProxyHost=proxy_address,
                               httpProxyPort=proxy_port,
                               customHeaders=proxy_headers)

We are seeing the below error with this configuration.

Oct 19 08:02:05 nvidia-gpu-manager bash[85427]:   File "/etc/vcp/applianceRTVEnv/lib/python3.10/site-packages/vcp_common_utils/vcenter_service_manager.py", line 47, in connect
Oct 19 08:02:05 nvidia-gpu-manager bash[85427]:     self.si = SmartConnect(host=self.server_url,
Oct 19 08:02:05 nvidia-gpu-manager bash[85427]:   File "/etc/vcp/applianceRTVEnv/lib/python3.10/site-packages/pyVim/connect.py", line 974, in SmartConnect
Oct 19 08:02:05 nvidia-gpu-manager bash[85427]:     supportedVersion = __FindSupportedVersion(protocol, host, port, path,
Oct 19 08:02:05 nvidia-gpu-manager bash[85427]:   File "/etc/vcp/applianceRTVEnv/lib/python3.10/site-packages/pyVim/connect.py", line 787, in __FindSupportedVersion
Oct 19 08:02:05 nvidia-gpu-manager bash[85427]:     serviceVersionDescription = __GetServiceVersionDescription(
Oct 19 08:02:05 nvidia-gpu-manager bash[85427]:   File "/etc/vcp/applianceRTVEnv/lib/python3.10/site-packages/pyVim/connect.py", line 711, in __GetServiceVersionDescription
Oct 19 08:02:05 nvidia-gpu-manager bash[85427]:     return __GetElementTree(protocol, server, port,
Oct 19 08:02:05 nvidia-gpu-manager bash[85427]:   File "/etc/vcp/applianceRTVEnv/lib/python3.10/site-packages/pyVim/connect.py", line 665, in __GetElementTree
Oct 19 08:02:05 nvidia-gpu-manager bash[85427]:     conn.request(method="GET", url=path, headers=headers)
Oct 19 08:02:05 nvidia-gpu-manager bash[85427]:   File "/usr/lib/python3.10/http/client.py", line 1285, in request
Oct 19 08:02:05 nvidia-gpu-manager bash[85427]:     self._send_request(method, url, body, headers, encode_chunked)
Oct 19 08:02:05 nvidia-gpu-manager bash[85427]:   File "/usr/lib/python3.10/http/client.py", line 1331, in _send_request
Oct 19 08:02:05 nvidia-gpu-manager bash[85427]:     self.endheaders(body, encode_chunked=encode_chunked)
Oct 19 08:02:05 nvidia-gpu-manager bash[85427]:   File "/usr/lib/python3.10/http/client.py", line 1280, in endheaders
Oct 19 08:02:05 nvidia-gpu-manager bash[85427]:     self._send_output(message_body, encode_chunked=encode_chunked)
Oct 19 08:02:05 nvidia-gpu-manager bash[85427]:   File "/usr/lib/python3.10/http/client.py", line 1040, in _send_output
Oct 19 08:02:05 nvidia-gpu-manager bash[85427]:     self.send(msg)
Oct 19 08:02:05 nvidia-gpu-manager bash[85427]:   File "/usr/lib/python3.10/http/client.py", line 978, in send
Oct 19 08:02:05 nvidia-gpu-manager bash[85427]:     self.connect()
Oct 19 08:02:05 nvidia-gpu-manager bash[85427]:   File "/usr/lib/python3.10/http/client.py", line 1450, in connect
Oct 19 08:02:05 nvidia-gpu-manager bash[85427]:     super().connect()
Oct 19 08:02:05 nvidia-gpu-manager bash[85427]:   File "/usr/lib/python3.10/http/client.py", line 944, in connect
Oct 19 08:02:05 nvidia-gpu-manager bash[85427]:     self.sock = self._create_connection(
Oct 19 08:02:05 nvidia-gpu-manager bash[85427]:   File "/usr/lib/python3.10/socket.py", line 828, in create_connection
Oct 19 08:02:05 nvidia-gpu-manager bash[85427]:     for res in getaddrinfo(host, port, 0, SOCK_STREAM):
Oct 19 08:02:05 nvidia-gpu-manager bash[85427]:   File "/usr/lib/python3.10/socket.py", line 959, in getaddrinfo
Oct 19 08:02:05 nvidia-gpu-manager bash[85427]:     for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
Oct 19 08:02:05 nvidia-gpu-manager bash[85427]: socket.gaierror: [Errno -2] Name or service not known

Is anything wrong or missing here?

Reproduction steps

1. 2. 3. ...

Expected behavior

vCenter Connection should succeed without any error.

Additional context

No response

jobingeo commented 1 year ago

[like] Jobin George reacted to your message:


From: DanielDraganov @.> Sent: Friday, November 17, 2023 9:56:37 AM To: vmware/pyvmomi @.> Cc: Subscribed @.***> Subject: Re: [vmware/pyvmomi] IPv6 only vCenter registration fails when IPv6 proxy is configured. (Issue #1053)

!! External Email

Closed #1053https://github.com/vmware/pyvmomi/issues/1053 as completed via 8fe0812https://github.com/vmware/pyvmomi/commit/8fe08126903fc9bdd8c01a6ffcf9ea05baa6c364.

— Reply to this email directly, view it on GitHubhttps://github.com/vmware/pyvmomi/issues/1053#event-10991997574, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AGBUFNCULTJ7URABI2ZELHLYE4YFLAVCNFSM6AAAAAA6ISOMZGVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJQHE4TCOJZG42TONA. You are receiving this because you are subscribed to this thread.Message ID: @.***>

!! External Email: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender.