cloudbase / cloudbase-init

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

Network config plugin can fail if the IP address was already set #54

Open ader1990 opened 4 years ago

ader1990 commented 4 years ago

After deleting an IP address using PyMI (example here: https://github.com/cloudbase/cloudbase-init/blob/5c3979e1ae2a7f0f73b6538d3d37fbc51d6cfda0/cloudbaseinit/osutils/windows.py#L981), verification and a retry/wait usage are needed to make sure the IP address has been removed.

Without the check, the IP address creation can fail with the error MSFT_NetIPAddress already exists at line https://github.com/cloudbase/cloudbase-init/blob/5c3979e1ae2a7f0f73b6538d3d37fbc51d6cfda0/cloudbaseinit/osutils/windows.py#L992