This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -xe | |
# $0 host dev remote_ip | |
# host is 1 or 2 | |
# on vmA | |
# ./mk-vx.sh 1 ens3 10.10.10.9 | |
# on vmB | |
# ./mk-vx.sh 2 ens3 10.10.10.15 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Script to gather neutron info for vm connectivity problems. | |
Gets the vm's ports, networks, subnets, security groups | |
and router, external networks and floatingips. | |
source .openrc admin | |
python dump-vm-neutrn-info.py VM_ID | |
""" | |
import sys | |
import os_client_config |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Search nova-compute.log for ports that took a long time | |
# to receive the network-vif-plugged- event from neutron. | |
# python find_slow_boot.py /var/log/nov/nova-compute.log | sort -k 3 | |
import datetime | |
import re | |
import sys | |
if len(sys.argv) == 2: | |
log_file = sys.argv[1] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Server to answer requests from Libvirt VMs to http://169.254.169.254/ | |
Cloud images usually don't have a preset user/password, and this is needed to add a ssh pub key to .ssh/authorized_hosts. | |
Change SSH_PUB_KEY path below. | |
pip install bottle | |
sudo ip address add 169.254.169.254 dev virbr0 | |
open firewall | |
-A ufw-user-input -s 192.168.122.0/24 -d 169.254.169.254/32 -i virbr0 -p tcp -m tcp --dport 80 -j ACCEPT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Pretty print an OpenStack Oslo messaging packet capture. | |
tcpdump -ni ethX tcp port 5672 -w rabbit.cap | |
python read-rabbit-cap.py rabbit.cap | |
python read-rabbit-cap.py rabbit.cap | grep -v context | |
''' | |
import json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys, json, yaml | |
yaml.dump(json.loads(sys.stdin.read()), sys.stdout, default_flow_style=False) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
import yaml | |
import jinja2 | |
if len(sys.argv) != 3: | |
print "Usage: %s yaml template" % sys.argv[0] | |
sys.exit(1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#@ /etc/quagga/bgpd.conf (Centos & Ubuntu) | |
hostname <Local OS hostname> | |
password <Any random phrase> | |
enable password <Any random phrase> | |
! | |
log file /var/log/quagga/bgpd | |
!debug bgp events | |
!debug bgp zebra | |
debug bgp updates |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWSTemplateFormatVersion: 2010-09-09 | |
# aws cloudformation create-stack --stack-name test-stack --template-body file://stack.yaml | |
# aws cloudformation describe-stacks --stack-name test-stack | |
# aws cloudformation describe-stack-events --stack-name test-stack | |
# aws cloudformation update-stack --stack-name test-stack --template-body file://stack.yaml | |
Description: VPC, SGs, instances | |
Parameters: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
''' | |
Builds an Ansible inventory file with RHOS overcloud nodes. | |
On director: | |
source ~/stackrc | |
./mk_ansible_inv.py >hosts | |
ansible all -i hosts -m shell -a "/usr/sbin/ip -4 a" | |
ansible controllers -i hosts -m shell -a "uptime" | |
TODO add storage and ceph nodes |