Ask Your Question
0

Where's the code of adding port to OVS when creating vm?

asked 2013-04-26 12:21:38 -0500

ENV: ubuntu 12.04, devstack with quantum, single node

I'm looking for the add-port code which should be called when I create vm on web UI.

I set pdb.set_trace in almost any possible code(like add_port, create_port etc.) but I couldn't find the one that add the port to OpenvSwitch.

The architecture says the agent adds the port to ovs, but I killed the agent and the ovs port could be added as before.

And then I killed dhcp/l3/agent threads, left quantum-server only. But the ovs port could be added on the web(while created vm) as before???? And it assigned the ip as before.. The behaviour of the thread was very confusing.

So what's the code that adds the port to ovs?

edit retag flag offensive close merge delete

7 answers

Sort by ยป oldest newest most voted
0

answered 2013-04-26 13:06:05 -0500

what...? r u saying that quantum doesn't do the add-port operation itself? FML.. i debug the quantum and read quantum's all code for 3 days....

But why quantum add port to ovs when init the bridge? And is the class OVSInterfaceDriver useless when adding a port?

Thanks a lot!

edit flag offensive delete link more
0

answered 2013-04-26 13:24:20 -0500

OVSInterfaceDriver and similar drivers are used by dhcp/l3 agents that to do similar things as nova vif drivers.

edit flag offensive delete link more
0

answered 2013-04-26 14:11:52 -0500

@Eugene Nikanorov (enikanorov) As I mentioned before, the dhcp service still works even after dhcp-agent is killed. Is nova-progress a alternative scheme? Could u plz show me a sequence chart? @Yong sheng gong (gongysh) Many thanks! now i understand why nova do it instead of quantum.

edit flag offensive delete link more
0

answered 2013-04-26 13:41:04 -0500

gongysh gravatar image

vif add port into br-int because the kvm needs them to bring up VM.

then the ovs-agent will config the vlan tag or something.

edit flag offensive delete link more
0

answered 2013-04-26 14:37:37 -0500

Thanks Eugene Nikanorov, that solved my question.

edit flag offensive delete link more
0

answered 2013-04-26 12:37:15 -0500

If you're talking about nova, look at nova/virt/libvift/vif.py There is a code responsible for creating a port for different L2 implementations (ovs, linuxbridge)

edit flag offensive delete link more
0

answered 2013-04-26 14:30:27 -0500

dhcp server for a tenant is dnsmasq process running on the host within a tenant network and is managed by dhcp agent. If you kill dhcp agent it won't cause automatic shutdown of dnsmasq.

By saying that OVSInterfaceDriver acts similarly as nova's ovs vif driver I meant that they both create ovs ports and attach interfaces to these ports

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2013-04-26 12:21:38 -0500

Seen: 39 times

Last updated: Apr 26 '13