enabling nova VIF driver operation in a quantum plugin

Asked by Prashanth Prahalad

Hi Folks,

Trying to see what's the right way to accomplish this. I'm prototyping a quantum plugin and for some of the operations, it is a pass-through to the nova VIF driver. For example, for create_port operation, I want the nova driver to assign the IP address to the VM.

This is what the create_port in my plugin looks like :

    def create_port(self, context, port):
        return super(MyQuantumPluginV2, self).create_port(context, port)

I use this command to create a VM
nova boot --image image_name --flavor m1.tiny --nic net-id=12be9b0f-a97a-4ab1-8307-d7cc5cd8564c --key-name test my_server

When the VM comes up, it has the virtual interface plumbed in, but the IP address is not assigned.

I can see in the log that an IP address was assigned to the port :

('create port completed {} {}', {'status': 'ACTIVE', 'device_owner': u'compute:None', 'name': '', 'mac_address': 'fa:16:3e:2d:33:92', 'network_id': u'12be9b0f-a97a-4ab1-8307-d7cc5cd8564c', 'tenant_id': u'61ab6bf71f644419bcfdeb8528cb3f5c', 'admin_state_up': True, 'fixed_ips': [{'subnet_id': u'9de0b387-576c-4898-a472-319b39a0e7b0', 'ip_address': u'30.0.0.6'}], 'id': '25c02aa6-7f21-4399-9ae6-41520dd97a8f', 'device_id': u'a664d6e9-6975-4b5d-b7af-1b81b2f67296'}, [{'subnet_id': u'9de0b387-576c-4898-a472-319b39a0e7b0', 'ip_address': u'30.0.0.6'}])

I probably am missing something here, any thoughts ?

Thanks !

If it helps, here's quantum.conf

[DEFAULT]
auth_strategy = keystone
allow_overlapping_ips = False
state_path = /opt/stack/data/quantum
debug = True
verbose = True
service_plugins = quantum.plugins.services.agent_loadbalancer.plugin.LoadBalancerPlugin
core_plugin = quantum.plugins.my_quantum_plugin.MyQuantumPluginV2
rabbit_password = openstack
rabbit_host = localhost
rpc_backend = quantum.openstack.common.rpc.impl_kombu
bind_host = 0.0.0.0
bind_port = 9696
api_paste_config = api-paste.ini
control_exchange = quantum
notification_driver = quantum.openstack.common.notifier.rpc_notifier
default_notification_level = INFO
notification_topics = notifications
[QUOTAS]
[DEFAULT_SERVICETYPE]
[AGENT]
root_helper = sudo /usr/local/bin/quantum-rootwrap /etc/quantum/rootwrap.conf
[keystone_authtoken]
auth_host = 10.9.12.20
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = quantum
admin_password = openstack
signing_dir = /var/cache/quantum

[DEFAULT]
l3_agent_manager = quantum.agent.l3_agent.L3NATAgentWithStateReport
external_network_bridge = br-ex
signing_dir = /var/cache/quantum
admin_password = openstack
admin_user = quantum
admin_tenant_name = service
auth_url = http://10.9.12.20:35357/v2.0
root_helper = sudo /usr/local/bin/quantum-rootwrap /etc/quantum/rootwrap.conf
use_namespaces = True
debug = True
verbose = True
# Show debugging output in log (sets DEBUG log level output)
# debug = True

# L3 requires that an interface driver be set. Choose the one that best
# matches your plugin.
# OVS based plugins (OVS, Ryu, NEC) that supports L3 agent
interface_driver = quantum.agent.linux.interface.OVSInterfaceDriver

Question information

Language:
English Edit question
Status:
Answered
For:
neutron Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Eugene Nikanorov (enikanorov) said :
#1

From within the VM IP address is received via DHCP protocol.
E.g. dhcp server knows which ip address to assign to the certain mac address, because port creation modifies subnet's dhcp server config.
So once VM is up, it sends dhcp requests and eventually receives response and assigns ip address to the interface.

Revision history for this message
Prashanth Prahalad (prashanth-prahal) said :
#2

Thanks Eugene..

Can you help with this problem?

Provide an answer of your own, or ask Prashanth Prahalad for more information if necessary.

To post a message you must log in.