I have a question regarding using the compute "action" API to assign a
floating IP to a server
Using the API call below [1],  I am able to successfully assign a
floating IP to a server, even if the floating IP is already assigned
to another server.  My question is, is there a way or an equivalent
API that will fail if the floating IP is already assigned to another

My use-case is that I have a couple processes running in parallel,
each provisioning instances with floating ips.  They often end up
querying for the list of available floating ips around the same time,
and request the same floating ip to be assigned to different
servers... both succeed, and last one "wins".  I'd like to find an API
call that will fail instead of reassign, so I can avoid implementing
some sort of inter-process synchronization on the client side.  Any
pointers appreciated.


[1] $ curl -s -v -X POST -d @addfloatingip.json -H "Content-type:
application/json" -H "X-Auth-Token: $OS_TOKEN"

where addfloatingip.json:
    "addFloatingIp": {
        "address": "[ip-address]"

where "ip-address" is a floating ip already assigned to another instance.

Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Post to     : openstack@lists.openstack.org
Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack

Reply via email to