April 2018
Intermediate to advanced
280 pages
8h 37m
English
A fixed or private IP address can be allocated to a VM by associating that VM to a private network. We need a network ID and the server ID to be passed to the add_fixed_ip_to_server() function, which assigns the private IP address to the VM:
def add_fixed_ip(conn): server_id="7cdaa375-f1b5-40ab-81bd-7e3d052f370d" network_id="60bf3c33-dc83-4251-8024-f2781e34321d" conn.compute.add_fixed_ip_to_server(server_id,network_id)