File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
dask_cloudprovider/openstack Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -116,11 +116,20 @@ async def create_and_assign_floating_ip(self, conn):
116116 floating_network_id = self .config ["external_network_id" ],
117117 )
118118
119- # Assign the floating IP to the server
119+ # Find the first port of the instance
120+ ports = await self .cluster .call_async (
121+ conn .network .ports ,
122+ device_id = self .instance .id
123+ )
124+ ports = list (ports )
125+ if not ports :
126+ raise RuntimeError (f"No network ports found for instance { self .instance .id } " )
127+
128+ # Assign the floating IP to the instance's port
120129 await self .cluster .call_async (
121- conn .compute . add_floating_ip_to_server ,
122- server = self . instance . id ,
123- address = floating_ip . floating_ip_address ,
130+ conn .network . update_ip ,
131+ floating_ip ,
132+ port_id = ports [ 0 ]. id
124133 )
125134
126135 return floating_ip .floating_ip_address
You can’t perform that action at this time.
0 commit comments