Ask Your Question
0

Neutron Port Create

asked 2014-01-08 05:06:20 -0500

akilesh1597 gravatar image

I see that neutron port-create does not create a port on openvswith. Instead it only creates it in db. I would like to know what has to be done to really create a ovs port. I want a service to bind to the port I created. Below is my guess of how to solve the problem.

Correct me If I am wrong.

  1. Use Neutron port create to get mac address and fixed ip of the device
  2. Create a tap device with the mac address and assign the fixed ip to it
  3. Add the tap device to openvswitch using ovs-vsctl add-port
  4. Bind my program to the port and proceed.

If any one got any suggestion for better strategy please do let me know.

edit retag flag offensive close merge delete

4 answers

Sort by ยป oldest newest most voted
0

answered 2014-01-12 12:38:01 -0500

akilesh1597 gravatar image

Thanks Salvatore Orlando, that solved my question.

edit flag offensive delete link more
0

answered 2014-01-12 08:15:55 -0500

salvatore-orlando gravatar image

This question has probably been answered here as well: http://www.gossamer-threads.com/lists/openstack/dev/34719 (http://www.gossamer-threads.com/lists...)

edit flag offensive delete link more
0

answered 2014-01-09 02:15:54 -0500

gongysh gravatar image
def _ovs_add_port(self, bridge, device_name, port_id, mac_address,
                  internal=True):
    cmd = ['ovs-vsctl', '--', '--may-exist',
           'add-port', bridge, device_name]
    if internal:
        cmd += ['--', 'set', 'Interface', device_name, 'type=internal']
    cmd += ['--', 'set', 'Interface', device_name,
            'external-ids:iface-id=%s' % port_id,
            '--', 'set', 'Interface', device_name,
            'external-ids:iface-status=active',
            '--', 'set', 'Interface', device_name,
            'external-ids:attached-mac=%s' % mac_address]
    utils.execute(cmd, self.root_helper)
edit flag offensive delete link more
0

answered 2014-01-08 07:21:30 -0500

Check out agent/linux/interface.py. The drivers defined here implement plug/unplug operation which do what you are trying to achieve.

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: 2014-01-08 05:06:20 -0500

Seen: 1,476 times

Last updated: Jan 12 '14