Floating IPs

# list all floating IPs
openstack floating ip list
openstack floating ip show
openstack floating ip list --project ${PROJECT_ID} --long
# Allocate floating IP
openstack floating ip create public 
# Allocate specific floating IP for a project (as cloud admin)
openstack floating ip create public --floating-ip-address --project foo-project
FLOATING_IP=$(openstack floating ip create public -c floating_ip_address -f value --floating-ip-address
# Associate floating IP to instance
openstack server add floating ip ${INSTANCE_NAME_OR_ID} ${FLOATING_IP}
# Disassociate floating IP
openstack server remove floating ip ${INSTANCE_NAME_OR_ID} ${FLOATING_IP}
# Release floating IP
openstack floating ip delete ${FLOATING_IP}
# show used floating IPs
NETWORK_ID=$(openstack subnet list --network public -c Network -f value)
openstack ip availability show -c total_ips -c used_ips ${NETWORK_ID}
# Add floating IP to port
openstack floating ip set --port ${PORT_ID} ${FLOATING_IP}