From 9d6aee088fee9f1d42b0248d9f5b84baeb5b2204 Mon Sep 17 00:00:00 2001 From: Adam Harwell Date: Tue, 28 May 2019 19:10:41 -0700 Subject: [PATCH 1/6] Try to make this work with Bionic --- local.conf | 2 +- profile | 5 +++-- stackme.sh | 18 ++++++------------ 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/local.conf b/local.conf index d001ed4..03f044a 100644 --- a/local.conf +++ b/local.conf @@ -1,7 +1,7 @@ [[local|localrc]] enable_plugin barbican https://review.openstack.org/openstack/barbican $BARBICAN_PATCH enable_plugin octavia https://review.openstack.org/openstack/octavia $OCTAVIA_PATCH -LIBS_FROM_GIT+=python-octaviaclient +LIBS_FROM_GIT+=python-octaviaclient,octavia-lib HOST_IP=127.0.0.1 diff --git a/profile b/profile index ea3a09c..9c00685 100644 --- a/profile +++ b/profile @@ -33,8 +33,8 @@ function gen_backend() { openstack security group rule create --protocol tcp --dst-port 22 --ethertype IPv6 --remote-ip ::/0 member openstack security group rule create --protocol tcp --dst-port 80 --ethertype IPv6 --remote-ip ::/0 member PRIVATE_NETWORK=$(openstack network list | awk '/ private / {print $2}') - openstack server create --image cirros-0.3.5-x86_64-disk --flavor 2 --nic net-id=$PRIVATE_NETWORK member1 --security-group member --key-name default - openstack server create --image cirros-0.3.5-x86_64-disk --flavor 2 --nic net-id=$PRIVATE_NETWORK member2 --security-group member --key-name default --wait + openstack server create --image cirros-0.4.0-x86_64-disk --flavor 2 --nic net-id=$PRIVATE_NETWORK member1 --security-group member --key-name default + openstack server create --image cirros-0.4.0-x86_64-disk --flavor 2 --nic net-id=$PRIVATE_NETWORK member2 --security-group member --key-name default --wait sleep 15 if [ -z "$MEMBER1_IP" ]; then export MEMBER1_IP=$(openstack server show member1 | awk '/ addresses / {a = substr($4, 9, length($4)-9); if (a ~ "\\.") print a; else print $5}') @@ -130,3 +130,4 @@ function create_full() { echo "Done!" } +source ~/.bashrc diff --git a/stackme.sh b/stackme.sh index 54f6dd9..f74e682 100755 --- a/stackme.sh +++ b/stackme.sh @@ -1,20 +1,16 @@ #!/bin/bash OCTAVIA_PATCH="" +OCTAVIA_LIB_PATCH="" OCTAVIA_CLIENT_PATCH="" BARBICAN_PATCH="" # Quick sanity check (should be run on Ubuntu 16.04 and MUST be run as root directly) -if [ `lsb_release -rs` != "16.04" ] +if [ `lsb_release -rs` != "18.04" ] then - echo -n "Warning: This script is only tested against Ubuntu xenial. Press to continue at your own risk... " + echo -n "Warning: This script is only tested against Ubuntu bionic. Press to continue at your own risk... " read fi -if [ `whoami` != "root" -o -n "$SUDO_COMMAND" ] -then - echo "This script must be run as root, and not using 'sudo'!" - exit 1 -fi # Set up the packages we need apt-get update @@ -28,9 +24,6 @@ wget -O - https://raw.githubusercontent.com/rm-you/devstack_deploy/master/local. # Create the stack user /tmp/devstack/tools/create-stack-user.sh -# Apparently the group for libvirt changed to libvirtd in parallels? -usermod -a -G libvirtd stack - # Move everything into place mv /tmp/devstack /opt/stack/ chown -R stack:stack /opt/stack/devstack/ @@ -40,8 +33,9 @@ cat >>/opt/stack/.profile < Date: Wed, 29 May 2019 10:22:01 -0700 Subject: [PATCH 2/6] Add octavia-lib custom repo --- local.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/local.conf b/local.conf index 03f044a..9c4d8d1 100644 --- a/local.conf +++ b/local.conf @@ -2,6 +2,7 @@ enable_plugin barbican https://review.openstack.org/openstack/barbican $BARBICAN_PATCH enable_plugin octavia https://review.openstack.org/openstack/octavia $OCTAVIA_PATCH LIBS_FROM_GIT+=python-octaviaclient,octavia-lib +OCTAVIA_LIB_REPO=https://review.opendev.org/openstack/octavia-lib HOST_IP=127.0.0.1 From 6119e604fb74d442548c5fdf14aa92f75c3370d5 Mon Sep 17 00:00:00 2001 From: Adam Harwell Date: Wed, 29 May 2019 10:22:39 -0700 Subject: [PATCH 3/6] Test with MultiVIP patch --- stackme.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stackme.sh b/stackme.sh index f74e682..ac65a1b 100755 --- a/stackme.sh +++ b/stackme.sh @@ -1,7 +1,7 @@ #!/bin/bash -OCTAVIA_PATCH="" -OCTAVIA_LIB_PATCH="" +OCTAVIA_PATCH="refs/changes/39/660239/14" +OCTAVIA_LIB_PATCH="refs/changes/38/660238/1" OCTAVIA_CLIENT_PATCH="" BARBICAN_PATCH="" From 3eacdec18f9a4f06f586216c19ac8bad89c76172 Mon Sep 17 00:00:00 2001 From: Adam Harwell Date: Wed, 5 Jun 2019 18:47:46 -0700 Subject: [PATCH 4/6] Update profile: new aliases, fixed members/subnets --- profile | 28 ++++++++++++++++++++++------ stackme.sh | 2 +- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/profile b/profile index 9c00685..8b8645f 100644 --- a/profile +++ b/profile @@ -12,8 +12,10 @@ export BARBICAN_ENDPOINT="http://localhost:9311" # Set some utility variables PROJECT_ID=$(openstack token issue | awk '/ project_id / {print $4}') export PROJECT_ID="${PROJECT_ID:0:8}-${PROJECT_ID:8:4}-${PROJECT_ID:12:4}-${PROJECT_ID:16:4}-${PROJECT_ID:20}" -export DEFAULT_NETWORK=$(openstack subnet list | awk '/ private-subnet / {print $2}') -export DEFAULT_NETWORK_IPV6=$(openstack subnet list | awk '/ ipv6-private-subnet / {print $2}') +export PRIVATE_SUBNET=$(openstack subnet list | awk '/ private-subnet / {print $2}') +export PRIVATE_SUBNET_IPV6=$(openstack subnet list | awk '/ ipv6-private-subnet / {print $2}') +export PUBLIC_SUBNET=$(openstack subnet list | awk '/ public-subnet / {print $2}') +export PUBLIC_SUBNET_IPV6=$(openstack subnet list | awk '/ ipv6-public-subnet / {print $2}') # Make pretty-printing json easy alias json="python -mjson.tool" @@ -21,6 +23,13 @@ alias json="python -mjson.tool" # Make sshing to amps easy alias ossh="ssh -i /etc/octavia/.ssh/octavia_ssh_key -l ubuntu" +# Other aliases for quality of life +alias oslb='openstack loadbalancer' +alias oss='openstack server' +alias gs='git status' +alias gd='git diff' +alias gp='git pull' + # Run this to generate nova VMs as a test backend function gen_backend() { ssh-keygen -f /opt/stack/.ssh/id_rsa -t rsa -N '' -q @@ -33,8 +42,8 @@ function gen_backend() { openstack security group rule create --protocol tcp --dst-port 22 --ethertype IPv6 --remote-ip ::/0 member openstack security group rule create --protocol tcp --dst-port 80 --ethertype IPv6 --remote-ip ::/0 member PRIVATE_NETWORK=$(openstack network list | awk '/ private / {print $2}') - openstack server create --image cirros-0.4.0-x86_64-disk --flavor 2 --nic net-id=$PRIVATE_NETWORK member1 --security-group member --key-name default - openstack server create --image cirros-0.4.0-x86_64-disk --flavor 2 --nic net-id=$PRIVATE_NETWORK member2 --security-group member --key-name default --wait + openstack server create --image cirros-0.4.0-x86_64-disk --flavor m1.tiny --nic net-id=$PRIVATE_NETWORK member1 --security-group member --key-name default + openstack server create --image cirros-0.4.0-x86_64-disk --flavor m1.tiny --nic net-id=$PRIVATE_NETWORK member2 --security-group member --key-name default --wait sleep 15 if [ -z "$MEMBER1_IP" ]; then export MEMBER1_IP=$(openstack server show member1 | awk '/ addresses / {a = substr($4, 9, length($4)-9); if (a ~ "\\.") print a; else print $5}') @@ -68,17 +77,24 @@ function wait_for_status() { # Create a LB with Octavia function create_lb() { - openstack loadbalancer create --name lb1 --vip-subnet $DEFAULT_NETWORK + openstack loadbalancer create --name lb1 --vip-subnet $PUBLIC_SUBNET wait_for_status openstack loadbalancer show lb1 } function create_lb_ipv6() { - openstack loadbalancer create --name lb1 --vip-subnet $DEFAULT_NETWORK_IPV6 + openstack loadbalancer create --name lb1 --vip-subnet $PUBLIC_SUBNET_IPV6 wait_for_status openstack loadbalancer show lb1 } +function create_lb_addvip() { + TOKEN=$(openstack token issue -f value -c id) + OCTAVIA_BASE_URL=$(openstack endpoint list --service octavia --interface public -c URL -f value) + curl -X POST -H "Content-Type: application/json" -H "X-Auth-Token: $TOKEN" -d "{\"loadbalancer\": {\"vip_subnet_id\": \"${PUBLIC_SUBNET}\", \"name\": \"lb1\", \"additional_vips\": [{\"subnet_id\": \"${PUBLIC_SUBNET_IPV6}\"}]}}" ${OCTAVIA_BASE_URL}/v2.0/lbaas/loadbalancers | jq + wait_for_status +} + # Create a Listener with Octavia function create_listener() { openstack loadbalancer listener create --protocol TERMINATED_HTTPS --protocol-port 443 --name listener1 --default-tls-container-ref $DEFAULT_TLS_CONTAINER lb1 diff --git a/stackme.sh b/stackme.sh index ac65a1b..6164b7e 100755 --- a/stackme.sh +++ b/stackme.sh @@ -1,6 +1,6 @@ #!/bin/bash -OCTAVIA_PATCH="refs/changes/39/660239/14" +OCTAVIA_PATCH="refs/changes/39/660239/23" OCTAVIA_LIB_PATCH="refs/changes/38/660238/1" OCTAVIA_CLIENT_PATCH="" BARBICAN_PATCH="" From 2dbc4a7241f51650c0db980a394aeb9cd55a9b88 Mon Sep 17 00:00:00 2001 From: Adam Harwell Date: Wed, 12 Jun 2019 17:28:56 -0700 Subject: [PATCH 5/6] More profile tweaks --- profile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/profile b/profile index 8b8645f..e071173 100644 --- a/profile +++ b/profile @@ -29,6 +29,7 @@ alias oss='openstack server' alias gs='git status' alias gd='git diff' alias gp='git pull' +alias gl='git log --stat' # Run this to generate nova VMs as a test backend function gen_backend() { @@ -91,7 +92,7 @@ function create_lb_ipv6() { function create_lb_addvip() { TOKEN=$(openstack token issue -f value -c id) OCTAVIA_BASE_URL=$(openstack endpoint list --service octavia --interface public -c URL -f value) - curl -X POST -H "Content-Type: application/json" -H "X-Auth-Token: $TOKEN" -d "{\"loadbalancer\": {\"vip_subnet_id\": \"${PUBLIC_SUBNET}\", \"name\": \"lb1\", \"additional_vips\": [{\"subnet_id\": \"${PUBLIC_SUBNET_IPV6}\"}]}}" ${OCTAVIA_BASE_URL}/v2.0/lbaas/loadbalancers | jq + curl -s -X POST -H "Content-Type: application/json" -H "X-Auth-Token: $TOKEN" -d "{\"loadbalancer\": {\"vip_subnet_id\": \"${PUBLIC_SUBNET}\", \"name\": \"lb1\", \"additional_vips\": [{\"subnet_id\": \"${PUBLIC_SUBNET_IPV6}\"}]}}" ${OCTAVIA_BASE_URL}/v2.0/lbaas/loadbalancers | jq wait_for_status } From 53c679b1aa6924bf19030826b52bdceb3ba22164 Mon Sep 17 00:00:00 2001 From: Adam Harwell Date: Wed, 12 Jun 2019 17:29:16 -0700 Subject: [PATCH 6/6] Update default patches (newer multivip and client) --- stackme.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stackme.sh b/stackme.sh index 6164b7e..fece86f 100755 --- a/stackme.sh +++ b/stackme.sh @@ -1,8 +1,8 @@ #!/bin/bash -OCTAVIA_PATCH="refs/changes/39/660239/23" -OCTAVIA_LIB_PATCH="refs/changes/38/660238/1" -OCTAVIA_CLIENT_PATCH="" +OCTAVIA_PATCH="refs/changes/39/660239/46" +OCTAVIA_LIB_PATCH="refs/changes/10/664510/2" +OCTAVIA_CLIENT_PATCH="refs/changes/73/664473/4" BARBICAN_PATCH="" # Quick sanity check (should be run on Ubuntu 16.04 and MUST be run as root directly)