From Fedora Project Wiki

Description

Deploy the Quantum virtual network service and configure Nova to use QuantumManager as its NetworkManager.

Quantum includes several plugins. The linuxbridge and openvswitch plugins are covered here. Feel free to experiment with the cisco, nicira, and/or ryu plugins as well, but note that deploying these requires additional software or hardware.

For clarity, these instructions assume a single node acts as the controller and compute node. They also assume that nova and mysql-server have already been installed and configured as described in the main test cases.

If using multiple compute nodes, all compute nodes will need to be connected via a network interface and switch with VLAN trunking enabled. Non-controller compute nodes require installation and configuration of the linuxbridge or openvswitch agent along with nova-compute, but do not require the quantum-server to be run or database to be configured.

Setup

Install openstack-quantum:

$> sudo yum install --enablerepo=updates-testing openstack-quantum

If running on Fedora 17, until an updated RPM is available, as root edit /usr/lib/python2.7/site-packages/quantum-2012.1-py2.7.egg-info/requires.txt and change "lxml==2.3" to "lxml>=2.3".


Create the database user that will be used by either the linuxbridge or openvswitch plugin:

$> mysql -u root -p -e "create user 'quantum'@'%' identified by 'quantum'"
$> mysql -u root -p -e "create user 'quantum'@'localhost' identified by 'quantum'"


Both the linuxbridge and openvswitch plugins use qemu's "ethernet" network device, so to work around the problem described in https://bugzilla.redhat.com/show_bug.cgi?id=770020, do the following:

$> sudo systemctl stop libvirtd.service
$> cat >> /etc/libvirt/qemu.conf <<EOF
cgroup_device_acl = [
   "/dev/null", "/dev/full", "/dev/zero",
   "/dev/random", "/dev/urandom",
   "/dev/ptmx", "/dev/kvm", "/dev/kqemu",
   "/dev/rtc", "/dev/hpet", "/dev/net/tun",
]
EOF
$> sudo systemctl start libvirtd.service


If using the openvswitch plugin, skip down to "Continue here to setup with the openvswitch plugin" below. If using the linuxbridge plugin, continue with the following instructions.


Install the linuxbridge plugin:

$> sudo yum install --enablerepo=updates-testing openstack-quantum-linuxbridge


Configure quantum-server to use the linuxbridge plugin and create its database:

$> sudo openstack-config-set /etc/quantum/plugins.ini PLUGIN provider quantum.plugins.linuxbridge.LinuxBridgePlugin.LinuxBridgePlugin
$> mysql -u root -p -e "create database quantum_linux_bridge"
$> mysql -u root -p -e "grant all on quantum_linux_bridge.* to 'quantum'@'%'"
$> mysql -u root -p -e "grant all on quantum_linux_bridge.* to 'quantum'@'localhost'"


Configure the linuxbridge plugin and agent:

$> sudo openstack-config-set /etc/quantum/plugins/linuxbridge/linuxbridge_conf.ini DATABASE connection mysql
$> sudo openstack-config-set /etc/quantum/plugins/linuxbridge/linuxbridge_conf.ini DATABASE user quantum
$> sudo openstack-config-set /etc/quantum/plugins/linuxbridge/linuxbridge_conf.ini DATABASE pass quantum
$> sudo openstack-config-set /etc/quantum/plugins/linuxbridge/linuxbridge_conf.ini DATABASE host hostname
$> sudo openstack-config-set /etc/quantum/plugins/linuxbridge/linuxbridge_conf.ini LINUX_BRIDGE physical_interface eth0

In the step above, be sure to set physical_interface to the node's external interface, which must support VLAN trunking if using multiple compute nodes.


Enable and start the quantum-server and quantum-linuxbridge-agent daemons:

$> sudo systemctl enable quantum-server.service
$> sudo systemctl start quantum-server.service
$> sudo systemctl enable quantum-linuxbridge-agent.service
$> sudo systemctl start quantum-linuxbridge-agent.service


