Skip to content

Instantly share code, notes, and snippets.

View j-griffith's full-sized avatar

John Griffith j-griffith

  • Bozeman, Montana
View GitHub Profile
@j-griffith
j-griffith / fake_trim.sh
Last active September 28, 2015 22:56
Trigger internal trim on SF volume
if [ $# -ne 3 ]; then
echo
echo "Usage: $0 <filename> <size> <device>"
echo
echo "<filename> is a temporary file for the test"
echo "<size> is the file size in MB NOTE, this needs to be very large on the order of free-capacity - safetyBuffer"
echo "<device> is the device being trimmed, e.g. /dev/vda"
echo
echo "Example: $0 tempfile 5 /dev/vda"
echo
ubuntu@cloud-ctrlr:/opt/stack/nova/nova$ sudo tgtadm --lld iscsi --op show --mode target
Target 1: iqn.2010-10.org.openstack:volume-4db09d81-f9ac-489a-91f2-e1748dacc96e
System information:
Driver: iscsi
State: ready
I_T nexus information:
I_T nexus: 1
Initiator: iqn.1993-08.org.debian:01:a964455de45e alias: cloud-ctrlr
Connection: 0
IP Address: 11.0.0.13
@j-griffith
j-griffith / gist:bc044be0c788b4aef361
Created January 21, 2016 23:17
xnode script and startup
#!/bin/bash
xtest --cluster-create=1 --bindir=/sf/bin/ --nodes=1 --block-size=2368709120 --mipi eth0 --mip $2 --sipi eth0 --sip $2 --mvip $1 --svip $3 --xterm=0 -- --webpath=/sf/etc/webmgmt/ --pcachenumfiles=16 --pcachefilesizemb=5 --gcinterval=15
./start_xnode.sh 192.168.1.12 192.168.1.14 192.168.1.15
FROM gentoo/stage3-amd64
MAINTAINER John Griffith <[email protected]>
RUN emerge-webrsync; etc-update --automode -5
# The exit 0 below is a hack because we're going to get a 1 return code
# because of needed updates, but typically NOT because the sync failed
RUN emerge =app-portage/layman-2.3.0-r1 --autounmask-write; exit 0
RUN etc-update --automode -5
RUN echo "app-portage/layman git mercurial sync-plugin-portage" >> /etc/portage/package.use/app-portage
RUN emerge layman
34bf503002ae .subversion # emerge solidfire-libs
* IMPORTANT: 10 news items need reading for repository 'gentoo'.
* Use eselect news read to view new items.
Calculating dependencies... done!
>>> Verifying ebuild manifests
>>> Emerging (1 of 2) sys-cluster/zookeeper-solidfire-3.5.0-r23::solidfire
@j-griffith
j-griffith / configure_docker0.sh
Created September 2, 2016 03:36 — forked from kamermans/configure_docker0.sh
Change the IP subnet of Docker's docker0 interface
#!/bin/sh -e
#
# You can run this script directly from github as root like this:
# curl -sS https://gist.githubusercontent.com/kamermans/94b1c41086de0204750b/raw/configure_docker0.sh | sudo bash -s - 192.168.254.1/24
#
# * Make sure you replace "192.168.254.0/24" with the network that you want to use
#
# NOTE: This script is intended for Debian / Ubuntu only!
if [ $# -lt 1 ]; then
@j-griffith
j-griffith / bp.sh
Created February 15, 2017 20:53
openstack backport script from Vish
#!/usr/bin/env bash
# This little script is to make backporting patches easier.
# Instructions
# ------------
# Make sure that <btranch> exists:
# git branch -D <branch>
# git checkout -b <branch> origin/<branch>
# Grab the file and stick it in your <project> directory:
# curl -OL https://raw.github.com/gist/2206428/bp.sh
# Make sure the script is runnable:
@j-griffith
j-griffith / docker-iscsi
Last active February 2, 2022 16:45
Docker iscsi in container run cmd
# This will use the hosts iscsid
docker run -it --net=host --privileged -v /etc/localtime:/etc/localtime:ro \
-v /lib/modules:/lib/modules:ro \
-v /run:/run:shared -v /dev:/dev \
-v /etc/iscsi:/etc/iscsi \
-v /home/jgriffith/vol:/Mount:shared ubuntu bash
# shared declaration on Mount matters!
# You can also put iscsid in another container, share the socket
#!/usr/bin/python
import os
import brick_cinderclient_ext
from cinderclient import client
from cinderclient.contrib import noauth
from keystoneauth1 import loading
from keystoneauth1 import session
brctl addbr br0
brctl addif br0 enp2s0f1
brctl setfd br0 0
ifconfig br0 10.117.36.106 netmask 255.255.255.0
service networking restart
docker network create --ip-range=10.117.36.0/25 --subnet=10.117.36.0/25 -o "com.docker.network.brige.name=br0" br0