diff --git a/plugins/modules/floating_ip.py b/plugins/modules/floating_ip.py index fbfda7f1..77c976ed 100644 --- a/plugins/modules/floating_ip.py +++ b/plugins/modules/floating_ip.py @@ -368,8 +368,12 @@ class NetworkingFloatingIPModule(OpenStackModule): for ip in ips: if ip['fixed_ip_address']: # Silently ignore that ip might not be attached to server - self.conn.compute.remove_floating_ip_from_server( - self.server, ip['floating_ip_address']) + # + # self.conn.network.update_ip(ip_id, port_id=None) does not + # handle nova network but self.conn.detach_ip_from_server() + # does so + self.conn.detach_ip_from_server(server_id=self.server['id'], + floating_ip_id=ip['id']) # OpenStackSDK sets {"port_id": None} to detach a floating # ip from an instance, but there might be a delay until a diff --git a/plugins/modules/server.py b/plugins/modules/server.py index 127ce532..f058c922 100644 --- a/plugins/modules/server.py +++ b/plugins/modules/server.py @@ -1111,8 +1111,9 @@ class ServerModule(OpenStackModule): for ip in remove_ips: ip_id = self.conn.network.find_ip(name_or_id=ip, ignore_missing=False).id - # self.network.update_ip(ip_id, port_id=None) would not handle - # nova network which self.conn.detach_ip_from_server() does + # self.conn.network.update_ip(ip_id, port_id=None) does not + # handle nova network but self.conn.detach_ip_from_server() + # does so self.conn.detach_ip_from_server(server_id=server.id, floating_ip_id=ip_id) return server