April 2018
Intermediate to advanced
280 pages
8h 37m
English
As discussed, a floating IP address can be allocated to the VM by explicitly specifying the IP address from the pool of floating IP addresses available. The function add_floating_ip_to_server() accepts the VM instance ID, floating IP address to be assigned, and the optional fixed IP address as its parameters. The fixed_address can be set to None:
def add_floating_ip(conn): server_id="7cdaa375-f1b5-40ab-81bd-7e3d052f370d" conn.compute.add_floating_ip_to_server(server_id,"172.24.4.10",fixed_address=None)