Skip to content

Instantly share code, notes, and snippets.

# Make sure REG_SCRIPT and INITIMAGE make sense! (and the other vars, while you are at it)
export FOREMAN_NODE=fore1a
VMSET_CHUNK=sw1a
NUM_CLIS=3
REG_SCRIPT=<your yum or rhn setup script>
export PATH=$PATH:/mnt/vm-share/vftool
cd /mnt/vm-share/vftool
# install the foreman client vm's
# Installs libvirt, vftool.bash, readies a foreman server with three
# clients, and starts vncserver. Intended to be run on a fresh el6
# system to get a working development environment. If you already
# have VM's / libvirt running on your system, you probably don't want
# to run this script (things like the default network and storage pool
# path get changed during the "./vftool" commands).
export INSTALLURL=<your el6 repo, e.g. http://<your host>/6.5/Server/x86_64/os/>
export REG_SCRIPT=<path to script that registers/points host to el and openstack (rdo or rhos) repos>
export INITIMAGE=rhel65
@cwolferh
cwolferh / ooo-f19-dev.bash
Last active December 20, 2015 13:09
attempting a tripleo dev env on fedora 19
#!/bin/bash
setenforce 0
service firewalld stop
yum -y install busybox
TRIPLEO_ROOT=${TRIPLE_ROOT:=~/tripleo-fedora-`date +%Y-%m-%d`}
export PATH=$PATH:$TRIPLEO_ROOT/incubator/scripts
export ELEMENTS_PATH=$TRIPLEO_ROOT/tripleo-image-elements/elements
#!/bin/bash
# PUPPETMASTER is the fqdn that needs to be resolvable by clients.
# Change if needed
if [ "x$PUPPETMASTER" = "x" ]; then
# Set PuppetServer
#export PUPPETMASTER=puppet.example.com
export PUPPETMASTER=$(hostname)
fi
# Install mysql using scl ruby+puppet on rhel6
cat >/tmp/mysql-db.pp <<EOF
class { 'mysql::server':
config_hash => {
'root_password' => 'mysql'
}
}
# on fedora 18, install libguestfs from source instead of yum.
# otherwise, guestconv calls to the libguestfs would fail like so:
#
# Exception AttributeError: "'GuestFS' object has no attribute '_o'" in <bound method GuestFS.__del__ of <guestfs.GuestFS object at 0x2595250>> ignored
# Traceback (most recent call last):
# File "examples/example.py", line 27, in <module>
# g = guestconv.Converter('rhev', ['conf/guestconv.db']);
# File "../guestconv/guestconv/converter.py", line 89, in __init__
# self._h = guestfs.GuestFS(python_return_dict=True)
# quickly bring up a Fedora 18 image. root on host OS should be able
# to ssh into the guest without a password.
# assumption: libvirtd already running
sudo sh -c "cd /var/lib/libvirt/images/
if [ ! -f Fedora18-Cloud-x86_64-20130115.qcow2 ]; then
wget http://mattdm.fedorapeople.org/cloud-images/Fedora18-Cloud-x86_64-20130115.qcow2
else
echo Fedora18-Cloud-x86_64-20130115.qcow2 already present.
fi
# On Fedora 18, install libvirt dependencies (and a few more) and
# start libvirtd. turn off selinux, enable ip forwarding, turn off
# firewall.
sudo sysctl -w net.ipv4.ip_forward=1
sudo sed -i 's/net.ipv4.ip_forward = 0/net.ipv4.ip_forward = 1/g' /usr/lib/sysctl.d/00-system.conf
sudo setenforce 0
sudo systemctl stop firewalld
depends="nfs-utils libguestfs-tools libvirt virt-manager git mysql-server tigervnc-server tigervnc-server-module tigervnc xorg-x11-twm xorg-x11-server-utils"
@cwolferh
cwolferh / virt
Created April 18, 2013 20:12 — forked from tomassedovic/virt
#!/bin/bash
if [[ $# == 0 ]]; then
echo Usage:
echo "virt <command> <vm> args"
echo Command is: ip, ssh, scp, sshfs
exit 1
fi
cmd="$1"; shift
@cwolferh
cwolferh / packstack-vms-build.bash
Last active December 14, 2015 21:39
RHEL64-based script to build and start 3 Fedora 18 VM's for packstack.
#!/bin/bash
#
# This script is intended to ultimately "just work" on RHEL6, setting
# up a grizzly openstack implementation on three Fedora 18 guest VM's
# using the packstack installer. It currently does not work due to a
# dependency error with openstack-nova-conductor not being available.
#
# It creates 3 Fedora-18 VM's for packstack/openstack-grizzly. Each
# has two nic's. The first nic is connected to the virt default
# network. The second is connected to the virt openstackvms network