Friday, 18 September 2015

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

OVS sandbox VirtualBox - #1 - Introduction

Following the previous post Can we emulate OVM inside VirtualBox ? #2, let's walk through the setup to get to a working set of Oracle Virtual Server on top of VirtualBox.

This is almost similar to the OVM server farm sandbox which was done on VMWare.

Where last time, we did the exercise on
2,3 GHz Intel Core I7 4850HQ "Haswell"
6 MB shared L3 cache
16GB ram
while this time we go for

3,1 GHz Intel Core i7 5557U "Broadwell"
4 MB shared L3 cache
16GB ram

The used sources are:
Furthermore, handy to download some ovf templates
  • OVM_OL5U11_x86_64_PVM (V73663-01.zip) - Edelivery
  • OVM_OL6U6_x86_64_PVM (V73659-01.zip) - Edelivery
  • OVM_OL7U1_x86_64_PVHVM (V75785-01.zip) - Edelivery
And the following script we use for the host provisioning. Save it under the name Ovm_configure_vm.bash
#!/bin/bash
 
export VM_NAME="OEL6.0"
#export VM_IP="10.0.2.100"
export VM_HOSTNAME="oel60"
export VM_DOMAINNAME="local"
export VM_ORACLE_PASS="Welcome1"
export VM_ROOT_PASS="Welcome1"
# Below line is the "admin" password for the OVM Management access
export OVMUTIL_PASS="Welcome1"
export OVM_VMM="/u01/app/oracle/ovm-manager-3/ovm_utils/ovm_vmmessage"
 
paramSet () {
   echo "[$VM_NAME] setting [$1] to [$2]"
   $OVM_VMM -u admin -E -h localhost -v "$VM_NAME" -k "$1" -V "$2"
}
 
# selinux
paramSet com.oracle.linux.selinux.mode permissive
 
# firewall
paramSet com.oracle.linux.network.firewall False
 
# date/time/timezone
paramSet com.oracle.linux.datetime.timezone "Europe/Amsterdam"
paramSet com.oracle.linux.datetime.utc True
paramSet com.oracle.linux.datetime.ntp True
paramSet com.oracle.linux.datetime.ntp-servers 10.0.2.2
paramSet com.oracle.linux.datetime.ntp-local-time-source False
 
# network
paramSet com.oracle.linux.network.hostname "$VM_HOSTNAME.$VM_DOMAINNAME"
paramSet com.oracle.linux.network.host.0 "$VM_HOSTNAME"
paramSet com.oracle.linux.network.device.0 eth0
#paramSet com.oracle.linux.network.hwaddr.0
#paramSet com.oracle.linux.network.mtu.0
#paramSet com.oracle.linux.network.onboot.0 yes
#paramSet com.oracle.linux.network.bootproto.0 static
#paramSet com.oracle.linux.network.ipaddr.0 $VM_IP
#paramSet com.oracle.linux.network.netmask.0 255.255.255.0
#paramSet com.oracle.linux.network.gateway.0 10.0.2.2
#paramSet com.oracle.linux.network.dns-servers.0 10.0.2.2.2,8.8.8.8
#paramSet com.oracle.linux.network.dns-search-domains.0 "$VM_DOMAINNAME"
paramSet com.oracle.linux.network.onboot.0 yes
paramSet com.oracle.linux.network.bootproto.0 dhcp
paramSet com.oracle.linux.network.device.1 eth1
paramSet com.oracle.linux.network.onboot.1 yes
paramSet com.oracle.linux.network.bootproto.1 dhcp
 
# group oinstall
paramSet com.oracle.linux.group.name.0 oinstall
paramSet com.oracle.linux.group.action.0 add
paramSet com.oracle.linux.group.gid.0 54321
#paramSet com.oracle.linux.group.new-name.0
 
# group dba
paramSet com.oracle.linux.group.name.1 dba
paramSet com.oracle.linux.group.action.1 add
paramSet com.oracle.linux.group.gid.1 54322
#paramSet com.oracle.linux.group.new-name.1
 
# user
paramSet com.oracle.linux.user.name.0 oracle
paramSet com.oracle.linux.user.action.0 add
paramSet com.oracle.linux.user.uid.0 54321
paramSet com.oracle.linux.user.group.0 oinstall
paramSet com.oracle.linux.user.groups.0 dba
paramSet com.oracle.linux.user.password.0 "$VM_ORACLE_PASS"
#paramSet com.oracle.linux.user.new-name.0
 
# ssh keys
#paramSet com.oracle.linux.ssh.host-key
#paramSet com.oracle.linux.ssh.host-key-pub
#paramSet com.oracle.linux.ssh.host-rsa-key
#paramSet com.oracle.linux.ssh.host-rsa-key-pub
#paramSet com.oracle.linux.ssh.host-dsa-key
#paramSet com.oracle.linux.ssh.host-dsa-key-pub
paramSet com.oracle.linux.ssh.user.0 root
#paramSet com.oracle.linux.ssh.authorized-keys.0
#paramSet com.oracle.linux.ssh.private-key.0
#paramSet com.oracle.linux.ssh.private-key-type.0
#paramSet com.oracle.linux.ssh.known-hosts.0
 
# root password
paramSet com.oracle.linux.root-password "$VM_ROOT_PASS"

