cloudbase / cloudbase-init

Cross-platform instance initialization
http://openstack.org
Apache License 2.0
428 stars 152 forks source link

Windows network persistence #53

Closed dacron closed 4 years ago

dacron commented 4 years ago

When deploying a Windows 10 1909 image via MAAS and Cloudbase-init 1.1.1 the network settings do not persist.

After initial MAAS deployment the deployed host is accessible. However, when the deployed host is restarted it is not reachable again. It looks like an issue with the network config plugin. Prior to restarting the host I see this in cloudbase-init.log:

2020-06-19 12:15:14.385 3820 INFO cloudbaseinit.init [-] Executing plugin 'NetworkConfigPlugin'
2020-06-19 12:15:14.385 3820 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.osutils.windows.WindowsUtils' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2020-06-19 12:15:14.385 3820 INFO cloudbaseinit.plugins.common.networkconfig [-] Renaming network adapter "Ethernet0" to "ens192"
2020-06-19 12:15:14.791 3820 DEBUG cloudbaseinit.plugins.common.networkconfig [-] Setting MTU on network adapter "ens192": 1500 _process_link_common C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\plugins\common\networkconfig.py:182
2020-06-19 12:15:14.791 3820 DEBUG cloudbaseinit.osutils.windows [-] Setting MTU for interface "ens192" with value "1500" set_network_adapter_mtu C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\osutils\windows.py:843
2020-06-19 12:15:14.838 3820 DEBUG cloudbaseinit.plugins.common.networkconfig [-] Enable network adapter "ens192": True _process_link_common C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\plugins\common\networkconfig.py:187
2020-06-19 12:15:14.900 3820 INFO cloudbaseinit.plugins.common.networkconfig [-] Setting static IP configuration on network adapter "ens192". IP: 198.90.245.252, prefix length: 24, gateway: 198.90.245.1, dns: ['198.90.245.16', '198.61.86.53']
2020-06-19 12:15:14.963 3820 DEBUG cloudbaseinit.osutils.windows [-] Removing existing IP address "198.90.245.252" from adapter "ens192" _set_static_network_config C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\osutils\windows.py:980
2020-06-19 12:15:19.088 3820 ERROR cloudbaseinit.init [-] plugin 'NetworkConfigPlugin' failed with error '<x_wmi: The client cannot connect to the destination specified in the request. Verify that the service on the destination is running and is accepting requests. Consult the logs and documentation for the WS-Management service running on the destination, most commonly IIS or WinRM. If the destination is the WinRM service, run the following command on the destination to analyze and configure the WinRM service: "winrm quickconfig". (-2144108526, 'The client cannot connect to the destination specified in the request. Verify that the service on the destination is running and is accepting requests. Consult the logs and documentation for the WS-Management service running on the destination, most commonly IIS or WinRM. If the destination is the WinRM service, run the following command on the destination to analyze and configure the WinRM service: "winrm quickconfig".', (0, None, 'The client cannot connect to the destination specified in the request. Verify that the service on the destination is running and is accepting requests. Consult the logs and documentation for the WS-Management service running on the destination, most commonly IIS or WinRM. If the destination is the WinRM service, run the following command on the destination to analyze and configure the WinRM service: "winrm quickconfig".', None, None, -2144108526), None)>': wmi.x_wmi: <x_wmi: The client cannot connect to the destination specified in the request. Verify that the service on the destination is running and is accepting requests. Consult the logs and documentation for the WS-Management service running on the destination, most commonly IIS or WinRM. If the destination is the WinRM service, run the following command on the destination to analyze and configure the WinRM service: "winrm quickconfig". (-2144108526, 'The client cannot connect to the destination specified in the request. Verify that the service on the destination is running and is accepting requests. Consult the logs and documentation for the WS-Management service running on the destination, most commonly IIS or WinRM. If the destination is the WinRM service, run the following command on the destination to analyze and configure the WinRM service: "winrm quickconfig".', (0, None, 'The client cannot connect to the destination specified in the request. Verify that the service on the destination is running and is accepting requests. Consult the logs and documentation for the WS-Management service running on the destination, most commonly IIS or WinRM. If the destination is the WinRM service, run the following command on the destination to analyze and configure the WinRM service: "winrm quickconfig".', None, None, -2144108526), None)>
2020-06-19 12:15:19.088 3820 ERROR cloudbaseinit.init [-] <x_wmi: The client cannot connect to the destination specified in the request. Verify that the service on the destination is running and is accepting requests. Consult the logs and documentation for the WS-Management service running on the destination, most commonly IIS or WinRM. If the destination is the WinRM service, run the following command on the destination to analyze and configure the WinRM service: "winrm quickconfig". (-2144108526, 'The client cannot connect to the destination specified in the request. Verify that the service on the destination is running and is accepting requests. Consult the logs and documentation for the WS-Management service running on the destination, most commonly IIS or WinRM. If the destination is the WinRM service, run the following command on the destination to analyze and configure the WinRM service: "winrm quickconfig".', (0, None, 'The client cannot connect to the destination specified in the request. Verify that the service on the destination is running and is accepting requests. Consult the logs and documentation for the WS-Management service running on the destination, most commonly IIS or WinRM. If the destination is the WinRM service, run the following command on the destination to analyze and configure the WinRM service: "winrm quickconfig".', None, None, -2144108526), None)>: wmi.x_wmi: <x_wmi: The client cannot connect to the destination specified in the request. Verify that the service on the destination is running and is accepting requests. Consult the logs and documentation for the WS-Management service running on the destination, most commonly IIS or WinRM. If the destination is the WinRM service, run the following command on the destination to analyze and configure the WinRM service: "winrm quickconfig". (-2144108526, 'The client cannot connect to the destination specified in the request. Verify that the service on the destination is running and is accepting requests. Consult the logs and documentation for the WS-Management service running on the destination, most commonly IIS or WinRM. If the destination is the WinRM service, run the following command on the destination to analyze and configure the WinRM service: "winrm quickconfig".', (0, None, 'The client cannot connect to the destination specified in the request. Verify that the service on the destination is running and is accepting requests. Consult the logs and documentation for the WS-Management service running on the destination, most commonly IIS or WinRM. If the destination is the WinRM service, run the following command on the destination to analyze and configure the WinRM service: "winrm quickconfig".', None, None, -2144108526), None)>
2020-06-19 12:15:19.088 3820 ERROR cloudbaseinit.init Traceback (most recent call last):
2020-06-19 12:15:19.088 3820 ERROR cloudbaseinit.init   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\wmi\__init__.py", line 98, in func_wrapper
2020-06-19 12:15:19.088 3820 ERROR cloudbaseinit.init     return func(*args, **kwargs)
2020-06-19 12:15:19.088 3820 ERROR cloudbaseinit.init   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\wmi\__init__.py", line 50, in wrapper
2020-06-19 12:15:19.088 3820 ERROR cloudbaseinit.init     return f(*args, **kwargs)
2020-06-19 12:15:19.088 3820 ERROR cloudbaseinit.init   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\wmi\__init__.py", line 722, in delete_instance
2020-06-19 12:15:19.088 3820 ERROR cloudbaseinit.init     operation_options)
2020-06-19 12:15:19.088 3820 ERROR cloudbaseinit.init PyMI.error: {'error_code': 2150858770, 'mi_result': 1, 'message': 'The client cannot connect to the destination specified in the request. Verify that the service on the destination is running and is accepting requests. Consult the logs and documentation for the WS-Management service running on the destination, most commonly IIS or WinRM. If the destination is the WinRM service, run the following command on the destination to analyze and configure the WinRM service: "winrm quickconfig".'}
2020-06-19 12:15:19.088 3820 ERROR cloudbaseinit.init 
2020-06-19 12:15:19.088 3820 ERROR cloudbaseinit.init During handling of the above exception, another exception occurred:
2020-06-19 12:15:19.088 3820 ERROR cloudbaseinit.init 
2020-06-19 12:15:19.088 3820 ERROR cloudbaseinit.init Traceback (most recent call last):
2020-06-19 12:15:19.088 3820 ERROR cloudbaseinit.init   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\init.py", line 67, in _exec_plugin
2020-06-19 12:15:19.088 3820 ERROR cloudbaseinit.init     shared_data)
2020-06-19 12:15:19.088 3820 ERROR cloudbaseinit.init   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\plugins\common\networkconfig.py", line 307, in execute
2020-06-19 12:15:19.088 3820 ERROR cloudbaseinit.init     return self._process_network_details_v2(network_details)
2020-06-19 12:15:19.088 3820 ERROR cloudbaseinit.init   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\plugins\common\networkconfig.py", line 300, in _process_network_details_v2
2020-06-19 12:15:19.088 3820 ERROR cloudbaseinit.init     osutils, network_details)
2020-06-19 12:15:19.088 3820 ERROR cloudbaseinit.init   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\plugins\common\networkconfig.py", line 286, in _process_networks
2020-06-19 12:15:19.088 3820 ERROR cloudbaseinit.init     net.link, ip_address, prefix_len, gateway, nameservers)
2020-06-19 12:15:19.088 3820 ERROR cloudbaseinit.init   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\osutils\windows.py", line 1005, in set_static_network_config
2020-06-19 12:15:19.088 3820 ERROR cloudbaseinit.init     name, address, prefix_len, gateway)
2020-06-19 12:15:19.088 3820 ERROR cloudbaseinit.init   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\osutils\windows.py", line 981, in _set_static_network_config
2020-06-19 12:15:19.088 3820 ERROR cloudbaseinit.init     existing_address.Delete_()
2020-06-19 12:15:19.088 3820 ERROR cloudbaseinit.init   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\wmi\__init__.py", line 98, in func_wrapper
2020-06-19 12:15:19.088 3820 ERROR cloudbaseinit.init     return func(*args, **kwargs)
2020-06-19 12:15:19.088 3820 ERROR cloudbaseinit.init   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\wmi\__init__.py", line 312, in Delete_
2020-06-19 12:15:19.088 3820 ERROR cloudbaseinit.init     self._conn.delete_instance(self, operation_options)
2020-06-19 12:15:19.088 3820 ERROR cloudbaseinit.init   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\wmi\__init__.py", line 111, in func_wrapper
2020-06-19 12:15:19.088 3820 ERROR cloudbaseinit.init     raise x_wmi(err_msg, com_ex)
2020-06-19 12:15:19.088 3820 ERROR cloudbaseinit.init wmi.x_wmi: <x_wmi: The client cannot connect to the destination specified in the request. Verify that the service on the destination is running and is accepting requests. Consult the logs and documentation for the WS-Management service running on the destination, most commonly IIS or WinRM. If the destination is the WinRM service, run the following command on the destination to analyze and configure the WinRM service: "winrm quickconfig". (-2144108526, 'The client cannot connect to the destination specified in the request. Verify that the service on the destination is running and is accepting requests. Consult the logs and documentation for the WS-Management service running on the destination, most commonly IIS or WinRM. If the destination is the WinRM service, run the following command on the destination to analyze and configure the WinRM service: "winrm quickconfig".', (0, None, 'The client cannot connect to the destination specified in the request. Verify that the service on the destination is running and is accepting requests. Consult the logs and documentation for the WS-Management service running on the destination, most commonly IIS or WinRM. If the destination is the WinRM service, run the following command on the destination to analyze and configure the WinRM service: "winrm quickconfig".', None, None, -2144108526), None)>

