Jump to: navigation, search

Difference between revisions of "Neutron/LBaaS/DeployWithDevstack"

< Neutron‎ | LBaaS
(Deploying Neutron LBaaS With Devstack)
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
== Deploying Neutron LBaaS With Devstack ==
 
== Deploying Neutron LBaaS With Devstack ==
 
* Install devstack with neutron and neutron lbaas
 
* Install devstack with neutron and neutron lbaas
** Following the instructions on this link should suffice.  It will enable the v1 lbaas API
+
** If you don't have devstack installed you can follow the instructions on this link.  It will enable the v1 lbaas API
 
** http://roaet.com/my-method-to-installuse-devstack
 
** http://roaet.com/my-method-to-installuse-devstack
* Pull down gerrit change requests with useable code
+
* Code with LoggingNooopDriver is merged. No review needed to pull down.
** LoggingNoopDriver (Only contains LoggingNoopDriver)
+
** Synchronous Haproxy Driver (Contains LoggingNoopDriver as well)
*** https://review.openstack.org/#/c/105610/
+
*** https://review.openstack.org/#/c/144832/
** Agentless Haproxy Driver (Contains LoggingNoopDriver as well)
 
*** https://review.openstack.org/#/c/108174/
 
 
* Run database migration
 
* Run database migration
 
** <code> neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head </code>
 
** <code> neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head </code>
Line 21: Line 19:
 
**** To use the LoggingNoopDriver:
 
**** To use the LoggingNoopDriver:
 
***** <code>service_provider=LOADBALANCERV2:LoggingNoop:neutron.services.loadbalancer.drivers.logging_noop.driver.LoggingNoopLoadBalancerDriver:default </code>
 
***** <code>service_provider=LOADBALANCERV2:LoggingNoop:neutron.services.loadbalancer.drivers.logging_noop.driver.LoggingNoopLoadBalancerDriver:default </code>
**** To use the Agentless Haproxy Driver:
+
**** To use the Synchronous Haproxy Driver:
***** <code>service_provider=LOADBALANCERV2:Haproxy:neutron.services.loadbalancer.drivers.haproxy.nonagent_namespace_driver.HaproxyNSDriver:default</code>
+
***** Uncomment the line that looks like the line below
 +
***** <code>service_provider=LOADBALANCERV2:Haproxy:neutron.services.loadbalancer.drivers.haproxy.synchronous_namespace_driver.HaproxyNSDriver:default</code>
 
* Re-install the neutron code and restart the neutron-server process.  This is most easily done by going into the devstack screen, switching to neutron server (^A-6, the screen name is q-svc), hitting ^C, up arrow, enter.  Alternately:
 
* Re-install the neutron code and restart the neutron-server process.  This is most easily done by going into the devstack screen, switching to neutron server (^A-6, the screen name is q-svc), hitting ^C, up arrow, enter.  Alternately:
 
** I use this bash script:
 
** I use this bash script:
Line 38: Line 37:
 
* Install the CLI/client
 
* Install the CLI/client
 
<pre>
 
<pre>
cd ~
+
cd /opt/stack/python-neutronclient
git clone https://github.com/oslbaas/python-neutronclient.git
+
git review -d 111475
cd python-neutronclient/
 
git checkout -b objectmodel
 
git pull origin objectmodel
 
cd /opt/stack/python-neutronclient/
 
git pull ~/python-neutronclient objectmodel
 
 
sudo python setup.py install
 
sudo python setup.py install
cd
 
neutron help | grep lbaas
 
 
</pre>
 
</pre>
 
* Create Entities Using CLI/client
 
* Create Entities Using CLI/client
 
** <pre> neutron lbaas-pool-create --lb-algorithm ROUND_ROBIN --protocol HTTP pool1 </pre>
 
** <pre> neutron lbaas-pool-create --lb-algorithm ROUND_ROBIN --protocol HTTP pool1 </pre>
*** Client is currently bug so use this: (Just make sure localhost works as a neutron endpoint)
 
*** <pre> curl -i http://localhost:9696/v2.0/lbaas/pools.json -X POST -H "X-Auth-Token: $(keystone token-get --wrap 0 | grep ' id ' | awk '{print $4}')" -H "Content-Type: application/json" -H "Accept: application/json" -H "User-Agent: python-neutronclient" -d '{"pool": {"lb_algorithm": "ROUND_ROBIN", "protocol": "HTTP", "name": "pool1"}}' </pre>
 
 
** <pre> neutron lbaas-member-create --subnet-id $(neutron subnet-list | awk '/ private-subnet / {print $2}') --address 10.0.0.2 --protocol-port 80 $(neutron lbaas-pool-list | awk '/ pool1 / {print $2}') </pre>
 
** <pre> neutron lbaas-member-create --subnet-id $(neutron subnet-list | awk '/ private-subnet / {print $2}') --address 10.0.0.2 --protocol-port 80 $(neutron lbaas-pool-list | awk '/ pool1 / {print $2}') </pre>
 
