Install Oracle 11gR2 on SL6 KVM at KVM-QEMU Instance on SL 6 (alpha 3)

December 31, 2010

Setup KVM-QEMU instance per [1] on SL 6 alpha 3 and install SL6 KVM with ISO image SL-6-x86_64-2010-12-17-boot.iso to run installation via http://ftp.scientificlinux.org/linux/scientific/6rolling/x86_64/os/ source



Follow [2] with minor changes for “yum install script” in previously installed SL 6 KVM via Net Repos. Virtio drivers should be enabled during install. First update for /etc/sysctl.conf

fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default=262144
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=1048586

# /sbin/syctl -p

Add the following lines to the “/etc/security/limits.conf” file.
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
Add the following line to the “/etc/pam.d/login” file.
session required pam_limits.so
***************************************
Run Script 1 to install packages
***************************************

yum install binutils \
compat-libstdc++-33 \
compat-libstdc++-33.i686 \
elfutils-libelf \
elfutils-libelf-devel \
gcc \
gcc-c++ \
glibc \
glibc.i686 \
glibc-common \
glibc-devel \
glibc-devel.i686 \
glibc-headers \
ksh \
libaio \
libaio.i686 \
libaio-devel \
libaio-devel.i686 \
libgcc \
libgcc.i686 \
libstdc++ \
libstdc++.i686 \
libstdc++-devel \
make \
numactl-devel \
sysstat \
unixODBC \
unixODBC.i686 \
unixODBC-devel \
unixODBC-devel.i6

********************************************************************************************
Run Script 2 to create oracle account, groups and directories for installation
********************************************************************************************

groupadd oinstall
groupadd dba
groupadd oper
groupadd asmadmin
useradd -g oinstall -G dba,oper,asmadmin oracle
passwd oracle
mkdir -p /u01/app/oracle/product/11.2.0/db_1
chown -R oracle:oinstall /u01
chmod -R 775 /u01

Disable SELINUX and reboot VM.
********************************************
Create oracle’s .bash_profile per [2]
********************************************

TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_HOSTNAME=ServerASL6; export ORACLE_HOSTNAME
ORACLE_UNQNAME=data1231; export ORACLE_UNQNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1; export ORACLE_HOME
ORACLE_SID=data1231; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi

As oracle

unzip linux.x64_11gR2_database_1of2.zip
unzip linux.x64_11gR2_database_2of2.zip

cd database
$ ./runInstaller









References
1.http://bderzhavets.wordpress.com/2010/12/23/set-up-kvm-on-scientific-linux-6-server-alpha-3/
2.http://www.oracle-base.com/articles/11g/OracleDB11gR2InstallationOnFedora14.php


KVM & Virtio (disk/nic) on Scientific Linux 6 (alpha 3)

December 29, 2010

KVM as a “full virtualization” is a nice feature because it allows you to run any operating system virtualized. However, it’s relatively slow because the hypervisor has to emulate actual physical devices such as RTL8139 network cards and the most recent SeaBios emulates IDE interface.This fragment from KVM guest dmesg log is fair enough :-

[ 0.129740] ata_piix 0000:00:01.1: version 2.13
[ 0.129802] ata_piix 0000:00:01.1: setting latency timer to 64
[ 0.129954] scsi0 : ata_piix
[ 0.130522] scsi1 : ata_piix
[ 0.130552] ata1: PATA max MWDMA2 cmd 0x1f0 ctl 0x3f6 bmdma 0xc000 irq 14
[ 0.130554] ata2: PATA max MWDMA2 cmd 0x170 ctl 0x376 bmdma 0xc008 irq 15

Virtio is a Linux standard for network and disk device drivers where just the guest’s device driver “knows” it is running in a virtual environment, and cooperates with the hypervisor. This enables guests to get high performance network and disk operations, and gives most of the performance benefits of paravirtualization.
If you want to install a machine with virtio drivers you should add these lines to your virt-install command:

--os-type=linux \
--os-variant=virtio26 \

Using this command you enable the virtio drivers at install time on SL 6 (alpha 3)

# virt-install –connect qemu:///system -n UDSK10.10 -r 2048 –vcpus=2 \
> –os-type=linux –os-variant=virtio26 \
> -f /dev/vg_kvms/vm02 -c \
> /usr/tmp/u1010desk.iso –vnc \
> –accelerate –network=bridge:br0 –hvm –debug
Wed, 29 Dec 2010 18:53:06 DEBUG Launched with command line:
/usr/sbin/virt-install –connect qemu:///system -n UDSK10.10 -r 2048 –vcpus=2 –os-type=linux –os-variant=virtio26 -f /dev/vg_kvms/vm02 -c /usr/tmp/u1010desk.iso –vnc –accelerate –network=bridge:br0 –hvm –debug
Wed, 29 Dec 2010 18:53:06 DEBUG Requesting libvirt URI qemu:///system
Wed, 29 Dec 2010 18:53:06 DEBUG Received libvirt URI qemu:///system
Wed, 29 Dec 2010 18:53:06 DEBUG Requesting virt method ‘hvm’, hv type ‘default’.
Wed, 29 Dec 2010 18:53:06 DEBUG Received virt method ‘hvm’
Wed, 29 Dec 2010 18:53:06 DEBUG Hypervisor name is ‘kvm’
Wed, 29 Dec 2010 18:53:06 DEBUG DistroInstaller location is a local file/path: /usr/tmp/u1010desk.iso