Post restart the cloudbase-init.log contains:

2020-06-19 12:20:57.994 3788 DEBUG cloudbaseinit.metadata.services.base [-] Executing http request GET at http://198-90-245-0--24.maas-internal:5248/MAAS/metadata/2012-03-01/meta-data/ _http_request C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\base.py:315
2020-06-19 12:20:57.994 3788 DEBUG urllib3.connectionpool [-] Starting new HTTP connection (1): 198-90-245-0--24.maas-internal:5248 _new_conn C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\urllib3\connectionpool.py:225
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base [-] HTTPConnectionPool(host='198-90-245-0--24.maas-internal', port=5248): Max retries exceeded with url: /MAAS/metadata/2012-03-01/meta-data/ (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0000025DD7525668>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',)): requests.exceptions.ConnectionError: HTTPConnectionPool(host='198-90-245-0--24.maas-internal', port=5248): Max retries exceeded with url: /MAAS/metadata/2012-03-01/meta-data/ (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0000025DD7525668>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',))
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base Traceback (most recent call last):
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\urllib3\connection.py", line 157, in _new_conn
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base     (self._dns_host, self.port), self.timeout, **extra_kw
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\urllib3\util\connection.py", line 61, in create_connection
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base     for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\socket.py", line 745, in getaddrinfo
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base     for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base socket.gaierror: [Errno 11001] getaddrinfo failed
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base 
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base During handling of the above exception, another exception occurred:
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base 
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base Traceback (most recent call last):
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\urllib3\connectionpool.py", line 672, in urlopen
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base     chunked=chunked,
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\urllib3\connectionpool.py", line 387, in _make_request
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base     conn.request(method, url, **httplib_request_kw)
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\http\client.py", line 1239, in request
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base     self._send_request(method, url, body, headers, encode_chunked)
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\http\client.py", line 1285, in _send_request
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base     self.endheaders(body, encode_chunked=encode_chunked)
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\http\client.py", line 1234, in endheaders
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base     self._send_output(message_body, encode_chunked=encode_chunked)
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\http\client.py", line 1026, in _send_output
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base     self.send(msg)
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\http\client.py", line 964, in send
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base     self.connect()
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\urllib3\connection.py", line 184, in connect
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base     conn = self._new_conn()
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\urllib3\connection.py", line 169, in _new_conn
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base     self, "Failed to establish a new connection: %s" % e
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x0000025DD7525668>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base 
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base During handling of the above exception, another exception occurred:
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base 
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base Traceback (most recent call last):
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\requests\adapters.py", line 449, in send
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base     timeout=timeout
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\urllib3\connectionpool.py", line 720, in urlopen
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base     method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\urllib3\util\retry.py", line 436, in increment
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base     raise MaxRetryError(_pool, url, error or ResponseError(cause))
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='198-90-245-0--24.maas-internal', port=5248): Max retries exceeded with url: /MAAS/metadata/2012-03-01/meta-data/ (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0000025DD7525668>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',))
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base 
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base During handling of the above exception, another exception occurred:
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base 
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base Traceback (most recent call last):
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\base.py", line 325, in _get_data
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base     response = self._http_request(path)
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\maasservice.py", line 108, in _http_request
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base     method)
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\base.py", line 318, in _http_request
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base     verify=self._verify_https_request())
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\requests\api.py", line 61, in request
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base     return session.request(method=method, url=url, **kwargs)
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\requests\sessions.py", line 530, in request
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base     resp = self.send(prep, **send_kwargs)
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\requests\sessions.py", line 643, in send
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base     r = adapter.send(request, **kwargs)
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\requests\adapters.py", line 516, in send
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base     raise ConnectionError(e, request=request)
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base requests.exceptions.ConnectionError: HTTPConnectionPool(host='198-90-245-0--24.maas-internal', port=5248): Max retries exceeded with url: /MAAS/metadata/2012-03-01/meta-data/ (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0000025DD7525668>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',))
2020-06-19 12:20:57.994 3788 ERROR cloudbaseinit.metadata.services.base 
2020-06-19 12:21:01.994 3788 DEBUG cloudbaseinit.metadata.services.maasservice [-] Getting authorization headers for http://198-90-245-0--24.maas-internal:5248/MAAS/metadata/2012-03-01/meta-data/. _get_oauth_headers C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\maasservice.py:89
2020-06-19 12:21:01.994 3788 DEBUG cloudbaseinit.metadata.services.base [-] Executing http request GET at http://198-90-245-0--24.maas-internal:5248/MAAS/metadata/2012-03-01/meta-data/ _http_request C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\base.py:315
2020-06-19 12:21:01.994 3788 DEBUG urllib3.connectionpool [-] Starting new HTTP connection (1): 198-90-245-0--24.maas-internal:5248 _new_conn C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\urllib3\connectionpool.py:225
2020-06-19 12:21:01.994 3788 ERROR cloudbaseinit.metadata.services.base [-] HTTPConnectionPool(host='198-90-245-0--24.maas-internal', port=5248): Max retries exceeded with url: /MAAS/metadata/2012-03-01/meta-data/ (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0000025DD75254A8>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',)): requests.exceptions.ConnectionError: HTTPConnectionPool(host='198-90-245-0--24.maas-internal', port=5248): Max retries exceeded with url: /MAAS/metadata/2012-03-01/meta-data/ (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0000025DD75254A8>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',))