** <pre> neutron lbaas-loadbalancer-create lb1 $(neutron subnet-list | awk '/ private-subnet / {print $2}') </pre>
 
** <pre> neutron lbaas-loadbalancer-create lb1 $(neutron subnet-list | awk '/ private-subnet / {print $2}') </pre>
Line 60: Line 50:
 
* Issues
 
* Issues
 
** If you get an error similar to "operational error" with some DB fluff, you'll need to stop neutron, run migrations, and restart neutron.  If the migration fails, you might need to clean out stale lbaas tables by hand and try again.  https://github.com/openstack/neutron/blob/master/neutron/db/migration/README
 
** If you get an error similar to "operational error" with some DB fluff, you'll need to stop neutron, run migrations, and restart neutron.  If the migration fails, you might need to clean out stale lbaas tables by hand and try again.  https://github.com/openstack/neutron/blob/master/neutron/db/migration/README
 +
* DEMO system
 +
** For reviewers only, /msg an ssh public key to dougwig
 +
** <pre>ssh ubuntu@v2.lbaas.me</pre>
 +
** Source the files "admin-openrc.sh" or "demo-openrc.sh" as needed (should be almost all demo-openrc.sh)
 +
** For Horizon, use admin/secretadmin or demo/secretadmin
 +
** This is a standard devstackgate box; logs will be in /opt/stack/new/screen-logs.  Please do NOT re-run stack.sh.

Latest revision as of 16:45, 13 January 2015

Deploying Neutron LBaaS With Devstack

  • Install devstack with neutron and neutron lbaas
  • Code with LoggingNooopDriver is merged. No review needed to pull down.
  • Run database migration
    • neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head
    • If any issues pop up its probably better to just ./unstack.sh devstack and ./stack.sh devstack again while you've got the gerrit change request checked out.
  • Change the neutron config
    • /etc/neutron/neutron.conf
      • Under the [DEFAULT] section there is an options called service_plugins. It is a comma-delimited list. Add the following to it:
        • If service_plugins option already exists add to the end of the line:
          • ,neutron.services.loadbalancer.plugin.LoadBalancerPluginv2
        • If service_plugins option does not exist add this line:
          • service_plugins = neutron.services.loadbalancer.plugin.LoadBalancerPluginv2
      • Under the [service_providers] section (usually at the bottom) there are options called service_provider, there can be many service_provider entries. Add the following
        • To use the LoggingNoopDriver:
          • service_provider=LOADBALANCERV2:LoggingNoop:neutron.services.loadbalancer.drivers.logging_noop.driver.LoggingNoopLoadBalancerDriver:default
        • To use the Synchronous Haproxy Driver:
          • Uncomment the line that looks like the line below
          • service_provider=LOADBALANCERV2:Haproxy:neutron.services.loadbalancer.drivers.haproxy.synchronous_namespace_driver.HaproxyNSDriver:default
  • Re-install the neutron code and restart the neutron-server process. This is most easily done by going into the devstack screen, switching to neutron server (^A-6, the screen name is q-svc), hitting ^C, up arrow, enter. Alternately:
    • I use this bash script:
#!/bin/bash

if [ `ps aux | grep neutron-server | wc -l` -gt 1 ]; then
    kill -9 `ps aux | grep '[n]eutron-server' -m1 | awk '{print $2}'`
fi

sudo pip install --build=/tmp/pip-build.bE71P -e /opt/stack/neutron

/usr/local/bin/neutron-server --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini
  • Install the CLI/client
cd /opt/stack/python-neutronclient
git review -d 111475
sudo python setup.py install
  • Create Entities Using CLI/client
    •  neutron lbaas-pool-create --lb-algorithm ROUND_ROBIN --protocol HTTP pool1 
    •  neutron lbaas-member-create --subnet-id $(neutron subnet-list | awk '/ private-subnet / {print $2}') --address 10.0.0.2 --protocol-port 80 $(neutron lbaas-pool-list | awk '/ pool1 / {print $2}') 
    •  neutron lbaas-loadbalancer-create lb1 $(neutron subnet-list | awk '/ private-subnet / {print $2}') 
    •  neutron lbaas-listener-create --loadbalancer-id $(neutron lbaas-loadbalancer-list | awk '/ lb1 / {print $2}') --protocol HTTP --protocol-port 80 --default-pool-id $(neutron lbaas-pool-list | awk '/ pool1 / {print $2}') 
  • Command-line tester

A mostly stand-alone test script that drives the CLI and API to create load balancers in various configurations: https://github.com/dougwig/lbaas_tester

  • Issues
  • DEMO system
    • For reviewers only, /msg an ssh public key to dougwig
    • ssh ubuntu@v2.lbaas.me
    • Source the files "admin-openrc.sh" or "demo-openrc.sh" as needed (should be almost all demo-openrc.sh)
    • For Horizon, use admin/secretadmin or demo/secretadmin
    • This is a standard devstackgate box; logs will be in /opt/stack/new/screen-logs. Please do NOT re-run stack.sh.