Friday 18 September 2015

OVS sandbox VirtualBox - #6 - Running a machine

In this post, we start the machine to do the post-provisioning.

Launch the machine we just created from template, and start the (remote) console to observe the behavior.



Following, launch the configuration script at the Management machine, using the ovm tools. The configuration script is posted in the introduction page. Then we can observe the console to proceed to the root login, and in OVMM we can see the IP addresses assigned.

OVS sandbox VirtualBox - #4 - Configuring OVS

In this post, we configure the OVS.

Discover the servers at 192.168.56.102-103



Add storage Manager at 192.168.56.101







Add pool VBoxPool at 192.168.56.200





Add repo VBoxRepo




Add network VBoxNAT on the servers' eth0






Add network VBoxHostOnly on the servers' eth1



OVS sandbox VirtualBox - #3 - Installing OVS

The Server installs are also straight forward. Following the screenshots to setup the machine, and install the OS. Notice the 3 network interfaces. The first as NAT, the second as host-only which will be used for the primary management connection, and the third as NAT where we set the promiscuous mode to permit all.











Then following we add a mod to disable memory scrubbing to speed up the boot process:

# disable bootscrub to save on (unused) memory allocation (! Unsafe to use in real world !)
sed -i'' -e's/allowsuperpage/allowsuperpage\ bootscrub=false/g'  /boot/grub/grub.conf

OVS sandbox VirtualBox - #2 - Installing OVMM

The Manager install is straight forward. Following the screenshots to setup the machine, and install the OS.






















Then following we install some additional EL6.7 packages, required for the VirtualBox additions, and then the manager itself.

# connect
ssh root@192.168.56.101

# mount the install dvd, make sure you mount it to the machine first.
mkdir /media/dvd
mount -t iso9660 /dev/sr0 /media/dvd/
# If you want to disable online updates do:
mv /etc/yum.repos.d/public-yum-ol6.repo /etc/yum.repos.d/public-yum-ol6.repo.org
# Otherwise you can leave the online repo in place, but make sure then to issue
# yum -y update; # to update to the latest kernel and then reboot
# reboot;

# setup the local repo
echo "[local]" > /etc/yum.repos.d/local.repo
echo "name=Local Repository" >> /etc/yum.repos.d/local.repo
echo "baseurl=file:///media/dvd/Server/" >> /etc/yum.repos.d/local.repo
echo "gpgcheck=0" >> /etc/yum.repos.d/local.repo
echo "enabled=0" >> /etc/yum.repos.d/local.repo
echo "" >> /etc/yum.repos.d/local.repo
echo "[local_uek3]" >> /etc/yum.repos.d/local.repo
echo "name=Local UEK3 Repository" >> /etc/yum.repos.d/local.repo
echo "baseurl=file:///media/dvd/UEK3/" >> /etc/yum.repos.d/local.repo
echo "gpgcheck=0" >> /etc/yum.repos.d/local.repo
echo "enabled=0" >> /etc/yum.repos.d/local.repo
echo "" >> /etc/yum.repos.d/local.repo

# install additions for VirtualBox Guest Additions
yum -y install gcc --enablerepo=local
yum -y install kernel-uek-devel --enablerepo=local_uek3
# install Apache
yum -y install httpd --enablerepo=local
# enable service Apache
chkconfig httpd on
# disable service iptables
service iptables stop
chkconfig iptables off

# unload the DVD
umount /media/dvd/

# mount the Guest Additions Image
mount -t iso9660 /dev/sr0 /media/dvd/
sh /media/dvd/VBoxLinuxAdditions.run 

# if successful, unmount the dvd, or check /var/log/vbox*.log if unsuccessful
umount /media/dvd/

# put httpd user of Apache in vboxsf group
usermod -a -G vboxsf apache

# set the DocumentRoot for Apache, to point to the VirtualBox Shared Folder
sed -i'' -e's/\/var\/www\/html/\/media\/sf_Stage/g' /etc/httpd/conf/httpd.conf
# comment out welcome page on empty DocumentRoot
sed -i'' -e's/^[^#]/#/g' /etc/httpd/conf.d/welcome.conf 

# enable service nfs
chkconfig nfs on
# Expose our shares to the world (! Unsafe to use in real world !)
echo "/media/cluster *(rw,nohide,insecure,no_subtree_check,sync,no_root_squash)" > /etc/exports
echo "/media/repo *(rw,nohide,insecure,no_subtree_check,sync,no_root_squash)" >> /etc/exports

