Assign a floating openstack IP address, making sure that it will not be deleted from another server

(I use openstack4j to talk to OpenStack via the REST API)

I would like to reuse some unassigned floating IPs allocated in my tenant (assign to newly prepared servers). However, it seems that the action addFloatingIphas nothing to do with assigning an unused floating IP address and reassigning it from server to server.

I would like to automate the process, but I'm afraid of the following race condition: one client checks for a specific IP address, and before it can connect it to server A, another client will connect it to server B. From the point of view, the second client associated with The floating IP address can be deleted at any subsequent time after a successful connection.

Is there a better way?

+4
source share
2 answers

The issues addressed relate to the use (currently not recommended) of the /os-floating-ipsCompute floating IP extension , which divides the floating IP distribution into two phases: distribution ( /os-floating-ipspoint /os-floating-ips) and destination ( addFloatingIpserver addFloatingIp).

IP- Neutron, IP- ( POST /v2.0/floatingips). , , , , , IP-, , , . , IP-, IP- .

0

:

  • IP-. , . IP-, , . API. , , , , - . . -, , , . Openstack Heat ( ) . CLI .
  • -, . : etcd, (SQL ) , , , (, OpenStack Zaqar ).
  • : , , , , , , . , . ip, . , , , . , , , , , , .

API OpenStack , . . , , API, kubernetes (resourceVersion ObjectMeta) etcd (modifiedIndex v2, mod_revision v3) .

API, , , , , , , , , , , , .

+1

All Articles