Starting install…
Wed, 29 Dec 2010 18:53:07 DEBUG Generated install XML:
<domain type=’kvm’>
<name>UDSK10.10</name>
<currentMemory>2097152</currentMemory>
<memory>2097152</memory>
<uuid>017cec13-8c2f-56cf-6762-4575c26d988f</uuid>
<os>
<type arch=’x86_64′>hvm</type>
<boot dev=’cdrom’/>
</os>
<features>
<acpi/><apic/><pae/>
</features>
<clock offset=”utc”/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>destroy</on_reboot>
<on_crash>destroy</on_crash>
<vcpu>2</vcpu>
<devices>
<emulator>/usr/libexec/qemu-kvm</emulator>
<disk type=’block’ device=’disk’>
<driver name=’qemu’ cache=’none’/>
<source dev=’/dev/vg_kvms/vm02′/>
<target dev=’vda’ bus=’virtio’/>
</disk>
<disk type=’file’ device=’cdrom’>
<driver name=’qemu’/>
<source file=’/usr/tmp/u1010desk.iso’/>
<target dev=’hdc’ bus=’ide’/>
<readonly/>
</disk>
<interface type=’bridge’>
<source bridge=’br0′/>
<mac address=’52:54:00:37:b9:0b’/>
<model type=’virtio’/>
</interface>
<input type=’mouse’ bus=’ps2′/>
<graphics type=’vnc’ port=’-1′ keymap=’en-us’/>
<console type=’pty’/>
<video>
<model type=’cirrus’/>
</video>
</devices>
</domain>

Creating domain… | 0 B 00:00
Wed, 29 Dec 2010 18:53:07 DEBUG Started guest, looking to see if it is running
Wed, 29 Dec 2010 18:53:07 DEBUG Launching console callback
Wed, 29 Dec 2010 18:53:07 DEBUG Generated boot XML:
<domain type=’kvm’>
<name>UDSK10.10</name>
<currentMemory>2097152</currentMemory>
<memory>2097152</memory>
<uuid>017cec13-8c2f-56cf-6762-4575c26d988f</uuid>
<os>
<type arch=’x86_64′>hvm</type>
<boot dev=’hd’/>
</os>
<features>
<acpi/><apic/><pae/>
</features>
<clock offset=”utc”/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<vcpu>2</vcpu>
<devices>
<emulator>/usr/libexec/qemu-kvm</emulator>
<disk type=’block’ device=’disk’>
<driver name=’qemu’ cache=’none’/>
<source dev=’/dev/vg_kvms/vm02′/>
<target dev=’vda’ bus=’virtio’/>
</disk>
<disk type=’block’ device=’cdrom’>
<target dev=’hdc’ bus=’ide’/>
<readonly/>
</disk>
<interface type=’bridge’>
<source bridge=’br0′/>
<mac address=’52:54:00:37:b9:0b’/>
<model type=’virtio’/>
</interface>
<input type=’mouse’ bus=’ps2′/>
<graphics type=’vnc’ port=’-1′ keymap=’en-us’/>
<console type=’pty’/>
<video>
<model type=’cirrus’/>
</video>
</devices>
</domain>
Guest installation complete… restarting guest.
Wed, 29 Dec 2010 19:00:27 DEBUG Launching console callback





