Skip to content

Instantly share code, notes, and snippets.

View johnsom's full-sized avatar

Michael Johnson johnsom

  • Red Hat, Inc
  • Corvallis, Oregon
View GitHub Profile
# decider subflow accessing upstraem storage example
#
# Using taskflow 1.25.0
#
# Output:
# MyID
# In decider subflow
# Took branch A
# MyID
# decider subflow accessing upstraem storage example
#
# Using taskflow 1.25.0
#
# Output:
# MyID
# In decider subflow
# Took branch A
# MyID
[DEFAULT]
api_handler = queue_producer
debug = True
[database]
connection = mysql+pymysql://root:<redacted>@127.0.0.1:3306/octavia
[health_manager]
bind_port = 5555
bind_ip = 192.168.0.3
controller_ip_port_list = 192.168.0.3:5555
heartbeat_key =<redacted>
[{'index': 1, 'family': 0, '__align': 0, 'header': {'pid': 1617, 'length': 1128, 'flags': 2, 'error': None, 'type': 16, 'sequence_number': 263}, 'flags': 8, 'ifi_type': 772, 'event': 'RTM_NEWLINK', 'change': 0, 'attrs': [['IFLA_IFNAME', 'lo'], ['IFLA_TXQLEN', 0], ['IFLA_OPERSTATE', 'DOWN'], ['IFLA_LINKMODE', 0], ['IFLA_MTU', 65536], ['IFLA_GROUP', 0], ['IFLA_PROMISCUITY', 0], ['IFLA_NUM_TX_QUEUES', 1], ['IFLA_NUM_RX_QUEUES', 1], ['IFLA_CARRIER', 1], ['IFLA_QDISC', 'noop'], ['IFLA_MAP', {'dma': 0, 'base_addr': 0, 'irq': 0, 'mem_end': 0, 'port': 0, 'mem_start': 0}], ['IFLA_ADDRESS', '00:00:00:00:00:00'], ['IFLA_BROADCAST', '00:00:00:00:00:00'], ['IFLA_STATS', {'rx_over_errors': 0, 'tx_window_errors': 0, 'tx_aborted_errors': 0, 'rx_compressed': 0, 'tx_carrier_errors': 0, 'collisions': 0, 'tx_packets': 0, 'tx_dropped': 0, 'rx_packets': 0, 'rx_length_errors': 0, 'rx_missed_errors': 0, 'tx_bytes': 0, 'rx_frame_errors': 0, 'rx_dropped': 0, 'rx_crc_errors': 0, 'rx_bytes': 0, 'tx_errors': 0, 'rx_fifo_errors': 0, 'tx_f
#!/bin/sh
MYIP=$(/sbin/ifconfig eth0|grep 'inet addr'|awk -F: '{print $2}'| awk '{print $1}');
COUNT=0
while true; do
OUTPUT_STR="Welcome to $MYIP connection $COUNT\r"
OUTPUT_LEN=${#OUTPUT_STR}
echo -e "HTTP/1.0 200 OK\r\nContent-Length: ${OUTPUT_LEN}\r\n\r\n${OUTPUT_STR}" | sudo nc -l -p 80
if [ $? == 0 ]; then
let "COUNT++"
mysql> select * from listener_statistics;
+--------------------------------------+----------+-----------+--------------------+-------------------+--------------------------------------+
| listener_id | bytes_in | bytes_out | active_connections | total_connections | amphora_id |
+--------------------------------------+----------+-----------+--------------------+-------------------+--------------------------------------+
| 4f30c4d2-1d05-4a75-885e-5ab790034235 | 144 | 148 | 0 | 2 | 004c3d88-9c2c-4ca6-84c1-b7c28fc04ab4 |
| 4f30c4d2-1d05-4a75-885e-5ab790034235 | 0 | 0 | 0 | 0 | 1cbdbf44-1668-4836-9f69-46e8e8fa663b |
+--------------------------------------+----------+-----------+--------------------+-------------------+--------------------------------------+
2 rows in set (0.00 sec)
LB with 2 listeners in Act/Stby:
GIT_BASE=http://github.com
# Load the external LBaaS plugin.
enable_plugin neutron-lbaas https://review.openstack.org/openstack/neutron-lbaas
enable_plugin octavia https://github.com/openstack/octavia.git
# Until Kilo 2 packages are available, get the neutron client with V2 support from git:
LIBS_FROM_GIT+=python-neutronclient
# RECLONE=yes
#!/bin/bash
export OCTAVIA_DIR=/opt/stack/octavia
# Out with the old
OLD_IMAGE=$(glance image-list | awk '/ amphora-x64-haproxy / {print $2}')
glance image-delete $OLD_IMAGE
sudo modprobe nbd
sudo qemu-nbd -c /dev/nbd0 $OCTAVIA_DIR/diskimage-create/amphora-x64-haproxy.qcow2
#!/bin/bash
function wait_for_nova_active {
echo "Waiting for $1 to become ACTIVE..."
status=$(nova show $1 | awk '/status/ {print $4}')
while [ "$status" != "ACTIVE" ]
do
sleep 1
status=$(nova show $1 | awk '/ status/ {print $4}')
if [ $status == "ERROR" ]
#!/bin/sh
MYIP=$(/sbin/ifconfig eth0|grep 'inet addr'|awk -F: '{print $2}'| awk '{print $1}');
COUNT=0
while true; do
echo -e "HTTP/1.0 200 OK\r\n\r\nWelcome to $MYIP connection $COUNT" | sudo nc -l -p 80 -w 1
if [ $? == 0 ]; then
let "COUNT++"
fi
done