Merge "doc: Update LBaaS v2 setup for Liberty"

This commit is contained in:
Jenkins 2015-11-18 01:12:57 +00:00 committed by Gerrit Code Review
commit 51c5498eab

View File

@ -1,13 +1,17 @@
Configure Load-Balancer in Kilo Configure Load-Balancer Version 2
================================= =================================
The Kilo release of OpenStack will support Version 2 of the neutron load balancer. Until now, using OpenStack `LBaaS V2 <http://docs.openstack.org/api/openstack-network/2.0/content/lbaas_ext.html>`_ has required a good understanding of neutron and LBaaS architecture and several manual steps. Starting in the OpenStack Liberty release, the
`neutron LBaaS v2 API <http://developer.openstack.org/api-ref-networking-v2-ext.html>`_
is now stable while the LBaaS v1 API has been deprecated. The LBaaS v2 reference
driver is based on Octavia.
Phase 1: Create DevStack + 2 nova instances Phase 1: Create DevStack + 2 nova instances
-------------------------------------------- --------------------------------------------
First, set up a vm of your choice with at least 8 GB RAM and 16 GB disk space, make sure it is updated. Install git and any other developer tools you find useful. First, set up a vm of your choice with at least 8 GB RAM and 16 GB disk space,
make sure it is updated. Install git and any other developer tools you find useful.
Install devstack Install devstack
@ -24,6 +28,7 @@ Edit your ``local.conf`` to look like
[[local|localrc]] [[local|localrc]]
# Load the external LBaaS plugin. # Load the external LBaaS plugin.
enable_plugin neutron-lbaas https://git.openstack.org/openstack/neutron-lbaas enable_plugin neutron-lbaas https://git.openstack.org/openstack/neutron-lbaas
enable_plugin octavia https://git.openstack.org/openstack/octavia
# ===== BEGIN localrc ===== # ===== BEGIN localrc =====
DATABASE_PASSWORD=password DATABASE_PASSWORD=password
@ -42,13 +47,13 @@ Edit your ``local.conf`` to look like
ENABLED_SERVICES+=,horizon ENABLED_SERVICES+=,horizon
# Nova # Nova
ENABLED_SERVICES+=,n-api,n-crt,n-obj,n-cpu,n-cond,n-sch ENABLED_SERVICES+=,n-api,n-crt,n-obj,n-cpu,n-cond,n-sch
IMAGE_URLS+=",https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img"
# Glance # Glance
ENABLED_SERVICES+=,g-api,g-reg ENABLED_SERVICES+=,g-api,g-reg
# Neutron # Neutron
ENABLED_SERVICES+=,q-svc,q-agt,q-dhcp,q-l3,q-meta ENABLED_SERVICES+=,q-svc,q-agt,q-dhcp,q-l3,q-meta
# Enable LBaaS V2 # Enable LBaaS v2
ENABLED_SERVICES+=,q-lbaasv2 ENABLED_SERVICES+=,q-lbaasv2
ENABLED_SERVICES+=,octavia,o-cw,o-hk,o-hm,o-api
# Cinder # Cinder
ENABLED_SERVICES+=,c-api,c-vol,c-sch ENABLED_SERVICES+=,c-api,c-vol,c-sch
# Tempest # Tempest
@ -69,11 +74,11 @@ Create two nova instances that we can use as test http servers:
:: ::
#create nova instances on private network #create nova instances on private network
nova boot --image $(nova image-list | awk '/ cirros-0.3.0-x86_64-disk / {print $2}') --flavor 1 --nic net-id=$(neutron net-list | awk '/ private / {print $2}') node1 nova boot --image $(nova image-list | awk '/ cirros-.*-x86_64-uec / {print $2}') --flavor 1 --nic net-id=$(neutron net-list | awk '/ private / {print $2}') node1
nova boot --image $(nova image-list | awk '/ cirros-0.3.0-x86_64-disk / {print $2}') --flavor 1 --nic net-id=$(neutron net-list | awk '/ private / {print $2}') node2 nova boot --image $(nova image-list | awk '/ cirros-.*-x86_64-uec / {print $2}') --flavor 1 --nic net-id=$(neutron net-list | awk '/ private / {print $2}') node2
nova list # should show the nova instances just created nova list # should show the nova instances just created
#add secgroup rule to allow ssh etc.. #add secgroup rules to allow ssh etc..
neutron security-group-rule-create default --protocol icmp neutron security-group-rule-create default --protocol icmp
neutron security-group-rule-create default --protocol tcp --port-range-min 22 --port-range-max 22 neutron security-group-rule-create default --protocol tcp --port-range-min 22 --port-range-max 22
neutron security-group-rule-create default --protocol tcp --port-range-min 80 --port-range-max 80 neutron security-group-rule-create default --protocol tcp --port-range-min 80 --port-range-max 80
@ -91,9 +96,16 @@ Phase 2: Create your load balancers
:: ::
neutron lbaas-loadbalancer-create --name lb1 private-subnet neutron lbaas-loadbalancer-create --name lb1 private-subnet
neutron lbaas-loadbalancer-show lb1 # Wait for the provisioning_status to be ACTIVE.
neutron lbaas-listener-create --loadbalancer lb1 --protocol HTTP --protocol-port 80 --name listener1 neutron lbaas-listener-create --loadbalancer lb1 --protocol HTTP --protocol-port 80 --name listener1
sleep 10 # Sleep since LBaaS actions can take a few seconds depending on the environment.
neutron lbaas-pool-create --lb-algorithm ROUND_ROBIN --listener listener1 --protocol HTTP --name pool1 neutron lbaas-pool-create --lb-algorithm ROUND_ROBIN --listener listener1 --protocol HTTP --name pool1
sleep 10
neutron lbaas-member-create --subnet private-subnet --address 10.0.0.3 --protocol-port 80 pool1 neutron lbaas-member-create --subnet private-subnet --address 10.0.0.3 --protocol-port 80 pool1
sleep 10
neutron lbaas-member-create --subnet private-subnet --address 10.0.0.5 --protocol-port 80 pool1 neutron lbaas-member-create --subnet private-subnet --address 10.0.0.5 --protocol-port 80 pool1
Please note here that the "10.0.0.3" and "10.0.0.5" in the above commands are the IPs of the nodes (in my test run-thru, they were actually 10.2 and 10.4), and the address of the created LB will be reported as "vip_address" from the lbaas-loadbalancer-create, and a quick test of that LB is "curl that-lb-ip", which should alternate between showing the IPs of the two nodes. Please note here that the "10.0.0.3" and "10.0.0.5" in the above commands are the IPs of the nodes
(in my test run-thru, they were actually 10.2 and 10.4), and the address of the created LB will be
reported as "vip_address" from the lbaas-loadbalancer-create, and a quick test of that LB is
"curl that-lb-ip", which should alternate between showing the IPs of the two nodes.