Runtime profile of KVM Ubuntu 10.10 Desktop looks as follows :-
# virsh dumpxml UDSK10.10 > UDSK10.10.xml
# cat UDSK10.10.xml
<domain type=’kvm’>
<name>UDSK10.10</name>
<uuid>017cec13-8c2f-56cf-6762-4575c26d988f</uuid>
<memory>2097152</memory>
<currentMemory>2097152</currentMemory>
<vcpu>2</vcpu>
<os>
<type arch=’x86_64′ machine=’rhel6.0.0′>hvm</type>
<boot dev=’hd’/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset=’utc’/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/libexec/qemu-kvm</emulator>
<disk type=’block’ device=’disk’>
<driver name=’qemu’ type=’raw’ cache=’none’/>
<source dev=’/dev/vg_kvms/vm02′/>
<target dev=’vda’ bus=’virtio’/>
<address type=’pci’ domain=’0×0000′ bus=’0×00′ slot=’0×04′ function=’0×0′/>
</disk>
<disk type=’block’ device=’cdrom’>
<driver name=’qemu’ type=’raw’/>
<target dev=’hdc’ bus=’ide’/>
<readonly/>
<address type=’drive’ controller=’0′ bus=’1′ unit=’0′/>
</disk>
<controller type=’ide’ index=’0′>
<address type=’pci’ domain=’0×0000′ bus=’0×00′ slot=’0×01′ function=’0×1′/>
</controller>
<interface type=’bridge’>
<mac address=’52:54:00:37:b9:0b’/>
<source bridge=’br0′/>
<target dev=’vnet0′/>
<model type=’virtio’/>
<address type=’pci’ domain=’0×0000′ bus=’0×00′ slot=’0×03′ function=’0×0′/>
</interface>
<serial type=’pty’>
<target port=’0′/>
</serial>
<console type=’pty’>
<target port=’0′/>
</console>
<input type=’mouse’ bus=’ps2′/>
<graphics type=’vnc’ port=’-1′ autoport=’yes’ keymap=’en-us’/>
<video>
<model type=’cirrus’ vram=’9216′ heads=’1′/>
<address type=’pci’ domain=’0×0000′ bus=’0×00′ slot=’0×02′ function=’0×0′/>
</video>
<memballoon model=’virtio’>
<address type=’pci’ domain=’0×0000′ bus=’0×00′ slot=’0×05′ function=’0×0′/>
</memballoon>
</devices>
</domain>

Activating virtio driver via virt-manager







Set up KVM on Scientific Linux 6 Server (alpha 3)

December 23, 2010

Include virtualization group during initial install. Attempt to start virt-manager pops up an error message

Traceback (most recent call last):
File "/usr/share/virt-manager/virt-manager.py", line 413, in
main()
File "/usr/share/virt-manager/virt-manager.py", line 344, in main
appname + "-icon.svg")
GError: Couldn't recognize the image file format for file '/usr/share/virt-manager/pixmaps/virt-manager-icon.svg'

To be able to start virt-manager run as root to re-create the ‘gdk-pixbuf.loaders’ file :-

/usr/bin/gdk-pixbuf-query-loaders-64 > /etc/gtk-2.0/x86_64-redhat-linux-gnu/gdk-pixbuf.loaders

or just comment out lines 343,344 in /usr/share/virt-manager/virt-manager.py to allow virt-manager to start . Set up bridged networking as follows :-
To create network initscripts in the /etc/sysconfig/network-scripts directory it is necessary to create 2 config files. The first one (ifcfg-eth0) defines your physical network interface, and says that it will be part of a bridge:

# cat ifcfg-eth0
DEVICE=eth0
HWADDR=00:16:76:D6:C9:45
ONBOOT=yes
BRIDGE=br0
NM_CONTROLLED=no

Obviously change the HWADDR to match your actual NIC’s address.
The second config file (ifcfg-br0) defines the bridge device:

# cat ifcfg-br0
DEVICE=br0
TYPE=Bridge
BOOTPROTO=dhcp
ONBOOT=yes
DELAY=0
NM_CONTROLLED=no

# chkconfig NetworkManager off
# chkconfig network on
# service network start

Install domains via commands like

*****************************************************************************************************
[root@ServerASL6 ~]# virt-install --connect qemu:///system -n VMF14 -r 1024 --vcpus=2 -f /vm/vm14.qcow2 -s 12 -c /mnt/usr/tmp/f14.iso --vnc --accelerate --network=bridge:br0 --hvm
Starting install...
Creating storage file vm14.qcow2 | 12 GB 00:00
Creating domain... | 0 B 00:00
Guest installation complete... restarting guest.
*****************************************************************************************************
[root@ServerASL6 vm]# virt-install --connect qemu:///system -n UDESK1010 -r 1024 --vcpus=2 \
> -f /vm/u1010.qcow2 -s 12 -c \
> /vm/u1010desk.iso --vnc \
> --accelerate --network=bridge:br0 --hvm
Starting install...
Creating storage file u1010.qcow2 | 12 GB 00:00
Creating domain... | 0 B 00:00
Guest installation complete... restarting guest.
*****************************************************************************************************
[root@ServerASL6 root]# virt-install --connect qemu:///system -n VM14F -r 1024 --vcpus=2 \
> -f /dev/vg_kvms/vm03 -c /mnt1/usr/tmp/f14.iso --vnc \
> --accelerate --network=bridge:br0 --hvm
Starting install...
Creating domain... | 0 B 00:00
Guest installation complete... restarting guest.
*******************************************************************************************************












Restart domain via virt-mamager



Virt-install Ubuntu 10.10 desktop











References
1. http://forums.fedoraforum.org/showthread.php?t=179996


Follow

Get every new post delivered to your Inbox.