Friday, 18 September 2015

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

OVS sandbox VirtualBox - #1 - Introduction

Following the previous post Can we emulate OVM inside VirtualBox ? #2, let's walk through the setup to get to a working set of Oracle Virtual Server on top of VirtualBox.

This is almost similar to the OVM server farm sandbox which was done on VMWare.

Where last time, we did the exercise on
2,3 GHz Intel Core I7 4850HQ "Haswell"
6 MB shared L3 cache
16GB ram
while this time we go for

3,1 GHz Intel Core i7 5557U "Broadwell"
4 MB shared L3 cache
16GB ram

The used sources are:
Furthermore, handy to download some ovf templates
  • OVM_OL5U11_x86_64_PVM (V73663-01.zip) - Edelivery
  • OVM_OL6U6_x86_64_PVM (V73659-01.zip) - Edelivery
  • OVM_OL7U1_x86_64_PVHVM (V75785-01.zip) - Edelivery
And the following script we use for the host provisioning. Save it under the name Ovm_configure_vm.bash
#!/bin/bash
 
export VM_NAME="OEL6.0"
#export VM_IP="10.0.2.100"
export VM_HOSTNAME="oel60"
export VM_DOMAINNAME="local"
export VM_ORACLE_PASS="Welcome1"
export VM_ROOT_PASS="Welcome1"
# Below line is the "admin" password for the OVM Management access
export OVMUTIL_PASS="Welcome1"
export OVM_VMM="/u01/app/oracle/ovm-manager-3/ovm_utils/ovm_vmmessage"
 
paramSet () {
   echo "[$VM_NAME] setting [$1] to [$2]"
   $OVM_VMM -u admin -E -h localhost -v "$VM_NAME" -k "$1" -V "$2"
}
 
# selinux
paramSet com.oracle.linux.selinux.mode permissive
 
# firewall
paramSet com.oracle.linux.network.firewall False
 
# date/time/timezone
paramSet com.oracle.linux.datetime.timezone "Europe/Amsterdam"
paramSet com.oracle.linux.datetime.utc True
paramSet com.oracle.linux.datetime.ntp True
paramSet com.oracle.linux.datetime.ntp-servers 10.0.2.2
paramSet com.oracle.linux.datetime.ntp-local-time-source False
 
# network
paramSet com.oracle.linux.network.hostname "$VM_HOSTNAME.$VM_DOMAINNAME"
paramSet com.oracle.linux.network.host.0 "$VM_HOSTNAME"
paramSet com.oracle.linux.network.device.0 eth0
#paramSet com.oracle.linux.network.hwaddr.0
#paramSet com.oracle.linux.network.mtu.0
#paramSet com.oracle.linux.network.onboot.0 yes
#paramSet com.oracle.linux.network.bootproto.0 static
#paramSet com.oracle.linux.network.ipaddr.0 $VM_IP
#paramSet com.oracle.linux.network.netmask.0 255.255.255.0
#paramSet com.oracle.linux.network.gateway.0 10.0.2.2
#paramSet com.oracle.linux.network.dns-servers.0 10.0.2.2.2,8.8.8.8
#paramSet com.oracle.linux.network.dns-search-domains.0 "$VM_DOMAINNAME"
paramSet com.oracle.linux.network.onboot.0 yes
paramSet com.oracle.linux.network.bootproto.0 dhcp
paramSet com.oracle.linux.network.device.1 eth1
paramSet com.oracle.linux.network.onboot.1 yes
paramSet com.oracle.linux.network.bootproto.1 dhcp
 
# group oinstall
paramSet com.oracle.linux.group.name.0 oinstall
paramSet com.oracle.linux.group.action.0 add
paramSet com.oracle.linux.group.gid.0 54321
#paramSet com.oracle.linux.group.new-name.0
 
# group dba
paramSet com.oracle.linux.group.name.1 dba
paramSet com.oracle.linux.group.action.1 add
paramSet com.oracle.linux.group.gid.1 54322
#paramSet com.oracle.linux.group.new-name.1
 
# user
paramSet com.oracle.linux.user.name.0 oracle
paramSet com.oracle.linux.user.action.0 add
paramSet com.oracle.linux.user.uid.0 54321
paramSet com.oracle.linux.user.group.0 oinstall
paramSet com.oracle.linux.user.groups.0 dba
paramSet com.oracle.linux.user.password.0 "$VM_ORACLE_PASS"
#paramSet com.oracle.linux.user.new-name.0
 
# ssh keys
#paramSet com.oracle.linux.ssh.host-key
#paramSet com.oracle.linux.ssh.host-key-pub
#paramSet com.oracle.linux.ssh.host-rsa-key
#paramSet com.oracle.linux.ssh.host-rsa-key-pub
#paramSet com.oracle.linux.ssh.host-dsa-key
#paramSet com.oracle.linux.ssh.host-dsa-key-pub
paramSet com.oracle.linux.ssh.user.0 root
#paramSet com.oracle.linux.ssh.authorized-keys.0
#paramSet com.oracle.linux.ssh.private-key.0
#paramSet com.oracle.linux.ssh.private-key-type.0
#paramSet com.oracle.linux.ssh.known-hosts.0
 
# root password
paramSet com.oracle.linux.root-password "$VM_ROOT_PASS"