# Restert the cluster
service nfs restart
# Show the exports
exportfs

# set selinux off, required to get VirtualBox Guest Additions working
# with a shared folder exposed through Apache
sed -i'' -e's/SELINUX=.*/SELINUX=disabled/g' /etc/sysconfig/selinux
sed -i'' -e's/SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config

# update the hosts-file
echo -e "127.0.0.1\tmanager.local\tmanager" >> /etc/hosts

# reboot to activate the changes (disable selinux)
reboot;

Then we install the OVM Manager:

# connect
# Mount the OVMM333 disk to the cd-rom
mount -t udf,iso9660 /dev/sr0 /media/dvd
cd /media/dvd
sh createOracle.sh 
# fix the non-recognized OEL6.7; note 2040173.1, bug 21288328
mv /etc/oracle-release /etc/org.oracle-release.org
sh runInstaller.sh 
# Please enter your fully qualified domain name, e.g. ovs123.us.oracle.com, (or IP address) of your management server for SSL certification generation, more than one IP address are detected: 10.0.2.15 192.168.56.101 [10.0.2.15]: 192.168.56.101
#   https://192.168.56.101:7002/ovm/console
#   User: admin
mv /etc/org.oracle-release.org /etc/oracle-release
cd
umount /media/dvd

# remove the suggested file
rm -f /tmp/ovm_config*

# Install OVM Console VNC access
rpm -iv http://192.168.56.101/OVM333/ovmcore-console-1.0-42.el6.noarch.rpm

# Install the ovm utils 2.0.1
unzip -d /tmp -j /media/sf_Stage/OVM333/p13602094_30_Linux-x86-64.zip ovmutils/ovm_utils_2.0.1.zip
su - oracle -c "unzip -d /u01/app/oracle/ovm-manager-3 /tmp/ovm_utils_2.0.1.zip"
rm -f ovm_utils_2.0.1.zip

# Secure the ovm utilities 
# http://docs.oracle.com/cd/E50245_01/E50251/html/vmadm-utils-tcps.html
su - oracle
cd /u01/app/oracle/ovm-manager-3/bin
./secureOvmmTcpGenKeyStore.sh
./secureOvmmTcp.sh
exit;
service ovmm restart

# put oracle user in vboxsf group
usermod -a -G vboxsf oracle

Friday 18 September 2015

OVS sandbox VirtualBox - #6 - Running a machine

In this post, we start the machine to do the post-provisioning.

Launch the machine we just created from template, and start the (remote) console to observe the behavior.



Following, launch the configuration script at the Management machine, using the ovm tools. The configuration script is posted in the introduction page. Then we can observe the console to proceed to the root login, and in OVMM we can see the IP addresses assigned.

OVS sandbox VirtualBox - #4 - Configuring OVS

In this post, we configure the OVS.

Discover the servers at 192.168.56.102-103



Add storage Manager at 192.168.56.101







Add pool VBoxPool at 192.168.56.200





Add repo VBoxRepo




Add network VBoxNAT on the servers' eth0






Add network VBoxHostOnly on the servers' eth1



OVS sandbox VirtualBox - #3 - Installing OVS

The Server installs are also straight forward. Following the screenshots to setup the machine, and install the OS. Notice the 3 network interfaces. The first as NAT, the second as host-only which will be used for the primary management connection, and the third as NAT where we set the promiscuous mode to permit all.











Then following we add a mod to disable memory scrubbing to speed up the boot process:

# disable bootscrub to save on (unused) memory allocation (! Unsafe to use in real world !)
sed -i'' -e's/allowsuperpage/allowsuperpage\ bootscrub=false/g'  /boot/grub/grub.conf

OVS sandbox VirtualBox - #2 - Installing OVMM

The Manager install is straight forward. Following the screenshots to setup the machine, and install the OS.






















Then following we install some additional EL6.7 packages, required for the VirtualBox additions, and then the manager itself.

# connect
ssh root@192.168.56.101

# mount the install dvd, make sure you mount it to the machine first.
mkdir /media/dvd
mount -t iso9660 /dev/sr0 /media/dvd/
# If you want to disable online updates do:
mv /etc/yum.repos.d/public-yum-ol6.repo /etc/yum.repos.d/public-yum-ol6.repo.org
# Otherwise you can leave the online repo in place, but make sure then to issue
# yum -y update; # to update to the latest kernel and then reboot
# reboot;

# setup the local repo
echo "[local]" > /etc/yum.repos.d/local.repo
echo "name=Local Repository" >> /etc/yum.repos.d/local.repo
echo "baseurl=file:///media/dvd/Server/" >> /etc/yum.repos.d/local.repo
echo "gpgcheck=0" >> /etc/yum.repos.d/local.repo
echo "enabled=0" >> /etc/yum.repos.d/local.repo
echo "" >> /etc/yum.repos.d/local.repo
echo "[local_uek3]" >> /etc/yum.repos.d/local.repo
echo "name=Local UEK3 Repository" >> /etc/yum.repos.d/local.repo
echo "baseurl=file:///media/dvd/UEK3/" >> /etc/yum.repos.d/local.repo
echo "gpgcheck=0" >> /etc/yum.repos.d/local.repo
echo "enabled=0" >> /etc/yum.repos.d/local.repo
echo "" >> /etc/yum.repos.d/local.repo

# install additions for VirtualBox Guest Additions
yum -y install gcc --enablerepo=local
yum -y install kernel-uek-devel --enablerepo=local_uek3
# install Apache
yum -y install httpd --enablerepo=local
# enable service Apache
chkconfig httpd on
# disable service iptables
service iptables stop
chkconfig iptables off

# unload the DVD
umount /media/dvd/

# mount the Guest Additions Image
mount -t iso9660 /dev/sr0 /media/dvd/
sh /media/dvd/VBoxLinuxAdditions.run 

# if successful, unmount the dvd, or check /var/log/vbox*.log if unsuccessful
umount /media/dvd/

# put httpd user of Apache in vboxsf group
usermod -a -G vboxsf apache

# set the DocumentRoot for Apache, to point to the VirtualBox Shared Folder
sed -i'' -e's/\/var\/www\/html/\/media\/sf_Stage/g' /etc/httpd/conf/httpd.conf
# comment out welcome page on empty DocumentRoot
sed -i'' -e's/^[^#]/#/g' /etc/httpd/conf.d/welcome.conf 

# enable service nfs
chkconfig nfs on
# Expose our shares to the world (! Unsafe to use in real world !)
echo "/media/cluster *(rw,nohide,insecure,no_subtree_check,sync,no_root_squash)" > /etc/exports
echo "/media/repo *(rw,nohide,insecure,no_subtree_check,sync,no_root_squash)" >> /etc/exports

# Restert the cluster
service nfs restart
# Show the exports
exportfs

# set selinux off, required to get VirtualBox Guest Additions working
# with a shared folder exposed through Apache
sed -i'' -e's/SELINUX=.*/SELINUX=disabled/g' /etc/sysconfig/selinux
sed -i'' -e's/SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config

# update the hosts-file
echo -e "127.0.0.1\tmanager.local\tmanager" >> /etc/hosts

# reboot to activate the changes (disable selinux)
reboot;

Then we install the OVM Manager:

# connect
# Mount the OVMM333 disk to the cd-rom
mount -t udf,iso9660 /dev/sr0 /media/dvd
cd /media/dvd
sh createOracle.sh 
# fix the non-recognized OEL6.7; note 2040173.1, bug 21288328
mv /etc/oracle-release /etc/org.oracle-release.org
sh runInstaller.sh 
# Please enter your fully qualified domain name, e.g. ovs123.us.oracle.com, (or IP address) of your management server for SSL certification generation, more than one IP address are detected: 10.0.2.15 192.168.56.101 [10.0.2.15]: 192.168.56.101
#   https://192.168.56.101:7002/ovm/console
#   User: admin
mv /etc/org.oracle-release.org /etc/oracle-release
cd
umount /media/dvd

# remove the suggested file
rm -f /tmp/ovm_config*

# Install OVM Console VNC access
rpm -iv http://192.168.56.101/OVM333/ovmcore-console-1.0-42.el6.noarch.rpm

# Install the ovm utils 2.0.1
unzip -d /tmp -j /media/sf_Stage/OVM333/p13602094_30_Linux-x86-64.zip ovmutils/ovm_utils_2.0.1.zip
su - oracle -c "unzip -d /u01/app/oracle/ovm-manager-3 /tmp/ovm_utils_2.0.1.zip"
rm -f ovm_utils_2.0.1.zip

# Secure the ovm utilities 
# http://docs.oracle.com/cd/E50245_01/E50251/html/vmadm-utils-tcps.html
su - oracle
cd /u01/app/oracle/ovm-manager-3/bin
./secureOvmmTcpGenKeyStore.sh
./secureOvmmTcp.sh
exit;
service ovmm restart

# put oracle user in vboxsf group
usermod -a -G vboxsf oracle