Finally, configure nova to use QuantumManager as its NetworkManager and to use the proper drivers:

$> sudo openstack-config-set /etc/nova/nova.conf DEFAULT network_manager nova.network.quantum.manager.QuantumManager
$> sudo openstack-config-set /etc/nova/nova.conf DEFAULT libvirt_vif_type ethernet
$> sudo openstack-config-set /etc/nova/nova.conf DEFAULT libvirt_vif_driver nova.virt.libvirt.vif.QuantumLinuxBridgeVIFDriver
$> sudo openstack-config-set /etc/nova/nova.conf DEFAULT linuxnet_interface_driver nova.network.linux_net.QuantumLinuxBridgeInterfaceDriver
$> sudo openstack-config-set /etc/nova/nova.conf DEFAULT quantum_use_dhcp True


You are done setting up quantum with the linuxbridge plugin!


Continue here to setup quantum with the openvswitch plugin.

Install the openvswitch plugin:

$> sudo yum install --enablerepo=updates-testing openstack-quantum-openvswitch


Configure openvswitch and create the integration bridge:

$> sudo yum install --enablerepo=updates-testing openvswitch [Note - will become dependency of openstack-quantum-openvswitch]
$> sudo systemctl enable openvswitch.service
$> sudo systemctl start openvswitch.service
$> sudo ovs-vsctl add-br br-int


Configure quantum-server to use the openvswitch plugin and create its database:

$> sudo openstack-config-set /etc/quantum/plugins.ini PLUGIN provider quantum.plugins.openvswitch.ovs_quantum_plugin.OVSQuantumPlugin
$> mysql -u root -p -e "create database ovs_quantum"
$> mysql -u root -p -e "grant all on ovs_quantum.* to 'quantum'@'%'"
$> mysql -u root -p -e "grant all on ovs_quantum.* to 'quantum'@'localhost'"


Configure the openvswitch plugin and agent:

$> sudo openstack-config-set /etc/quantum/plugins/openvswitch/ovs_quantum_plugin.ini DATABASE sql_connection mysql://quantum:quantum@hostname/ovs_quantum


Enable and start the quantum-server and quantum-openvswitch-agent daemons:

$> sudo systemctl enable quantum-server.service
$> sudo systemctl start quantum-server.service
$> sudo systemctl enable quantum-openvswitch-agent.service
$> sudo systemctl start quantum-openvswitch-agent.service


Finally, configure nova to use QuantumManager as its NetworkManager and to use the proper drivers:

$> sudo openstack-config-set /etc/nova/nova.conf DEFAULT network_manager nova.network.quantum.manager.QuantumManager
$> sudo openstack-config-set /etc/nova/nova.conf DEFAULT libvirt_vif_type ethernet
$> sudo openstack-config-set /etc/nova/nova.conf DEFAULT libvirt_vif_driver nova.virt.libvirt.vif.LibvirtOpenVswitchDriver
$> sudo openstack-config-set /etc/nova/nova.conf DEFAULT linuxnet_interface_driver nova.network.linux_net.LinuxOVSInterfaceDriver
$> sudo openstack-config-set /etc/nova/nova.conf DEFAULT quantum_use_dhcp True 

How to test

First, with the quantum server and any agents it needs all running, sanity test the configuration using the command line interface:

$> quantum list_nets fake_tennant1
$> quantum create_net fake_tennant1 fake_net1
$> quantum list_nets fake_tennant1
$> quantum list_ports fake_tennant1 <net-UUID>
$> quantum create_port fake_tennant1 <net-UUID>
$> quantum list_ports fake_tennant1 <net-UUID>
$> quantum show_port fake_tennant1 <net-UUID> <port-UUID>

Check /var/log/messages and /var/log/quantum/server.log for errors, but note that many warnings in server.log are expected.


Finally, start the nova services, and create an instance.

Expected Results

TBD