====What is this page for====
* This page is for the HPC0 project 0x1 System Status Documentation.
====Documentation====
===VM-102===
* In order to start you have to login to the vmserver to create your vm
* Once logged in go to /etc/xen
* Run the following command (changing $HOSTNAME to whatever you want to call it)
# xen-create-image --hostname $HOSTNAME --pygrub --dist wheezy
* It takes a while (even longer if you forgot to set up the mirror)
* If you want to see what xen does while creating your image
* Go to /var/log/xen-tools and run
tail -f $HOSTNAME.log
* After putting in the default password now we have to change DNS and DHCP
* DNS is in /var/named/master, you have to edit both files
* In the 10.80.3 file I changed
102 IN PTR vm02.projects.lan.
* to
102 IN PTR vm-102.projects.lan.
* and in the projects.lan I changed
vm02 IN A 10.80.3.102
* to
vm-102 IN A 10.80.3.102
* Now onto DCHP, this is the file /etc/dhcpd.conf
* Under my own subgroup I added a few lines
host vm102.projects.lan {
hardware ethernet $ETHERNET;
fixed-address vm-102.projects.lan;
}
* If your to lazy (like me) to boot up your VM just to type ifconfig
* On the vmserver open up the file /etc/xen/$HOSTNAME.cfg and look for the networking subgroup
* After you type everything correctly run
# confupdate dns
# confupdate dhcp
===VM-103===
* I did the exact same thing as VM-102 just changing $HOSTNAME from VM-102 to VM-103
===Scripting===
* Im going to start at bkfirst so that will be my "Starting Point"
ssh-keygen
* You can run this as root or not, just remember where you did it
* At the starting point, after you run ssh-keygen, in .ssh folder under your user
* cp the .pub file to a different name named $FILE
* scp $FILE to both vms
* now append this file to authorized_keys on both vms
root@vm-###:~/.ssh# cat $FILE >> authorized_keys
* Script itself isn't very long but it gets the job done
#!/bin/bash
VM1='vm-102.projects.lan'
VM2='vm-103.projects.lan'
echo "VM-102"
echo "Uptime"
ssh root@$VM1 "uptime"
echo -e "\n"
echo "Free Space"
ssh root@$VM1 "df -h | grep rootfs"
echo -e "\n"
echo "VM-103"
echo "Uptime"
ssh root@$VM2 "uptime"
echo -e "\n"
echo "Free Space"
ssh root@$VM2 "df -h | grep rootfs"