Ask Your Question

How to assign a floating IP using Openstack Python SDK and nova network?

asked 2016-02-14 17:22:35 -0600

Bart gravatar image

updated 2016-02-15 05:04:44 -0600

smaffulli gravatar image

Hi, I have been trying my hand at the OpenstackPythonSDK and could create an instance on a running Openstack deployment. This deployment only has nova-networking, no Neutron as this adds complexity that I do not need. Is there a way for me to assign a floating IP from the nova-network to my instance through the SDK or through an API? Thanks, Bart

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2016-02-15 06:29:43 -0600

dbaxps gravatar image

You can try this ( actually tested with Neutron )

#!/usr/bin/env python
import os
import time
from novaclient.v2.client import Client
from credentials import get_nova_creds

# Assign floating IP for active instance

creds = get_nova_creds()
nova = Client(**creds)
floating_ip = nova.floating_ips.create(nova.floating_ip_pools.list()[0].name)
instance = nova.servers.find(name="Ubuntu1510Devs")
edit flag offensive delete link more


Hi - thx for your quick answer - it has sent me along the right direction to get this working. I have changed my code to only rely on the Python nova-client, no ton the OpenstackPythonSDK. Regards, Bart.

Bart gravatar imageBart ( 2016-02-15 17:05:53 -0600 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2016-02-14 17:22:35 -0600

Seen: 1,606 times

Last updated: Feb 15 '16