#!/bin/bash -xe # make it so vms can traverse the vpn VPNIP=$(/sbin/ifconfig redhat0|grep inet |awk '{print $2}') sudo iptables -L -t nat -n |grep "$VPNIP" || \ sudo iptables -t nat -A POSTROUTING -o redhat0 -j SNAT --to-source $VPNIP nova keypair-list |awk -F '|' '{print $2}' |grep default || \ nova keypair-add --pub-key ~/.ssh/id_rsa.pub default glance image-list |awk -F '|' '{print $3}'|grep f21 || \ glance image-create --name f21 --is-public True --disk-format qcow2 --container-format bare --location http://download.fedoraproject.org/pub/fedora/linux/releases/21/Cloud/Images/x86_64/Fedora-Cloud-Base-20141203-21.x86_64.qcow2