Last active
August 29, 2015 13:56
-
-
Save sustr4/9052171 to your computer and use it in GitHub Desktop.
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/sh | |
#Early steps, just to be sure | |
apt-get update | |
apt-get upgrade -y | |
#NFS Server -- Cargo Cult ;-) | |
apt-get install -y nfs-kernel-server | |
echo '/var/lib/one *(rw,sync,no_subtree_check,root_squash,anonuid=9869,anongid=9869)' >> /etc/exports | |
#Install ONe | |
wget http://downloads.opennebula.org/repo/Debian/repo.key | |
apt-key add repo.key | |
echo "deb http://downloads.opennebula.org/repo/Debian/7 stable opennebula" > /etc/apt/sources.list.d/opennebula.list | |
echo "deb http://downloads.opennebula.org/repo/4.12/Debian/7 stable opennebula" > /etc/apt/sources.list.d/opennebula.list | |
apt-get update | |
apt-get install -y opennebula opennebula-sunstone | |
#Augment Config if necessary (Nested testing environment) | |
sed -i 's/"kvm" ]/"qemu" ]/' /etc/one/oned.conf | |
sed -i 's/127.0.0.1/0.0.0.0/' /etc/one/sunstone-server.conf | |
#Start | |
/etc/init.d/nfs-kernel-server start | |
#service libvirtd start | |
/etc/init.d/opennebula restart | |
/etc/init.d/opennebula-sunstone restart | |
#possibly set qemu emulation | |
apt-get install -y opennebula-node qemu qemu-utils libvirt-bin | |
sed -i 's/#EMULATOR.*$/EMULATOR = \/usr\/bin\/qemu/' /etc/one/vmm_exec/vmm_exec_kvm.conf | |
/etc/init.d/opennebula restart | |
#Network bridge | |
brctl addbr vbr0 | |
ifconfig vbr0 up | |
#check access details | |
su - oneadmin | |
echo Log in to SunStone at https://`hostname -f`:9869;echo Log in details: `cat /var/lib/one/.one/one_auth` | |
#Set up test template | |
# Disk | |
oneimage create -d default --name ttylinux --path http://opennebula-marketplace.s3.amazonaws.com/ttylinux.img | |
oneimage chmod ttylinux 666 | |
#Network | |
printf "NAME = example\nTYPE = RANGED\nBRIDGE = vbr0\nNETWORK_SIZE = C\nNETWORK_ADDRESS = 192.168.0.0\nGATEWAY = 192.168.0.1\nDNS = 192.168.0.1\nLOAD_BALANCER = 192.168.0.3\n" > example.net | |
onevnet create example.net | |
onevnet addar example --ip 192.168.0.100 --size 100 | |
#Create template and make it visible | |
onetemplate create --name "ttylinux" --memory 128 --cpu 1 --disk oneadmin[ttylinux] --nic oneadmin[example] | |
onetemplate chmod ttylinux 666 | |
#Host | |
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys | |
ssh-keyscan -t ecdsa,rsa $(hostname -f) >> ~/.ssh/known_hosts | |
#create network 'private' | |
onehost create $(hostname -f) -i kvm -v kvm -n dummy | |
#logoff | |
exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment