Tuesday, 29 December 2015

Create OVS templates

Problem

The rebuild OracleLinux templates for OVS are perfect for a headstart: they have the OVS templates pre-configured. They are perfect, except for one small omission. They have been recently updated with some patches, updating the contents to a newer version then available on the installer (shipping) version. If you don't happen to have an internet connection to the public-yum.oracle.com, nor have a local (mirror) repo, you may find those templates unusable due to missing dependencies. Observe this:

[root@test ~]# yum install gcc
Loaded plugins: security, ulninfo
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package gcc.x86_64 0:4.4.7-16.el6 will be installed
--> Processing Dependency: libgomp = 4.4.7-16.el6 for package: gcc-4.4.7-16.el6.x86_64
--> Processing Dependency: cpp = 4.4.7-16.el6 for package: gcc-4.4.7-16.el6.x86_64
--> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc-4.4.7-16.el6.x86_64
--> Processing Dependency: cloog-ppl >= 0.15 for package: gcc-4.4.7-16.el6.x86_64
--> Processing Dependency: libgomp.so.1()(64bit) for package: gcc-4.4.7-16.el6.x86_64
--> Running transaction check
---> Package cloog-ppl.x86_64 0:0.15.7-1.2.el6 will be installed
--> Processing Dependency: libppl_c.so.2()(64bit) for package: cloog-ppl-0.15.7-1.2.el6.x86_64
--> Processing Dependency: libppl.so.7()(64bit) for package: cloog-ppl-0.15.7-1.2.el6.x86_64
---> Package cpp.x86_64 0:4.4.7-16.el6 will be installed
--> Processing Dependency: libmpfr.so.1()(64bit) for package: cpp-4.4.7-16.el6.x86_64
---> Package glibc-devel.x86_64 0:2.12-1.166.el6 will be installed
--> Processing Dependency: glibc-headers = 2.12-1.166.el6 for package: glibc-devel-2.12-1.166.el6.x86_64
--> Processing Dependency: glibc = 2.12-1.166.el6 for package: glibc-devel-2.12-1.166.el6.x86_64
--> Processing Dependency: glibc-headers for package: glibc-devel-2.12-1.166.el6.x86_64
---> Package libgomp.x86_64 0:4.4.7-16.el6 will be installed
--> Running transaction check
---> Package glibc.i686 0:2.12-1.166.el6 will be installed
--> Processing Dependency: glibc-common = 2.12-1.166.el6 for package: glibc-2.12-1.166.el6.i686
--> Processing Dependency: libfreebl3.so(NSSRAWHASH_3.12.3) for package: glibc-2.12-1.166.el6.i686
--> Processing Dependency: libfreebl3.so for package: glibc-2.12-1.166.el6.i686
---> Package glibc-headers.x86_64 0:2.12-1.166.el6 will be installed
--> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers-2.12-1.166.el6.x86_64
--> Processing Dependency: kernel-headers for package: glibc-headers-2.12-1.166.el6.x86_64
---> Package mpfr.x86_64 0:2.4.1-6.el6 will be installed
---> Package ppl.x86_64 0:0.10.2-11.el6 will be installed
--> Running transaction check
---> Package glibc.i686 0:2.12-1.166.el6 will be installed
--> Processing Dependency: glibc-common = 2.12-1.166.el6 for package: glibc-2.12-1.166.el6.i686
---> Package kernel-headers.x86_64 0:2.6.32-573.el6 will be installed
---> Package nss-softokn-freebl.i686 0:3.14.3-22.el6_6 will be installed
--> Finished Dependency Resolution
Error: Package: glibc-2.12-1.166.el6.i686 (local)
           Requires: glibc-common = 2.12-1.166.el6
           Installed: glibc-common-2.12-1.166.el6_7.1.x86_64 (installed)
               glibc-common = 2.12-1.166.el6_7.1
           Available: glibc-common-2.12-1.166.el6.x86_64 (local)
               glibc-common = 2.12-1.166.el6
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
[root@test ~]#

The glib-common has been replaced from the shipping media default 2.12-1.166.el6 to 2.12-1.166.el6_7.1.

Solution

We create our own template, based on the installer media, available to us.

Preparation

Install a default server, having a NIC and a 12G new virtual disk. Using the ISO installer, e.g. we install OL6.7 here.

  • Install without configuring a network
  • Set timezone to Europe/Amsterdam
  • Set a temp root password (anything except empty string)
  • Create custom layout
    • 200M /boot partition (force primary)
    • 1G swap partition (force primary)
    • remaining space /root partition (force primary)
  • Install bootloader into /dev/xvda
  • Install Basic Server

At the end of the install process (after reboot), stop the machine.

Configuration


We now have a disk, which we can mount at any other (existing) machine as an additional disk. On that machine, we can chroot to further prepare the machine.

  • Deattach the disk from the default server
  • Attach the disk to another (already running/configured) machine
# See it being attached, make note of the disk name, here xvdc: we need the third partition.
dmesg|tail
blkfront: xvdc: flush diskcache: enabled; persistent grants: enabled; indirect descriptors: enabled;
xvdc: xvdc1 xvdc2 xvdc3

Now we can configure this disk.

mydisk=/dev/xvdc3
mymount=/media/mytemplate
myarch=x86_64 # alternative=i386
mypackages="libovmapi libovmapi-devel ovmd python-simplejson xenstoreprovider ovm-template-config  ovm-template-config-authentication ovm-template-config-datetime ovm-template-config-firewall ovm-template-config-network ovm-template-config-selinux ovm-template-config-ssh ovm-template-config-system ovm-template-config-user libovmapi xenstoreprovider ovmd python-simplejson xenstoreprovider oracle-rdbms-server-12cR1-preinstall wget dos2unix zip unzip screen nc expect"
# mount the disks
mkdir -p ${mymount}
mount ${mydisk} ${mymount}
# Add the resolver
echo "search local" > ${mymount}/etc/resolv.conf
echo "nameserver 192.186.2.2" >> ${mymount}/etc/resolv.conf
echo "nameserver 192.186.2.4" >> ${mymount}/etc/resolv.conf
# Change the public-yum to point to public-yum.local
sed -i'' -e's/oracle.com/local/g' ${mymount}/etc/yum.repos.d/public-yum-ol6.repo
# Change root into the disk, using x86_64 architecture, and install software ovm template
chroot ${mymount} /usr/bin/setarch ${myarch} yum --assumeyes --enablerepo=*addons install ${mypackages}
# Disable selinux
sed -i'' -e's/SELINUX=enforcing/SELINUX=disabled/g' ${mymount}/etc/sysconfig/selinux
# Disable iptables
chroot ${mymount} chkconfig iptables off
chroot ${mymount} chkconfig ip6tables off
# Configure the OVM template initial run
sed -i -e's/INITIAL_CONFIG=no/INITIAL_CONFIG=yes/g' ${mymount}/etc/sysconfig/ovmd
# Add user agent12c as example. It makes sense to add the shared key for oracle and root too.
chroot ${mymount} useradd -G dba agent12c
chroot ${mymount} su - agent12c -c "mkdir .ssh;chmod 700 .ssh;touch .ssh/authorized_keys; chmod 700 .ssh/authorized_keys"
echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAqmwDETdBnHx4J1+JHRJsAhgJ+R//+6UsQMSO+ih0yPBn9txv1SaoIwEsYKyakQyx6y4Du1wn3gV68q2xB0p3cP7w+FjGNEXQsZtqlN6qRFvkiWwzce7I1vV8DucpHuySFtVaZlMh/bRAa3etEm3ew/XMX1xuchCFl4jcpigvGcVTxLkCffg5Mcti/6SJvQs8amTB09cVsxgnwbgAu/xAww+w4m+EiwcfgaaHyQxO17qXEee37uLlFaKnurX3UA+qg984UF6N6i4Ijfz53gWcQv1CawFIec8wEBu8Ylb+T2mPwJBdkK+YIe0VBVx9hbEFtPYz4n2fTSPxyVRnyptxPw== agent12c@spc.local" >> ${mymount}/home/agent12c/.ssh/authorized_keys
# Add agent12c to sudoers
echo "" >> ${mymount}/etc/sudoers
echo "agent12c ALL=(ALL) NOPASSWD:ALL" >> ${mymount}/etc/sudoers
# Disable tty requirement
sed -i'' -e's/^Defaults\ \ \ \ requiretty/#\0/g' ${mymount}/etc/sudoers
# Clear settings
chroot ${mymount} /usr/bin/setarch ${myarch} yum clean all
rm -fR ${mymount}/tmp/*
rm -fR ${mymount}/root/.bash_history
# unmount the disks
umount ${mymount}
rmdir ${mymount}

Finalizing


All we now have to do, is create a OVS template of the disk.
  • Deattach the disk from the running/configured machine
  • Reattach it the default machine
  • Create a new OVM template, based on the default machine

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

Tuesday, 29 December 2015

Create OVS templates

Problem

The rebuild OracleLinux templates for OVS are perfect for a headstart: they have the OVS templates pre-configured. They are perfect, except for one small omission. They have been recently updated with some patches, updating the contents to a newer version then available on the installer (shipping) version. If you don't happen to have an internet connection to the public-yum.oracle.com, nor have a local (mirror) repo, you may find those templates unusable due to missing dependencies. Observe this:

[root@test ~]# yum install gcc
Loaded plugins: security, ulninfo
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package gcc.x86_64 0:4.4.7-16.el6 will be installed
--> Processing Dependency: libgomp = 4.4.7-16.el6 for package: gcc-4.4.7-16.el6.x86_64
--> Processing Dependency: cpp = 4.4.7-16.el6 for package: gcc-4.4.7-16.el6.x86_64
--> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc-4.4.7-16.el6.x86_64
--> Processing Dependency: cloog-ppl >= 0.15 for package: gcc-4.4.7-16.el6.x86_64
--> Processing Dependency: libgomp.so.1()(64bit) for package: gcc-4.4.7-16.el6.x86_64
--> Running transaction check
---> Package cloog-ppl.x86_64 0:0.15.7-1.2.el6 will be installed
--> Processing Dependency: libppl_c.so.2()(64bit) for package: cloog-ppl-0.15.7-1.2.el6.x86_64
--> Processing Dependency: libppl.so.7()(64bit) for package: cloog-ppl-0.15.7-1.2.el6.x86_64
---> Package cpp.x86_64 0:4.4.7-16.el6 will be installed
--> Processing Dependency: libmpfr.so.1()(64bit) for package: cpp-4.4.7-16.el6.x86_64
---> Package glibc-devel.x86_64 0:2.12-1.166.el6 will be installed
--> Processing Dependency: glibc-headers = 2.12-1.166.el6 for package: glibc-devel-2.12-1.166.el6.x86_64
--> Processing Dependency: glibc = 2.12-1.166.el6 for package: glibc-devel-2.12-1.166.el6.x86_64
--> Processing Dependency: glibc-headers for package: glibc-devel-2.12-1.166.el6.x86_64
---> Package libgomp.x86_64 0:4.4.7-16.el6 will be installed
--> Running transaction check
---> Package glibc.i686 0:2.12-1.166.el6 will be installed
--> Processing Dependency: glibc-common = 2.12-1.166.el6 for package: glibc-2.12-1.166.el6.i686
--> Processing Dependency: libfreebl3.so(NSSRAWHASH_3.12.3) for package: glibc-2.12-1.166.el6.i686
--> Processing Dependency: libfreebl3.so for package: glibc-2.12-1.166.el6.i686
---> Package glibc-headers.x86_64 0:2.12-1.166.el6 will be installed
--> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers-2.12-1.166.el6.x86_64
--> Processing Dependency: kernel-headers for package: glibc-headers-2.12-1.166.el6.x86_64
---> Package mpfr.x86_64 0:2.4.1-6.el6 will be installed
---> Package ppl.x86_64 0:0.10.2-11.el6 will be installed
--> Running transaction check
---> Package glibc.i686 0:2.12-1.166.el6 will be installed
--> Processing Dependency: glibc-common = 2.12-1.166.el6 for package: glibc-2.12-1.166.el6.i686
---> Package kernel-headers.x86_64 0:2.6.32-573.el6 will be installed
---> Package nss-softokn-freebl.i686 0:3.14.3-22.el6_6 will be installed
--> Finished Dependency Resolution
Error: Package: glibc-2.12-1.166.el6.i686 (local)
           Requires: glibc-common = 2.12-1.166.el6
           Installed: glibc-common-2.12-1.166.el6_7.1.x86_64 (installed)
               glibc-common = 2.12-1.166.el6_7.1
           Available: glibc-common-2.12-1.166.el6.x86_64 (local)
               glibc-common = 2.12-1.166.el6
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
[root@test ~]#

The glib-common has been replaced from the shipping media default 2.12-1.166.el6 to 2.12-1.166.el6_7.1.

Solution

We create our own template, based on the installer media, available to us.

Preparation

Install a default server, having a NIC and a 12G new virtual disk. Using the ISO installer, e.g. we install OL6.7 here.

  • Install without configuring a network
  • Set timezone to Europe/Amsterdam
  • Set a temp root password (anything except empty string)
  • Create custom layout
    • 200M /boot partition (force primary)
    • 1G swap partition (force primary)
    • remaining space /root partition (force primary)
  • Install bootloader into /dev/xvda
  • Install Basic Server

At the end of the install process (after reboot), stop the machine.

Configuration


We now have a disk, which we can mount at any other (existing) machine as an additional disk. On that machine, we can chroot to further prepare the machine.

  • Deattach the disk from the default server
  • Attach the disk to another (already running/configured) machine
# See it being attached, make note of the disk name, here xvdc: we need the third partition.
dmesg|tail
blkfront: xvdc: flush diskcache: enabled; persistent grants: enabled; indirect descriptors: enabled;
xvdc: xvdc1 xvdc2 xvdc3

Now we can configure this disk.

mydisk=/dev/xvdc3
mymount=/media/mytemplate
myarch=x86_64 # alternative=i386
mypackages="libovmapi libovmapi-devel ovmd python-simplejson xenstoreprovider ovm-template-config  ovm-template-config-authentication ovm-template-config-datetime ovm-template-config-firewall ovm-template-config-network ovm-template-config-selinux ovm-template-config-ssh ovm-template-config-system ovm-template-config-user libovmapi xenstoreprovider ovmd python-simplejson xenstoreprovider oracle-rdbms-server-12cR1-preinstall wget dos2unix zip unzip screen nc expect"
# mount the disks
mkdir -p ${mymount}
mount ${mydisk} ${mymount}
# Add the resolver
echo "search local" > ${mymount}/etc/resolv.conf
echo "nameserver 192.186.2.2" >> ${mymount}/etc/resolv.conf
echo "nameserver 192.186.2.4" >> ${mymount}/etc/resolv.conf
# Change the public-yum to point to public-yum.local
sed -i'' -e's/oracle.com/local/g' ${mymount}/etc/yum.repos.d/public-yum-ol6.repo
# Change root into the disk, using x86_64 architecture, and install software ovm template
chroot ${mymount} /usr/bin/setarch ${myarch} yum --assumeyes --enablerepo=*addons install ${mypackages}
# Disable selinux
sed -i'' -e's/SELINUX=enforcing/SELINUX=disabled/g' ${mymount}/etc/sysconfig/selinux
# Disable iptables
chroot ${mymount} chkconfig iptables off
chroot ${mymount} chkconfig ip6tables off
# Configure the OVM template initial run
sed -i -e's/INITIAL_CONFIG=no/INITIAL_CONFIG=yes/g' ${mymount}/etc/sysconfig/ovmd
# Add user agent12c as example. It makes sense to add the shared key for oracle and root too.
chroot ${mymount} useradd -G dba agent12c
chroot ${mymount} su - agent12c -c "mkdir .ssh;chmod 700 .ssh;touch .ssh/authorized_keys; chmod 700 .ssh/authorized_keys"
echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAqmwDETdBnHx4J1+JHRJsAhgJ+R//+6UsQMSO+ih0yPBn9txv1SaoIwEsYKyakQyx6y4Du1wn3gV68q2xB0p3cP7w+FjGNEXQsZtqlN6qRFvkiWwzce7I1vV8DucpHuySFtVaZlMh/bRAa3etEm3ew/XMX1xuchCFl4jcpigvGcVTxLkCffg5Mcti/6SJvQs8amTB09cVsxgnwbgAu/xAww+w4m+EiwcfgaaHyQxO17qXEee37uLlFaKnurX3UA+qg984UF6N6i4Ijfz53gWcQv1CawFIec8wEBu8Ylb+T2mPwJBdkK+YIe0VBVx9hbEFtPYz4n2fTSPxyVRnyptxPw== agent12c@spc.local" >> ${mymount}/home/agent12c/.ssh/authorized_keys
# Add agent12c to sudoers
echo "" >> ${mymount}/etc/sudoers
echo "agent12c ALL=(ALL) NOPASSWD:ALL" >> ${mymount}/etc/sudoers
# Disable tty requirement
sed -i'' -e's/^Defaults\ \ \ \ requiretty/#\0/g' ${mymount}/etc/sudoers
# Clear settings
chroot ${mymount} /usr/bin/setarch ${myarch} yum clean all
rm -fR ${mymount}/tmp/*
rm -fR ${mymount}/root/.bash_history
# unmount the disks
umount ${mymount}
rmdir ${mymount}

Finalizing


All we now have to do, is create a OVS template of the disk.
  • Deattach the disk from the running/configured machine
  • Reattach it the default machine
  • Create a new OVM template, based on the default machine

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