Update Quantum demo examples

Change-Id: I2a1a38d2b325fb92d0fc93ba422bb304b250b9e0
This commit is contained in:
Gary Kotton 2012-09-24 10:08:04 +00:00
parent 60630ed879
commit 22dc011e91
3 changed files with 434 additions and 90 deletions
doc/src/docbkx/openstack-network-connectivity-admin

@ -34,171 +34,515 @@ format="PNG" />
</imageobject>
</inlinemediaobject>'>
]>
<appendix xmlns="http://docbook.org/ns/docbook"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0"
xml:id="app_demo">
<appendix xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0" xml:id="app_demo">
<title>Demo Setup</title>
<para>This section describes how to install the Quantum service
and its components. The demo assumes the following:</para>
<para>OpenStack Service Node:</para>
and its components for the "<link
linkend="use_cases_single_router">Use Case: Provider
Router with Private Networks</link>". The demo assumes the
following:</para>
<para><emphasis role="bold">OpenStack Service Node</emphasis></para>
<orderedlist>
<listitem>
<para>Relevant Nova services are installed and
configured</para>
<para>Relevant Nova services are installed, configured and
running.</para>
</listitem>
<listitem>
<para>Glance is installed and the image
cirros-0.3.0-x86_64-uec exists. This will be used in
the examples.</para>
<para>Glance is installed, configured and running. In
addition to this there should be an image.</para>
</listitem>
<listitem>
<para>Keystone installed and running</para>
<para>Keystone is installed, configured and running. A
quantum user <emphasis role="bold">quantum</emphasis>
should be created on tenant <emphasis role="bold"
>servicetenant</emphasis> with password <emphasis
role="bold">servicepassword</emphasis>.</para>
</listitem>
<listitem>
<para>Additional services <itemizedlist>
<listitem>
<para>RabbitMQ (password is rpwd)</para>
<para>RabbitMQ (password is <emphasis
role="bold"
>openstack</emphasis>)</para>
</listitem>
<listitem>
<para>MySql server (user is muser and password
is mpwd)</para>
<para>MySQL server (user is <emphasis
role="bold">quantum</emphasis> and
password is <emphasis role="bold"
>openstack</emphasis>)</para>
</listitem>
</itemizedlist>
</para>
</itemizedlist></para>
</listitem>
</orderedlist>
<para>Compute Nodes</para>
<para><emphasis role="bold">Compute Nodes</emphasis></para>
<orderedlist>
<listitem>
<para>Nova compute is installed and configured</para>
</listitem>
</orderedlist>
<para>The diagram (<link
xlink:href="https://docs.google.com/drawings/d/1E_UTCAS22EDHecL5LunLKCzlcqyk-tsWLrAEZTKyz1I/edit"
>https://docs.google.com/drawings/d/1E_UTCAS22EDHecL5LunLKCzlcqyk-tsWLrAEZTKyz1I/edit</link>)
below shows the setup. The example uses the OpenvSwitch plugin
and agents (you can tweak the configurationsto use the Linux
Bridge plugin and agents).</para>
<para>The diagram below shows the setup. For simplicity all of the
nodes should have one interface for management traffic and one
or more interfaces for traffic to and from VMs. The management
network is 100.1.1.0/24. The example uses the Open vSwitch
plugin and agents.</para>
<para><emphasis role="bold">Note</emphasis> the setup can be tweaked to make use of another
supported plugin and its agents.</para>
<mediaobject>
<imageobject role="fo">
<imagedata
fileref="figures/0clip_image002_-1344673767.gif"
contentwidth="4in"/>
<imagedata fileref="figures/demo_install.png"
scale="80" role="html"/>
</imageobject>
</mediaobject>
<para>There will be three components to the setup.<table
rules="all">
<caption>Components for Demo</caption>
<para>There will be three nodes in the setup.<table rules="all">
<caption>Nodes for Demo</caption>
<thead>
<tr>
<th>Component</th>
<th>Node</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>OpenStack Services </td>
<td>OpenStack Controller Node</td>
<td>Runs the Quantum service, Keystone and all of
the Nova service that are required to deploy a
VM. The service must have at least one network
interface. This will be used to communicate
with the compute nodes. </td>
</tr>
<tr>
<td>Compute Node </td>
<td>Runs Nova compute, Quantum L2 agent and the
DHCP agent. This node will not have access the
public network. The DHCP agent will allocate
IP addresses to the VMs on the network. The
node must have at least one network interface.
</td>
the Nova services that are required to deploy
a VM. The service must have at least one
network interface, this should be connected to
the "Management Network". The IP address of
the interface should be configured as
100.1.1.10/24. This will be used to
communicate with the compute and network
nodes. <emphasis role="bold">Note</emphasis>
nova-network should not be running. This is
replaced by Quantum.</td>
</tr>
<tr>
<td>Compute Node </td>
<td>Runs Nova compute, Quantum L2 agent and the L3
agent. This node will have access the public
network. The L3 agent will perform NAT and
enable the VMs to access the public network.
The node must have at least two network
interfaces. </td>
<td>Compute Node</td>
<td>Runs Nova compute and the Quantum L2 agent.
This node will not have access the public
network. The node must have at least two
network interfaces. The first is used to
communicate with the controller node, via the
management network. The IP address of this
interface should be configured to
100.1.1.11/24. The second interface will be
used for the VM traffic, this is via the Data
network. The VM will be able to receive its IP
address from the DHCP agent on this
network.</td>
</tr>
<tr>
<td>Network Node</td>
<td>Runs Quantum L2 agent, the DHCP agent and the
L3 agent. This node will have access the
public network. The DHCP agent will allocate
IP addresses to the VMs on the network. The L3
agent will perform NAT and enable the VMs to
access the public network. The node must have
at least three network interfaces. The first
is used to communicate with the controller
node, this is via the management network. The
IP address of this interface should be
configured to 100.1.1.12/24. The second
interface will be used for the VM traffic,
this is on the data network. The third
interface will be used to connect to the
external gateway on the network. This
interface will be bridged to the Open vSwitch
bridge "br-ex" interface.</td>
</tr>
</tbody>
</table></para>
<section xml:id="demo_install">
<section xml:id="demo_installions">
<title>Installations</title>
<para><itemizedlist>
<para>
<itemizedlist>
<listitem>
<para>Quantum Service <orderedlist>
<para><emphasis role="bold">Quantum Service</emphasis><orderedlist>
<listitem>
<para>Install the Quantum
service.</para>
<para>Install the Quantum service.</para>
</listitem>
<listitem>
<para>Create plugin database
<filename>ovs_quantum</filename>.
See the section on the Quantum
service for the exact details.
Create user
<literal>muser</literal> with
password
<literal>mpwd</literal>.</para>
<para>Create plugin database <emphasis
role="bold">ovs_quantum</emphasis>.
See the section on the <link
linkend="core_plugins">Core
Plugins</link> for the exact
details. Create user <emphasis
role="bold">quantum</emphasis> with
password <emphasis role="bold"
>openstack</emphasis>.</para>
</listitem>
<listitem>
<para>Update the Quantum configuration
file,
<filename>/etc/quantum/quantum.conf</filename>:</para>
<screen><computeroutput>core_plugin=quantum.plugins.openvswitch.ovs_quantum_plugin.OVSQuantumPluginV2
rabbit_password = openstack
rabbit_host = localhost</computeroutput></screen>
file, <emphasis role="bold"
>/etc/quantum/quantum.conf</emphasis>:</para>
<screen><computeroutput>[DEFAULT]
core_plugin=quantum.plugins.openvswitch.ovs_quantum_plugin.OVSQuantumPluginV2
rabbit_password = openstack</computeroutput></screen>
</listitem>
<listitem>
<para>Update the plugin configuration
file,
<filename>/etc/quantum/plugins/openvswitch/ovs_quantum_plugin.ini</filename>:</para>
<screen><computeroutput>sql_connection=mysql://muser:mpwd@localhost/ovs_quantum?charset=utf8
[TBD provider nets]</computeroutput></screen>
file, <emphasis role="bold"
>/etc/quantum/plugins/openvswitch/ovs_quantum_plugin.ini</emphasis>:</para>
<screen><computeroutput>[DATABASE]
sql_connection=mysql://quantum:openstack@localhost/ovs_quantum?charset=utf8
[OVS]
tenant_network_type=vlan
network_vlan_ranges = physnet1:1:4094</computeroutput></screen>
</listitem>
<listitem>
<para>Update the api-paste
configuration file to include the
keystone user, <emphasis
role="bold"
>/etc/quantum/api-paste.ini</emphasis>:</para>
<screen><computeroutput>[filter:authtoken]
admin_tenant_name=servicetenant
admin_user=quantum
admin_password=servicepassword</computeroutput></screen>
</listitem>
<listitem>
<para>Start the Quantum service</para>
</listitem>
</orderedlist></para>
</listitem>
<listitem>
<para>Compute Nodes - L2 Agent <orderedlist>
<para><emphasis role="bold">Compute Nodes - L2 Agent</emphasis><orderedlist>
<listitem>
<para>Install the the L2 agent.</para>
<para>Install the L2 agent.</para>
</listitem>
<listitem>
<para>Add the integration bridge to the Open vSwitch:</para>
<screen><computeroutput>sudo ovs-vsctl add-br br-int</computeroutput></screen>
</listitem>
<listitem>
<para>Update the Quantum configuration
file,
<filename>/etc/quantum/quantum.conf</filename>:</para>
file, <emphasis role="bold"
>/etc/quantum/quantum.conf</emphasis>:</para>
<screen><computeroutput>rabbit_password = openstack
rabbit_host = 100.1.1.10</computeroutput></screen>
</listitem>
<listitem>
<para>Update the plugin configuration
file. </para>
<para>[TBD provider nets]</para>
file, <emphasis role="bold"
>/etc/quantum/plugins/openvswitch/ovs_quantum_plugin.ini</emphasis>:</para>
<screen><computeroutput>[OVS]
tenant_network_type=vlan
network_vlan_ranges = physnet1:1:4094
bridge_mappings = physnet1:br-eth1</computeroutput></screen>
</listitem>
<listitem>
<para>Start the Quantum L2
agent</para>
<para>Create the network bridge
<emphasis role="bold"
>br-eth1</emphasis> (All VM
communication between the nodes
will be done via eth1):</para>
<screen><computeroutput>sudo ovs-vsctl add-br br-eth1
sudo ovs-vsctl add-port br-eth1 eth1</computeroutput></screen>
</listitem>
<listitem>
<para>Update the nova configuration
file, <emphasis role="bold"
>/etc/nova/nova.conf</emphasis>:</para>
<screen><computeroutput>[DEFAULT]
network_api_class=nova.network.quantumv2.api.API
quantum_admin_username=quantum
quantum_admin_password=servicepassword
quantum_admin_auth_url=http://100.1.1.10:35357/v2.0/
quantum_auth_strategy=keystone
quantum_admin_tenant_name=servicetenant
quantum_url=http://100.1.1.10:9696/
libvirt_vif_driver=nova.virt.libvirt.vif.LibvirtHybridOVSBridgeDriver</computeroutput></screen>
</listitem>
<listitem>
<para>Restart the nova service</para>
</listitem>
<listitem>
<para>Start the Quantum L2 agent</para>
</listitem>
</orderedlist></para>
</listitem>
<listitem>
<para><emphasis role="bold">Compute Node A - DHCP Agent</emphasis><orderedlist>
<listitem>
<para>Install the DHCP agent.</para>
</listitem>
<listitem>
<para>Update the Quantum configuration
file, <emphasis role="bold"
>/etc/quantum/quantum.conf</emphasis>:</para>
<screen><computeroutput>rabbit_password = openstack
rabbit_host = 100.1.1.10</computeroutput></screen>
</listitem>
<listitem>
<para>Update the DHCP configuration
file, , <emphasis role="bold"
>/etc/quantum/dhcp_agent.ini</emphasis>:</para>
<screen><computeroutput>interface_driver = quantum.agent.linux.interface.OVSInterfaceDriver</computeroutput></screen>
</listitem>
<listitem>
<para>Start the DHCP agent</para>
</listitem>
</orderedlist></para>
</listitem>
<listitem>
<para><emphasis role="bold">Compute Node B - L3 Agent</emphasis><orderedlist>
<listitem>
<para>Install the L3 agent.</para>
</listitem>
<listitem>
<para>Add the external network bridge to the Open vSwitch:</para>
<screen><computeroutput>sudo ovs-vsctl add-br br-ex</computeroutput></screen>
</listitem>
<listitem>
<para>Add the physical interface, for example eth2, that is
connected to the outside network to this bridge:</para>
<screen><computeroutput>sudo ovs-vsctl add-port br-ex eth2</computeroutput></screen>
</listitem>
<listitem>
<para>Update the L3 configuration
file, <emphasis role="bold"
>/etc/quantum/l3_agent.ini</emphasis>:</para>
<screen><computeroutput>[DEFAULT]
auth_url=http://100.1.1.10:35357/v2.0/
admin_user=quantum
admin_password=servicepassword
admin_tenant_name=servicetenant
interface_driver=quantum.agent.linux.interface.OVSInterfaceDriver</computeroutput></screen>
</listitem>
<listitem>
<para>Start the L3 agent</para>
</listitem>
</orderedlist></para>
</listitem>
</itemizedlist>
</para>
</section>
<section xml:id="demo_logical_network_config">
<title>Logical Network Configuration</title>
<para>All of the commands below can be done on the service node.</para>
<para><emphasis role="bold">Note</emphasis> please ensure that
the following environment variables are set. These are
used by the various clients to access Keystone.</para>
<para>
<screen><computeroutput>export OS_USERNAME=admin
export OS_PASSWORD=adminpassword
export OS_TENANT_NAME=admin
export OS_AUTH_URL=http://127.0.0.1:5000/v2.0/</computeroutput></screen>
</para>
<para>
<itemizedlist>
<listitem>
<para><emphasis role="bold">Internal Networking Configuration</emphasis><orderedlist>
<listitem>
<para>Get the tenant ID (Used as
$TENANT_ID later).</para>
<screen><computeroutput>keystone tenant-list</computeroutput></screen>
<screen><computeroutput>+----------------------------------+--------------------+---------+
| id | name | enabled |
+----------------------------------+--------------------+---------+
| 48fb81ab2f6b409bafac8961a594980f | admin | True |
| cbb574ac1e654a0a992bfc0554237abf | service | True |
| e371436fe2854ed89cca6c33ae7a83cd | invisible_to_admin | True |
| e40fa60181524f9f9ee7aa1038748f08 | demo | True |
+----------------------------------+--------------------+---------+</computeroutput></screen>
</listitem>
<listitem>
<para>Create a internal network on the
demo tenant ($TENANT_ID will be
e40fa60181524f9f9ee7aa1038748f08):</para>
<screen><computeroutput>quantum net-create --tenant-id $TENANT_ID net1 --provider:network_type vlan --provider:physical_network physnet1 --provider:segmentation_id 1024</computeroutput></screen>
<screen><computeroutput>+---------------------------+--------------------------------------+
| Field | Value |
+---------------------------+--------------------------------------+
| admin_state_up | True |
| id | e99a361c-0af8-4163-9feb-8554d4c37e4f |
| name | net1 |
| provider:network_type | vlan |
| provider:physical_network | physnet1 |
| provider:segmentation_id | 1024 |
| router:external | False |
| shared | False |
| status | ACTIVE |
| subnets | |
| tenant_id | e40fa60181524f9f9ee7aa1038748f08 |
+---------------------------+--------------------------------------+</computeroutput></screen>
</listitem>
<listitem>
<para>Create a subnet on the network (Used as $SUBNET_ID
later):</para>
<screen><computeroutput>quantum subnet-create --tenant-id $TENANT_ID net1 10.0.0.0/24</computeroutput></screen>
<screen><computeroutput>+------------------+--------------------------------------------+
| Field | Value |
+------------------+--------------------------------------------+
| allocation_pools | {"start": "10.0.0.2", "end": "10.0.0.254"} |
| cidr | 10.0.0.0/24 |
| dns_nameservers | |
| enable_dhcp | True |
| gateway_ip | 10.0.0.1 |
| host_routes | |
| id | c395cb5d-ba03-41ee-8a12-7e792d51a167 |
| ip_version | 4 |
| name | |
| network_id | e99a361c-0af8-4163-9feb-8554d4c37e4f |
| tenant_id | e40fa60181524f9f9ee7aa1038748f08 |
+------------------+--------------------------------------------+</computeroutput></screen>
</listitem>
</orderedlist></para>
</listitem>
<listitem>
<para>DHCP Agent</para>
<para><emphasis role="bold">External Networking Configuration</emphasis><orderedlist>
<listitem>
<para>Create a router (Used as $ROUTER_ID later):</para>
<screen><computeroutput>quantum router-create --tenant_id $TENANT_ID router1</computeroutput></screen>
<screen><computeroutput>+-----------------------+--------------------------------------+
| Field | Value |
+-----------------------+--------------------------------------+
| admin_state_up | True |
| external_gateway_info | |
| id | 685f64e7-a020-4fdf-a8ad-e41194ae124b |
| name | router1 |
| status | ACTIVE |
| tenant_id | e40fa60181524f9f9ee7aa1038748f08 |
+-----------------------+--------------------------------------+</computeroutput></screen>
</listitem>
<listitem>
<para>Add the router to the subnet:</para>
<screen><computeroutput>quantum router-interface-add $ROUTER_ID $SUBNET_ID</computeroutput></screen>
<screen><computeroutput>Added interface to router 685f64e7-a020-4fdf-a8ad-e41194ae124b</computeroutput></screen>
</listitem>
<listitem>
<para>Create the external network (Used as $EXTERNAL_NETWORK_ID).
<emphasis role="bold">Note</emphasis> this is on a different
tenant to $TENANT_ID:</para>
<screen><computeroutput>quantum net-create ext_net -- --router:external=True</computeroutput></screen>
<screen><computeroutput>+---------------------------+--------------------------------------+
| Field | Value |
+---------------------------+--------------------------------------+
| admin_state_up | True |
| id | 8858732b-0400-41f6-8e5c-25590e67ffeb |
| name | ext_net |
| provider:network_type | vlan |
| provider:physical_network | physnet1 |
| provider:segmentation_id | 1 |
| router:external | True |
| shared | False |
| status | ACTIVE |
| subnets | |
| tenant_id | cbb574ac1e654a0a992bfc0554237abf |
+---------------------------+--------------------------------------+
</computeroutput></screen>
</listitem>
<listitem>
<para>Create the subnet for floating
IPs. <emphasis role="bold"
>Note</emphasis> the DHCP service
is disabled for this subnet:</para>
<screen><computeroutput>quantum subnet-create ext_net 172.24.4.224/28 -- --enable_dhcp=False</computeroutput></screen>
<screen><computeroutput>+------------------+--------------------------------------------------+
| Field | Value |
+------------------+--------------------------------------------------+
| allocation_pools | {"start": "172.24.4.226", "end": "172.24.4.238"} |
| cidr | 172.24.4.224/28 |
| dns_nameservers | |
| enable_dhcp | False |
| gateway_ip | 172.24.4.225 |
| host_routes | |
| id | aef60b55-cbff-405d-a81d-406283ac6cff |
| ip_version | 4 |
| name | |
| network_id | 8858732b-0400-41f6-8e5c-25590e67ffeb |
| tenant_id | cbb574ac1e654a0a992bfc0554237abf |
+------------------+--------------------------------------------------+</computeroutput></screen>
</listitem>
<listitem>
<para>Set the router for the external network:</para>
<screen><computeroutput>quantum router-gateway-set $ROUTER_ID $EXTERNAL_NETWORK_ID</computeroutput></screen>
<screen><computeroutput>Set gateway for router 685f64e7-a020-4fdf-a8ad-e41194ae124b</computeroutput></screen>
</listitem>
</orderedlist></para>
</listitem>
<listitem>
<para>Compute Node + L3 Agent</para>
<para><emphasis role="bold">Floating IP Allocation</emphasis><orderedlist>
<listitem>
<para>After a VM is deployed a
floating IP address can be
associated to the VM. A VM that is
created will be allocated a Quantum
port ($PORT_ID). The port ID for
the VM can be retrieved as
follows:</para>
<screen><computeroutput>nova list
+--------------------------------------+--------+--------+---------------+
| ID | Name | Status | Networks |
+--------------------------------------+--------+--------+---------------+
| 1cdc671d-a296-4476-9a75-f9ca1d92fd26 | testvm | ACTIVE | net1=10.0.0.3 |
+--------------------------------------+--------+--------+---------------+
quantum port-list -- --device_id 1cdc671d-a296-4476-9a75-f9ca1d92fd26
+--------------------------------------+------+-------------------+---------------------------------------------------------------------------------+
| id | name | mac_address | fixed_ips |
+--------------------------------------+------+-------------------+---------------------------------------------------------------------------------+
| 9aa47099-b87b-488c-8c1d-32f993626a30 | | fa:16:3e:b4:d6:6c | {"subnet_id": "c395cb5d-ba03-41ee-8a12-7e792d51a167", "ip_address": "10.0.0.3"} |
+--------------------------------------+------+-------------------+---------------------------------------------------------------------------------+</computeroutput></screen>
</listitem>
<listitem>
<para>Allocate a floating IP (Used as $FLOATING_ID):</para>
<screen><computeroutput>quantum floatingip-create ext_net
+---------------------+--------------------------------------+
| Field | Value |
+---------------------+--------------------------------------+
| fixed_ip_address | |
| floating_ip_address | 172.24.4.227 |
| floating_network_id | 8858732b-0400-41f6-8e5c-25590e67ffeb |
| id | 40952c83-2541-4d0c-b58e-812c835079a5 |
| port_id | |
| router_id | |
| tenant_id | e40fa60181524f9f9ee7aa1038748f08 |
+---------------------+--------------------------------------+</computeroutput></screen>
</listitem>
<listitem>
<para>Associate a floating IP to a VM
(in the case of the example it is
9aa47099-b87b-488c-8c1d-32f993626a30):</para>
<screen><computeroutput>quantum floatingip-associate $FLOATING_ID $PORT_ID
Associated floatingip 40952c83-2541-4d0c-b58e-812c835079a5</computeroutput></screen>
<para>Show the floating IP:</para>
<screen><computeroutput>quantum floatingip-show $FLOATING_ID
+---------------------+--------------------------------------+
| Field | Value |
+---------------------+--------------------------------------+
| fixed_ip_address | 10.0.0.3 |
| floating_ip_address | 172.24.4.227 |
| floating_network_id | 8858732b-0400-41f6-8e5c-25590e67ffeb |
| id | 40952c83-2541-4d0c-b58e-812c835079a5 |
| port_id | 9aa47099-b87b-488c-8c1d-32f993626a30 |
| router_id | 685f64e7-a020-4fdf-a8ad-e41194ae124b |
| tenant_id | e40fa60181524f9f9ee7aa1038748f08 |
+---------------------+--------------------------------------+
ping 172.24.4.227
PING 172.24.4.227 (172.24.4.227) 56(84) bytes of data.
64 bytes from 172.24.4.227: icmp_req=2 ttl=64 time=0.152 ms
64 bytes from 172.24.4.227: icmp_req=3 ttl=64 time=0.049 ms
</computeroutput></screen>
</listitem>
</orderedlist></para>
</listitem>
</itemizedlist></para>
</itemizedlist>
</para>
</section>
</appendix>

Binary file not shown.

After

(image error) Size: 25 KiB