I'm guessing that the errors in the log post-restart are a direct result of the pre-restart failure.

dacron commented 4 years ago

This issue only occurs when the IP mode of the MAAS hosts interface is set to auto assign. Setting to DHCP works fine. My understanding is that static network configuration is a feature of MAAS Cloudbase-init service.

ader1990 commented 4 years ago

@dacron can you provide some debug information for this issue, please?

From PowerShell:

get-service wmi*
get-service winrm

winrm id

& 'C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\\python.exe -m pip freeze'
ader1990 commented 4 years ago

@dacron Please use the latest installer (beta). The stable installer uses a component (PyMI 1.0.4 for setting networking which relies on winrm to work. This issue is fixed in PyMI and the newer PyMI version is used by the latest Cloudbase-Init installer: https://www.cloudbase.it/downloads/CloudbaseInitSetup_x64.msi

dacron commented 4 years ago

Here is the debug information:

PS C:\Windows\system32> Get-Service wmi*                                                                                                                                                                                                                                                                                                                                                                                                            
Status   Name               DisplayName
------   ----               -----------
Stopped  wmiApSrv           WMI Performance Adapter

PS C:\Windows\system32> Get-Service winrm                                                                                                                                                                                                                                                                                                                                                                                                           
Status   Name               DisplayName
------   ----               -----------
Running  winrm              Windows Remote Management (WS-Manag...

PS C:\Windows\system32> winrm id                                                                                                                                                                                                                                                                                                                                                                                                                    IdentifyResponse
    ProtocolVersion = http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd
    ProductVendor = Microsoft Corporation
    ProductVersion = OS: 10.0.18363 SP: 0.0 Stack: 3.0
    SecurityProfiles
        SecurityProfileName = http://schemas.dmtf.org/wbem/wsman/1/wsman/secprofile/http/basic, http://schemas.dmtf.org/wbem/wsman/1/wsman/secprofile/https/basic, http://schemas.dmtf.org/wbem/wsman/1/wsman/secprofile/https/mutual, http://schemas.dmtf.org/wbem/wsman/1/wsman/secprofile/http/spnego-kerberos, http://schemas.dmtf.org/wbem/wsman/1/wsman/secprofile/https/spnego-kerberos

PS C:\Windows\system32> & 'C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\python.exe' -m pip freeze                                                                                                                                                                                                                                                                                                                                     Babel==2.8.0
certifi==2020.4.5.1
chardet==3.0.4
cloudbase-init==1.1.1
comtypes==1.1.7
debtcollector==2.0.1
dnspython==1.15.0
eventlet==0.25.2
extras==1.0.0
fixtures==3.0.0
greenlet==0.4.15
idna==2.9
iso8601==0.1.12
Jinja2==2.11.1
linecache2==1.0.0
MarkupSafe==1.1.1
monotonic==1.5
msgpack==0.6.2
netaddr==0.7.19
netifaces==0.10.9
oauthlib==3.1.0
openstack-requirements==1.2.1.dev3425
oslo.config==8.0.2
oslo.context==3.0.2
oslo.i18n==4.0.1
oslo.log==4.1.1
oslo.serialization==3.1.1
oslo.utils==4.1.1
packaging==20.3
Parsley==1.3
pbr==5.4.5
PyMI==1.0.4
pyparsing==2.4.7
pyserial==3.4
python-dateutil==2.8.1
python-mimeparse==1.6.0
pytz==2019.3
pywin32==227
PyYAML==5.3.1
requests==2.23.0
rfc3986==1.4.0
six==1.14.0
stevedore==1.32.0
testtools==2.4.0
traceback2==1.4.0
tzlocal==2.0.0
unittest2==1.1.0
untangle==1.1.1
urllib3==1.25.8
WMI==1.4.9
wrapt==1.12.1

Just building a new image with the beta installer for testing.

ader1990 commented 4 years ago

@dacron I see that my assumptions were correct. Let me know if the beta installer works as expected.

dacron commented 4 years ago

@ader1990 1.1.2.dev5 does fix the issue. Any idea when it will hit stable?

alexpilotti commented 4 years ago

@dacron just release 1.1.2: https://github.com/cloudbase/cloudbase-init/releases/tag/1.1.2

Closing the issue based on your feedback, please feel free to reopen it if anything changes.

jshen28 commented 4 years ago

sadly 1.1.2 does not work for me, 1.1.0 works good though....

alexpilotti commented 4 years ago

@jshen28 can you please share the logs?

bryan-song-007 commented 3 years ago

Hello, I tried the latest version of cloudbase-init and try to inject IPV6 address, the same error has occured again? Could you guys provide any suggestions?

Appreciate...

KyleChan88 commented 2 years ago

sadly 1.1.2 does not work for me too, windows server 2012 r2