This file contains 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 | |
SRCBR=br-int | |
PPORT=patch-tun | |
TAP=tap-${SRCBR} | |
OLD_PS1="$PS1" | |
cleanup() { | |
ovs-vsctl clear bridge ${SRCBR} mirrors |
This file contains 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/expect -f | |
set host [ lindex $argv 0 ] | |
set timeout 10 | |
set password xxxxxx | |
spawn ssh-copy-id root@${host} |
This file contains 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/sh | |
NODE1=10.71.84.53 | |
REGISTRY=quay.io/coreos/etcd | |
docker run \ | |
-p 2379:2379 \ | |
-p 2380:2380 \ | |
--name etcd ${REGISTRY}:latest \ | |
/usr/local/bin/etcd \ |
This file contains 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
package main | |
import ( | |
"fmt" | |
"os" | |
"strconv" | |
ipmi "github.com/vmware/goipmi" | |
) |
This file contains 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
create table election ( | |
id int(10) unsigned not null auto_increment, | |
name varchar(128) not null default '', | |
node varchar(128) not null default '', | |
last_seen timestamp not null default CURRENT_TIMESTAMP, | |
primary key (id), | |
unique key uniq_idx_name(name) | |
) engine=InnoDB; |
This file contains 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 | |
## purge record if resource_id is null | |
mysql -e "use transformer; delete from associations where resource_id='';" | |
mysql -e "use transformer; delete from associations where resource_type='OS::Cinder::VolumeAttachment';" | |
mysql -e "use transformer; drop table if exists tobe_deleted_ids; create table tobe_deleted_ids (resource_id varchar(80));" | |
## search nova related associations | |
mysql -e "insert into transformer.tobe_deleted_ids select resource_id from transformer.associations, (select uuid from nova.instances where nova.instances.deleted !=0) as vm where transformer.associations.resource_id=vm.uuid" |
This file contains 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 | |
if [ $# -ne 1 ]; then | |
echo "usage: $0 <volume id>" | |
fi | |
volume_id=$1 | |
## check if volume exists | |
if cinder show ${volume_id} | grep -q 'No volume'; then |
This file contains 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 | |
if [ $# -ne 1 ]; then | |
echo "usage: $0 <image name>" | |
exit | |
fi | |
image=$1 | |
rbd -p pool-beishu snap unprotect ${image}@snap | |
rbd -p pool-beishu snap rm ${image}@snap |
This file contains 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 | |
if [ $# -ne 1 ]; then | |
echo "usage: $0 <image name>" | |
exit | |
fi | |
image=$1 | |
rbd -p pool-beishu snap unprotect ${image}@snap | |
rbd -p pool-beishu snap rm ${image}@snap |
This file contains 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 | |
vpn_server=10.70.239.196 | |
vpn_tunnel_id=8 | |
vpn_ip_prefix=192.168.48 | |
vpn_monitor_port=50008 | |
ensure_tun_device() { | |
local host=$1 | |
local device=$2 |