If you encounter this error while installing Oracle Database 12c:
PRVF-0002 Could not retrieve local nodename
Having a look at Oracle's error documentation it simply tells us:
Cause: Unable to determine local host name using Java network functions.
Action: Ensure hostname is defined correctly using the 'hostname' command.
Here's how to solve it:
This is the standard file hosts
[root@vm1 ~]# nano /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
If you ever installed Oracle DB 11g you probably know you need to edit hosts file adding the current machine IP address and hostname. So file hosts resulted in something similar to:
[root@vm1 ~]# nano /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.116.230 vm1 vm1.localdomain
Unfortunately in Oracle DB 12c this is not enough, to solve the error above you need to point loopback address to the machine hostname.
[root@vm1 ~]# nano /etc/hosts
127.0.0.1 vm1 vm1.localdomain localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 vm1 vm1.localdomain localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.116.230 vm1 vm1.localdomain
That's all!!
Visualizzazione post con etichetta linux. Mostra tutti i post
Visualizzazione post con etichetta linux. Mostra tutti i post
domenica 18 agosto 2013
giovedì 4 aprile 2013
Oracle Linux: NIC bonding
NIC bonding allow the use of multiple NICs for increased network performance or availability. Multiple NICs are combined into a single "network entity" called bond in which NICs can be added or removed.
So, let's start:
Create the bond alias. This alias will point to a network configuration file where we will define the properties of our bond like the IP address and bonding options.
[root@oracle ~]# nano /etc/modprobe.conf
add the following line into modprobe.conf
alias bond0 bonding
Now create the configuration file for interface bond0:
[root@oracle ~]# cd /etc/sysconfig/network-scripts/
[root@oracle network-scripts]# touch ifcfg-bond0
[root@oracle network-scripts]# nano ifcfg-bond0
Insert this in ifcfg-bond0 file:
DEVICE=bond0
BOOTPROTO=none
ONBOOT=yes
NETWORK=10.0.0.0
NETMASK=255.255.255.0
IPADDR=10.0.0.122
USERCTL=no
BONDING_OPTS="mode=1 miimon=100"
Where:
NETWORK=10.0.0.0 is the network class we are using.
IPADDR=10.0.0.122 is the IP address of this machine
BONDING_OPTS="mode=1 miimon=100" are the bonding options.
mode=1 is used for active backup policy which means that only one network adapter is active and the remaining are waiting for main NIC to fail in order to replace it.
Common values for "mode" are: 0 round robin and 1 active backup
miimon=100 is the frequency in milliseconds of MII link monitoring. 100ms is a suggested value.
bond0 configuration file is completed, now we need to edit configuration files for all NICs participating into this bond. For this guide I'm using only two NICs in bond0 so I have to edit only ifcfg-eth0 and ifcfg-eth1
[root@oracle ~]# nano /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
HWADDR=00:50:56:BF:00:25
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no
[root@oracle ~]# nano /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
BOOTPROTO=none
HWADDR=00:50:56:BF:00:34
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no
As you can see we configure all interfaces of the bond to be slaves using bond0 as master.
Restart network to apply changes:
[root@oracle ~]# service network restart
As for last step we need to add a default gateway for our machine:
[root@oracle ~]# /sbin/route add -net default gw 10.0.0.250
Try to ping an internet address, if ping echo reply returns correctly make permament this route adding previous command to rc.local file.
[root@oracle ~]# nano /etc/rc.local
Add:
/sbin/route add -net default gw 10.0.0.250
rc.local will be called each time the machine will startup.
That's all!!
So, let's start:
Create the bond alias. This alias will point to a network configuration file where we will define the properties of our bond like the IP address and bonding options.
[root@oracle ~]# nano /etc/modprobe.conf
add the following line into modprobe.conf
alias bond0 bonding
Now create the configuration file for interface bond0:
[root@oracle ~]# cd /etc/sysconfig/network-scripts/
[root@oracle network-scripts]# touch ifcfg-bond0
[root@oracle network-scripts]# nano ifcfg-bond0
Insert this in ifcfg-bond0 file:
DEVICE=bond0
BOOTPROTO=none
ONBOOT=yes
NETWORK=10.0.0.0
NETMASK=255.255.255.0
IPADDR=10.0.0.122
USERCTL=no
BONDING_OPTS="mode=1 miimon=100"
Where:
NETWORK=10.0.0.0 is the network class we are using.
IPADDR=10.0.0.122 is the IP address of this machine
BONDING_OPTS="mode=1 miimon=100" are the bonding options.
mode=1 is used for active backup policy which means that only one network adapter is active and the remaining are waiting for main NIC to fail in order to replace it.
Common values for "mode" are: 0 round robin and 1 active backup
miimon=100 is the frequency in milliseconds of MII link monitoring. 100ms is a suggested value.
bond0 configuration file is completed, now we need to edit configuration files for all NICs participating into this bond. For this guide I'm using only two NICs in bond0 so I have to edit only ifcfg-eth0 and ifcfg-eth1
[root@oracle ~]# nano /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
HWADDR=00:50:56:BF:00:25
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no
[root@oracle ~]# nano /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
BOOTPROTO=none
HWADDR=00:50:56:BF:00:34
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no
As you can see we configure all interfaces of the bond to be slaves using bond0 as master.
Restart network to apply changes:
[root@oracle ~]# service network restart
As for last step we need to add a default gateway for our machine:
[root@oracle ~]# /sbin/route add -net default gw 10.0.0.250
Try to ping an internet address, if ping echo reply returns correctly make permament this route adding previous command to rc.local file.
[root@oracle ~]# nano /etc/rc.local
Add:
/sbin/route add -net default gw 10.0.0.250
rc.local will be called each time the machine will startup.
That's all!!
lunedì 7 gennaio 2013
Oracle Linux: How to install VMWare Tools
In this topic I briefly explain how to install VMWare Tools on an Oracle Linux 6 guest VM.
Via vSphere Client select Oracle Linux VM, right click Guest -> Install/Upgrade VMWare Tools
Login to Oracle Linux VM using SSH or integrated vSphere console.
VMWare Tools are provided as a cdrom image that will be automatically mounted by vSphere to your guest VM. In my case (I suppose in every case where there's not a GUI on servers) I had to manually mount cdrom so....first we need to create the mount point for cdrom.
[root@oracle]# mkdir /mnt/cdrom
Mount VMWare Tools cdrom to previously created mount point
[root@oracle]# mount /dev/cdrom /mnt/cdrom
Browse cdrom content
[root@oracle]# cd /mnt/cdrom
Copy VMWare Tools to a temp directory, in this case I used /tmp but you can copy wherever you like.
[root@oracle]# cp VMwareTools-9.0.0-782409.tar.gz /tmp
Unmount cdrom
[root@oracle]# umount /mnt/cdrom
[root@oracle]# cd /tmp
Untar VMWare Tools
[root@oracle]# tar -xvf VMwareTools-9.0.0-782409.tar.gz
[root@oracle]# cd vmware-tools-distrib
Then perform installation
[root@oracle]# ./vmware-install.pl
You will be prompted with a lot of options, usually I use recommended settings so press ENTER to any requested action.
If everything runs as expected VMWare Tools will be installed as shown in following screen:
Via vSphere Client select Oracle Linux VM, right click Guest -> Install/Upgrade VMWare Tools
Login to Oracle Linux VM using SSH or integrated vSphere console.
VMWare Tools are provided as a cdrom image that will be automatically mounted by vSphere to your guest VM. In my case (I suppose in every case where there's not a GUI on servers) I had to manually mount cdrom so....first we need to create the mount point for cdrom.
[root@oracle]# mkdir /mnt/cdrom
Mount VMWare Tools cdrom to previously created mount point
[root@oracle]# mount /dev/cdrom /mnt/cdrom
Browse cdrom content
[root@oracle]# cd /mnt/cdrom
Copy VMWare Tools to a temp directory, in this case I used /tmp but you can copy wherever you like.
[root@oracle]# cp VMwareTools-9.0.0-782409.tar.gz /tmp
Unmount cdrom
[root@oracle]# umount /mnt/cdrom
[root@oracle]# cd /tmp
Untar VMWare Tools
[root@oracle]# tar -xvf VMwareTools-9.0.0-782409.tar.gz
[root@oracle]# cd vmware-tools-distrib
Then perform installation
[root@oracle]# ./vmware-install.pl
You will be prompted with a lot of options, usually I use recommended settings so press ENTER to any requested action.
If everything runs as expected VMWare Tools will be installed as shown in following screen:
lunedì 17 dicembre 2012
Oracle Linux: install and configure VNC server
This post covers the topic of installing a VNC server under Oracle Linux so you can login remotely to the machine desktop interface.
To be honest I usually (almost never) install a desktop environment on machines running Oracle products, this is because it's more fast and immediate apply system changes using command line instead of using a GUI without considering the fact that a GUI burdens systems' resources.
Despite this fact I recognize that sometimes having a GUI isn't that bad because allow users, even ones not so familiar with command line, to use systems.
Anyway...here's how to install VNC server on Oracle Linux (mine was 5 update 4 with Gnome desktop)!
Install vnc-server. In my system this package was already installed but needed to be updated, so:
[root@oracle ~]$ yum install vnc-server
Edit configuration file:
[oracle@oracle ~]$ nano /home/oracle/.vnc/xstartup
#!/bin/sh
# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm &
startx &
Please note that I've uncommented some lines, commented other and added "starx&" command which starts Gnome.
If you have installed KDE instead of Gnome the command will be: "startxkde&"
Once it's configured the further step it's to enable it, so first you need to choose a password to let connections occurr:
[oracle@oracle ~]$ vncpasswd
Type your desired password then start server on selected port. In my case port is ":1"
[oracle@oracle ~]$ vncserver :1
Test if this is correctly working connecting using a VNC Viewer.
Please note that fireall (iptables) may interfere with these connections if not correctly set up.
If you wish to stop vncserver:
[oracle@oracle ~]$ vncserver -kill :1
That's all!!
To be honest I usually (almost never) install a desktop environment on machines running Oracle products, this is because it's more fast and immediate apply system changes using command line instead of using a GUI without considering the fact that a GUI burdens systems' resources.
Despite this fact I recognize that sometimes having a GUI isn't that bad because allow users, even ones not so familiar with command line, to use systems.
Anyway...here's how to install VNC server on Oracle Linux (mine was 5 update 4 with Gnome desktop)!
Install vnc-server. In my system this package was already installed but needed to be updated, so:
[root@oracle ~]$ yum install vnc-server
Edit configuration file:
[oracle@oracle ~]$ nano /home/oracle/.vnc/xstartup
#!/bin/sh
# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm &
startx &
Please note that I've uncommented some lines, commented other and added "starx&" command which starts Gnome.
If you have installed KDE instead of Gnome the command will be: "startxkde&"
Once it's configured the further step it's to enable it, so first you need to choose a password to let connections occurr:
[oracle@oracle ~]$ vncpasswd
Type your desired password then start server on selected port. In my case port is ":1"
[oracle@oracle ~]$ vncserver :1
Test if this is correctly working connecting using a VNC Viewer.
Please note that fireall (iptables) may interfere with these connections if not correctly set up.
If you wish to stop vncserver:
[oracle@oracle ~]$ vncserver -kill :1
That's all!!
giovedì 6 settembre 2012
Oracle VM: VM Server status not recognized by VM Manager
Hello, it was a bit since my last post here. Meanwhile I had some weeks of vacation but ...when I came back here's an issue waiting for me: Oracle VM, production environment, guest VMs correctly working but VM Manager completely unable to discover server status (servers reported in stopped status with error) despite servers are running fine.
VM Manager was totally unusable, server discovery processes stucked, I had to manually abort these processes from VM Manager. After aborting these discovery processes VM Manager changed server statuses from "stopped with error" to "starting". If I performed a manually rediscovery of servers I got this error:
https://?uname?:[email protected]:8899/api/2 discover_hardware, Status: org.apache.xmlrpc.XmlRpcException: agent.utils.filelock.LockError:Lock file /var/run/ovs-agent/discover_hardware.lock failed: timeout occured.
Logged in to server via SSH and under /var/run/ovs-agent I got:
discover_hardware.lock
monitor.lock
So it became pretty clear this was an issue with ovs-agent which is the agent who performs communication between VM Server and VM Manager.
Please note that if you can afford to stop or move your VMs a server reboot could solve all this without messing with PIDs and services.
If you, like me, don't have such luck you need to deal with PIDs and services.
ovs-agent service is run by a script located at /etc/init.d/ovs-agent and it is registered as a service that can be invoked with:
service ovs-agent [stop | start | restart | status]
So I checked ovs-agent status:
[root@orclvmsrv1 ~]# service ovs-agent status
OVSHA (PID: 6763) is running...
OVSNotificationServer (PID: 6725) is running...
OVSStat (PID: 6767) is running...
OVSAgentServer (PID: 6771) is running...
OVSLogServer (PID: 6709) is running...
OVSMonitor (PID: 6759) is running...
OVSRemaster (PID: 6747) is running...
and all services were reported as running fine even if they actually are not.
My next step was to open a SR with Oracle, which involved sending a lot of logs, from both VM Server and VM Manager, to support engineers.
One of the requested logs was VM Server "lsof" which is the list of the current open files and a support engineer made me focus on this:
[root@orclvmsrv1 ~]# lsof | grep discover_hardware.lock
python 31309 root 6u REG 104,2 0 31704 /var/run/ovs-agent/discover_hardware.lock
which basically is the PID of the (python) process currently holding "discover_hardware".
This gave me the hint of killing processes involved with ovs-agent services.
So I got all PIDs involved:
[root@orclvmsrv1 ~]# service ovs-agent status
OVSHA (PID: 6763) is running...
OVSNotificationServer (PID: 6725) is running...
OVSStat (PID: 6767) is running...
OVSAgentServer (PID: 6771) is running...
OVSLogServer (PID: 6709) is running...
OVSMonitor (PID: 6759) is running...
OVSRemaster (PID: 6747) is running...
and then killed them:
[root@orclvmsrv1 ~]# kill 6763
[root@orclvmsrv1 ~]# kill 6725
[root@orclvmsrv1 ~]# kill 6767
[root@orclvmsrv1 ~]# kill 6771
[root@orclvmsrv1 ~]# kill 6709
[root@orclvmsrv1 ~]# kill 6759
[root@orclvmsrv1 ~]# kill 6747
and killed the process wich generated file lock seen above.
[root@orclvmsrv1 ~]# kill 31309
Checked status again:
[root@orclvmsrv1 ~]# service ovs-agent status
Procss OVSHA with PID 6763 doesn't exist.
Deleted .pid, .sock, .lock files under /var/run/ovs-agent
[root@orclvmsrv1 ~]# cd /var/run/ovs-agent
[root@orclvmsrv1 ~]# rm *.pid
[root@orclvmsrv1 ~]# rm *.sock
[root@orclvmsrv1 ~]# rm *.lock
Then started ovs-agent again and everything went back to work as usual:
[root@orclvmsrv1 ~]# service ovs-agent start
Starting ovs-agent services: [ OK ]
So, I'm still not able to understand why this happend and what caused this issue with ovs-agent but this was the method I followed to solve this problem.
One last note I would to add is that dealing with ovs-agent DO NOT affect guest VMs running on servers, they will be running fine even if ovs-agent is stopped, restarted, or whatsoever.
Suggestion: if you have more available servers in the pool, live migrate all guest VMs from affected server(s) to working ones and reboot affected servers.
That's all!!
VM Manager was totally unusable, server discovery processes stucked, I had to manually abort these processes from VM Manager. After aborting these discovery processes VM Manager changed server statuses from "stopped with error" to "starting". If I performed a manually rediscovery of servers I got this error:
https://?uname?:[email protected]:8899/api/2 discover_hardware, Status: org.apache.xmlrpc.XmlRpcException: agent.utils.filelock.LockError:Lock file /var/run/ovs-agent/discover_hardware.lock failed: timeout occured.
Logged in to server via SSH and under /var/run/ovs-agent I got:
discover_hardware.lock
monitor.lock
So it became pretty clear this was an issue with ovs-agent which is the agent who performs communication between VM Server and VM Manager.
Please note that if you can afford to stop or move your VMs a server reboot could solve all this without messing with PIDs and services.
If you, like me, don't have such luck you need to deal with PIDs and services.
ovs-agent service is run by a script located at /etc/init.d/ovs-agent and it is registered as a service that can be invoked with:
service ovs-agent [stop | start | restart | status]
So I checked ovs-agent status:
[root@orclvmsrv1 ~]# service ovs-agent status
OVSHA (PID: 6763) is running...
OVSNotificationServer (PID: 6725) is running...
OVSStat (PID: 6767) is running...
OVSAgentServer (PID: 6771) is running...
OVSLogServer (PID: 6709) is running...
OVSMonitor (PID: 6759) is running...
OVSRemaster (PID: 6747) is running...
and all services were reported as running fine even if they actually are not.
My next step was to open a SR with Oracle, which involved sending a lot of logs, from both VM Server and VM Manager, to support engineers.
One of the requested logs was VM Server "lsof" which is the list of the current open files and a support engineer made me focus on this:
[root@orclvmsrv1 ~]# lsof | grep discover_hardware.lock
python 31309 root 6u REG 104,2 0 31704 /var/run/ovs-agent/discover_hardware.lock
which basically is the PID of the (python) process currently holding "discover_hardware".
This gave me the hint of killing processes involved with ovs-agent services.
So I got all PIDs involved:
[root@orclvmsrv1 ~]# service ovs-agent status
OVSHA (PID: 6763) is running...
OVSNotificationServer (PID: 6725) is running...
OVSStat (PID: 6767) is running...
OVSAgentServer (PID: 6771) is running...
OVSLogServer (PID: 6709) is running...
OVSMonitor (PID: 6759) is running...
OVSRemaster (PID: 6747) is running...
and then killed them:
[root@orclvmsrv1 ~]# kill 6763
[root@orclvmsrv1 ~]# kill 6725
[root@orclvmsrv1 ~]# kill 6767
[root@orclvmsrv1 ~]# kill 6771
[root@orclvmsrv1 ~]# kill 6709
[root@orclvmsrv1 ~]# kill 6759
[root@orclvmsrv1 ~]# kill 6747
and killed the process wich generated file lock seen above.
[root@orclvmsrv1 ~]# kill 31309
Checked status again:
[root@orclvmsrv1 ~]# service ovs-agent status
Procss OVSHA with PID 6763 doesn't exist.
Deleted .pid, .sock, .lock files under /var/run/ovs-agent
[root@orclvmsrv1 ~]# cd /var/run/ovs-agent
[root@orclvmsrv1 ~]# rm *.pid
[root@orclvmsrv1 ~]# rm *.sock
[root@orclvmsrv1 ~]# rm *.lock
Then started ovs-agent again and everything went back to work as usual:
[root@orclvmsrv1 ~]# service ovs-agent start
Starting ovs-agent services: [ OK ]
So, I'm still not able to understand why this happend and what caused this issue with ovs-agent but this was the method I followed to solve this problem.
One last note I would to add is that dealing with ovs-agent DO NOT affect guest VMs running on servers, they will be running fine even if ovs-agent is stopped, restarted, or whatsoever.
Suggestion: if you have more available servers in the pool, live migrate all guest VMs from affected server(s) to working ones and reboot affected servers.
That's all!!
lunedì 6 agosto 2012
Oracle VM: Some useful tips using XM command
This post states some obvious commands, which are well known by majority of sys admins using XEN hypervisors.
Anyway I whish to share these commands since I think they are pretty useful, infact I had to deal with command line when my VM Manager had troubles.
Let's start saying that XM commands are performed connecting to physical Oracle VM servers and should be used carefully since they are pretty powerful and could potentially destroy your VM environment just with a click.
A good practice is to deal with XM CLI only if VM Manager is unusable, since it's preferrable to execute tasks by VM Manager itself rather than by physical server, especially in an environment with more than one physical server because XM CLI commands could potentially lead to inconsistencies between physical servers.
Another thing to note before using XM CLI is that as stated by server itself: making manual modifications in the management domain might cause inconsistencies between Oracle VM Manager and the server.
XM provide a lot of functionalities and you can check them all by just typing:
[root@orclvmsrv1 ~]# xm
Oracle VM identifies guest VMs by assigning them an unique ID, despite the name you gave to VM during creation, so when you perform an action using XM CLI you need to refer to VMs using that ID instead of the VM name you gave.
I suggest when you create a new VM using VM Manager to take note of "VM Name - assigned ID" because it could be useful for future references.
If you didn't do that don't be worried, there's a solution anyway, you can see what's the VM name on vm.cfg file:
[root@orclvmsrv1 ~]# cd /OVS/Repositories/0004fb0000030000fc2ad4059c973859
[root@orclvmsrv1 0004fb0000030000fc2ad4059c973859]# ls
Assemblies ISOs lost+found Templates VirtualDisks VirtualMachines
As you can see above:
0004fb0000030000fc2ad4059c973859 is the REPOSITORY ID, every repository contains the following folders: Assemblies ISOs lost+found Templates VirtualDisks VirtualMachines
VM configuration files are placed in VirtualMachines folder.In this case I've 3 VMs in this Repository and these are VM's ID.
[root@orclvmsrv1 0004fb0000030000fc2ad4059c973859]# ls VirtualMachines/
0004fb00000600003ace83d53d5313b0 0004fb0000060000e0f49015b41ead02 0004fb00000600005d4bfe48c8fe0cf9
To check what's the name of a certain VM just have a look at vm.cfg file contained in every of the folders above.
[root@orclvmsrv1 VirtualMachines]# cat 0004fb0000060000e0f49015b41ead02/vm.cfg | grep OVM_simple_name
and search for OVM_simple_name attribute which tells you what's the name you assigned to that VM.
OVM_simple_name = 'VMM'
Now that you know how to identify VMs by theyr ID it's time to do some basic stuff:
1)List all running VMs:
[root@orclvmsrv1 ~]# xm list
Name ID Mem VCPUs State Time(s)
0004fb00000600003ace83d53d5313b0 1 4096 4 -b---- 9343.5
0004fb0000060000e0f49015b41ead02 8 4096 4 -b---- 832.9
Domain-0 0 726 12 r----- 14059.0
As you can see I've two running VMs in my domain.
2)Stop a running VM:
[root@orclvmsrv1 ~]# xm shutdown 0004fb00000600003ace83d53d5313b0
I gracefully stopped a guest VM
3)Kill a running VM:
Same thing as above, but instead of "shutdown" use "destroy"
[root@orclvmsrv1 ~]# xm destroy 0004fb00000600003ace83d53d5313b0
4) Start a (non running) VM:
If you have a VM that is not currently in running state and you wish to start it:
[root@orclvmsrv1 VirtualMachines]# xm create 0004fb00000600005d4bfe48c8fe0cf9/vm.cfg
Please note that in this case I was in VirtualMachines folder.You could need to use full path to vm.cfg file.
5) Live migrate running VM to another Oracle VM server in the same Pool:
This can be done in two ways, specifying destination server IP address or, as I suggest, just typing destination server name.This is useful if you have a lot of servers in your infrastructure, and remembering server names it's usually easier than IP addresses.
You need to add your servers names to host file:
[root@orclvmsrv1 ~]# vi /etc/hosts
Add all your servers:
10.0.0.103 orclvmserver2
10.0.0.104 orclvmserver3
10.0.0.105 orclvmserver4
Save file, then you can migrate your VM to orclvmserver2:
[root@orclvmsrv1 ~]# xm migrate -l 0004fb00000600005d4bfe48c8fe0cf9 orclvmserver2
In a future post I will explain the use of another great CLI: Oracle VM Manager 3 CLI
which was introduced since VM Manager 3.1.1 build 365 and performs almost any task of VM manager but via CLI instead of web interface.
That's all!!
Anyway I whish to share these commands since I think they are pretty useful, infact I had to deal with command line when my VM Manager had troubles.
Let's start saying that XM commands are performed connecting to physical Oracle VM servers and should be used carefully since they are pretty powerful and could potentially destroy your VM environment just with a click.
A good practice is to deal with XM CLI only if VM Manager is unusable, since it's preferrable to execute tasks by VM Manager itself rather than by physical server, especially in an environment with more than one physical server because XM CLI commands could potentially lead to inconsistencies between physical servers.
Another thing to note before using XM CLI is that as stated by server itself: making manual modifications in the management domain might cause inconsistencies between Oracle VM Manager and the server.
XM provide a lot of functionalities and you can check them all by just typing:
[root@orclvmsrv1 ~]# xm
Oracle VM identifies guest VMs by assigning them an unique ID, despite the name you gave to VM during creation, so when you perform an action using XM CLI you need to refer to VMs using that ID instead of the VM name you gave.
I suggest when you create a new VM using VM Manager to take note of "VM Name - assigned ID" because it could be useful for future references.
If you didn't do that don't be worried, there's a solution anyway, you can see what's the VM name on vm.cfg file:
[root@orclvmsrv1 ~]# cd /OVS/Repositories/0004fb0000030000fc2ad4059c973859
[root@orclvmsrv1 0004fb0000030000fc2ad4059c973859]# ls
Assemblies ISOs lost+found Templates VirtualDisks VirtualMachines
As you can see above:
0004fb0000030000fc2ad4059c973859 is the REPOSITORY ID, every repository contains the following folders: Assemblies ISOs lost+found Templates VirtualDisks VirtualMachines
VM configuration files are placed in VirtualMachines folder.In this case I've 3 VMs in this Repository and these are VM's ID.
[root@orclvmsrv1 0004fb0000030000fc2ad4059c973859]# ls VirtualMachines/
0004fb00000600003ace83d53d5313b0 0004fb0000060000e0f49015b41ead02 0004fb00000600005d4bfe48c8fe0cf9
To check what's the name of a certain VM just have a look at vm.cfg file contained in every of the folders above.
[root@orclvmsrv1 VirtualMachines]# cat 0004fb0000060000e0f49015b41ead02/vm.cfg | grep OVM_simple_name
and search for OVM_simple_name attribute which tells you what's the name you assigned to that VM.
OVM_simple_name = 'VMM'
Now that you know how to identify VMs by theyr ID it's time to do some basic stuff:
1)List all running VMs:
[root@orclvmsrv1 ~]# xm list
Name ID Mem VCPUs State Time(s)
0004fb00000600003ace83d53d5313b0 1 4096 4 -b---- 9343.5
0004fb0000060000e0f49015b41ead02 8 4096 4 -b---- 832.9
Domain-0 0 726 12 r----- 14059.0
As you can see I've two running VMs in my domain.
2)Stop a running VM:
[root@orclvmsrv1 ~]# xm shutdown 0004fb00000600003ace83d53d5313b0
I gracefully stopped a guest VM
3)Kill a running VM:
Same thing as above, but instead of "shutdown" use "destroy"
[root@orclvmsrv1 ~]# xm destroy 0004fb00000600003ace83d53d5313b0
4) Start a (non running) VM:
If you have a VM that is not currently in running state and you wish to start it:
[root@orclvmsrv1 VirtualMachines]# xm create 0004fb00000600005d4bfe48c8fe0cf9/vm.cfg
Please note that in this case I was in VirtualMachines folder.You could need to use full path to vm.cfg file.
5) Live migrate running VM to another Oracle VM server in the same Pool:
This can be done in two ways, specifying destination server IP address or, as I suggest, just typing destination server name.This is useful if you have a lot of servers in your infrastructure, and remembering server names it's usually easier than IP addresses.
You need to add your servers names to host file:
[root@orclvmsrv1 ~]# vi /etc/hosts
Add all your servers:
10.0.0.103 orclvmserver2
10.0.0.104 orclvmserver3
10.0.0.105 orclvmserver4
Save file, then you can migrate your VM to orclvmserver2:
[root@orclvmsrv1 ~]# xm migrate -l 0004fb00000600005d4bfe48c8fe0cf9 orclvmserver2
In a future post I will explain the use of another great CLI: Oracle VM Manager 3 CLI
which was introduced since VM Manager 3.1.1 build 365 and performs almost any task of VM manager but via CLI instead of web interface.
That's all!!
giovedì 2 agosto 2012
Oracle VM: Timeout starting OVMM service
I encountered this problem a while ago during a VM Manager restart: OVMM service didn't started anymore going in timeout.
As a general suggestion when this happens first thing to do is to have a look at VM Manager logs, located at:
/u01/app/oracle/ovm-manager-3/machine1/base_adf_domain/servers/AdminServer/logs/AdminServer.log
if file is too long to read you could just give a try grepping only errors
cat /u01/app/oracle/ovm-manager-3/machine1/base_adf_domain/servers/AdminServer/logs/AdminServer.log | grep ERROR
In this case however OVMM Timeout was caused by an issue in /etc/init.d/ovmm file and in detail by this line:
nohup su - oracle -c "$USER_MEM_ARGS DOMAIN_PRODUCTION_MODE=true JAVA_OPTIONS=\"-Djava.awt.headless=true -Xdebug -Xrunjdwp:transport=dt_socket,address=127.0.0.1:8453,server=y,suspend=n -da:org.apache.myfaces.trinidad\" /u01/app/oracle/ovm-manager-3/machine1/base_adf_domain/startWebLogic.sh &" > /dev/null
As you can see by default ovmm start script starts WebLogic server as oracle user, instead of root user, the one used to perform VM Manager installation.
I just fixed it by simply swapping oracle user with root user, this happened despite before VM Manager installation I launched "createOracle.sh" script which performs oracle user creation and permissions assignment.
So, to solve this issue simply replace:
nohup su - oracle -c "$USER_MEM_ARGS DOMAIN_PRODUCTION_MODE=true JAVA_OPTIONS=\"-Djava.awt.headless=true -Xdebug -Xrunjdwp:transport=dt_socket,address=127.0.0.1:8453,server=y,suspend=n -da:org.apache.myfaces.trinidad\" /u01/app/oracle/ovm-manager-3/machine1/base_adf_domain/startWebLogic.sh &" > /dev/null
with:
nohup su - root -c "$USER_MEM_ARGS DOMAIN_PRODUCTION_MODE=true JAVA_OPTIONS=\"-Djava.awt.headless=true -Xdebug -Xrunjdwp:transport=dt_socket,address=127.0.0.1:8453,server=y,suspend=n -da:org.apache.myfaces.trinidad\" /u01/app/oracle/ovm-manager-3/machine1/base_adf_domain/startWebLogic.sh &" > /dev/null
Then start ovmm service again:
service ovmm start
That's all!!
As a general suggestion when this happens first thing to do is to have a look at VM Manager logs, located at:
/u01/app/oracle/ovm-manager-3/machine1/base_adf_domain/servers/AdminServer/logs/AdminServer.log
if file is too long to read you could just give a try grepping only errors
cat /u01/app/oracle/ovm-manager-3/machine1/base_adf_domain/servers/AdminServer/logs/AdminServer.log | grep ERROR
In this case however OVMM Timeout was caused by an issue in /etc/init.d/ovmm file and in detail by this line:
nohup su - oracle -c "$USER_MEM_ARGS DOMAIN_PRODUCTION_MODE=true JAVA_OPTIONS=\"-Djava.awt.headless=true -Xdebug -Xrunjdwp:transport=dt_socket,address=127.0.0.1:8453,server=y,suspend=n -da:org.apache.myfaces.trinidad\" /u01/app/oracle/ovm-manager-3/machine1/base_adf_domain/startWebLogic.sh &" > /dev/null
As you can see by default ovmm start script starts WebLogic server as oracle user, instead of root user, the one used to perform VM Manager installation.
I just fixed it by simply swapping oracle user with root user, this happened despite before VM Manager installation I launched "createOracle.sh" script which performs oracle user creation and permissions assignment.
So, to solve this issue simply replace:
nohup su - oracle -c "$USER_MEM_ARGS DOMAIN_PRODUCTION_MODE=true JAVA_OPTIONS=\"-Djava.awt.headless=true -Xdebug -Xrunjdwp:transport=dt_socket,address=127.0.0.1:8453,server=y,suspend=n -da:org.apache.myfaces.trinidad\" /u01/app/oracle/ovm-manager-3/machine1/base_adf_domain/startWebLogic.sh &" > /dev/null
with:
nohup su - root -c "$USER_MEM_ARGS DOMAIN_PRODUCTION_MODE=true JAVA_OPTIONS=\"-Djava.awt.headless=true -Xdebug -Xrunjdwp:transport=dt_socket,address=127.0.0.1:8453,server=y,suspend=n -da:org.apache.myfaces.trinidad\" /u01/app/oracle/ovm-manager-3/machine1/base_adf_domain/startWebLogic.sh &" > /dev/null
Then start ovmm service again:
service ovmm start
That's all!!
mercoledì 25 luglio 2012
Oracle VM: Using OVM Utils
OVM Utils are a set of utilities created by Wim Coekaerts (for further informations please read Wim's blog) and released on MOS that allow users to perform using Command Line Interface almost every task that can be performed using VM Manager web interface.
Installation is really simple, just download from http://support.oracle.com
Patch 13602094: ORACLE VM 3.0 UTILS RELEASE 0.4
It's a 2.9MB zip that will be installed on the same machine where Oracle VM Manager resides.
Once downloaded extract p13602094_30_Linux-x86-64.zip to
/u01/app/oracle/ovm-manager-3/
[root@vmm ovm-manager-3]# unzip p13602094_30_Linux-x86-64.zip
[root@vmm ovm-manager-3]# unzip ovm_utils_0.5.2.zip
[root@vmm ovm-manager-3]# cd ovm_utils
OVM Utils are 6 different executables:
ovm_managercontrol: Performs actions at VM Manager level such as configuring yum repos and create cpu compatibility group. This features is intresting since using this tool allows you to group to a single server pool server with different CPU family group.
Actions allowed are: yuminfo, yumsetup, addkeystore, keystoreinfo, createcpugroup, removecpugroup, addservertocpugroup, removeserverfromcpugroup, listcpugroups, getsessiontimeout,setsessiontimeout
ovm_poolcontrol: Performs actions at Pool level. Actions allowed are: status, info, events, refresh, list, addserver, removeserver
ovm_repocontrol: Performs actions at Repository level. Actions allowed are: list, status, info, refresh, fixup, create
ovm_servercontrol: Performs actions at Server level. Actions allowed are: start, stop, restart, kill, mainton, maintoff, status, info, lock, upgrade, events, refresh, discover, list, listnfsexports, createnfsexport, deletenfsexport
ovm_vmcontrol: Performs actions at Virtual Machine level. Actions allowed are: start, stop, suspend, resume, status, restart, kill, info, lock, list, migrate, events, vcpuset, vcpuget, gettags, settags, fixcfg, delete
ovm_vmdisks: Query the Virtual Disks associated with a Virtual Machine.
ovm_vmmessage: Allows the user to send a message to a Virtual Machine in the form of a key/value pair or send a query to see if a message with a key was set inside the Virtual Machine.
These utilities have to be called passing some parameters:
./ovm_UTILITYNAME -u ADMIN_USERNAME -p ADMIN_PASSWORD -h VMMANAGER_HOSTNAME -c COMMAND_TO_SEND [-OPTIONAL_PARAMETERS]
For example here are some commands:
1)Perform a server rediscovery. My server IP Address is 10.0.0.102
./ovm_servercontrol -u admin -p password -h localhost -c discover -s 10.0.0.102 -P server_password
2)List all VMs in the Pool
./ovm_vmcontrol -u admin -p password -h localhost -c list
This command produced, in my case, the following output:
VM name : 'Win7'
uuid : '0004fb00000600003ace83d53d5313b0'
server : 'orclvmsrv1'
pool : 'CHP'
status : 'Stopped'
VM name : 'EnterpriseManager'
uuid : '0004fb00000600005d4bfe48c8fe0cf9'
server : 'orclvmsrv1'
pool : 'CHP'
status : 'Running'
VM name : 'VMM'
uuid : '0004fb0000060000e0f49015b41ead02'
server : 'orclvmsrv1'
pool : 'CHP'
status : 'Running'
3)Stop a running VM
./ovm_vmcontrol -u admin -p password -h localhost -c stop -v EnterpriseManager
If you need more informations about OVM Utils you can just read the manual located at
/u01/app/oracle/ovm-manager-3/ovm_utils/man/man8
That's all!!
Installation is really simple, just download from http://support.oracle.com
Patch 13602094: ORACLE VM 3.0 UTILS RELEASE 0.4
It's a 2.9MB zip that will be installed on the same machine where Oracle VM Manager resides.
Once downloaded extract p13602094_30_Linux-x86-64.zip to
/u01/app/oracle/ovm-manager-3/
[root@vmm ovm-manager-3]# unzip p13602094_30_Linux-x86-64.zip
[root@vmm ovm-manager-3]# unzip ovm_utils_0.5.2.zip
[root@vmm ovm-manager-3]# cd ovm_utils
OVM Utils are 6 different executables:
ovm_managercontrol: Performs actions at VM Manager level such as configuring yum repos and create cpu compatibility group. This features is intresting since using this tool allows you to group to a single server pool server with different CPU family group.
Actions allowed are: yuminfo, yumsetup, addkeystore, keystoreinfo, createcpugroup, removecpugroup, addservertocpugroup, removeserverfromcpugroup, listcpugroups, getsessiontimeout,setsessiontimeout
ovm_poolcontrol: Performs actions at Pool level. Actions allowed are: status, info, events, refresh, list, addserver, removeserver
ovm_repocontrol: Performs actions at Repository level. Actions allowed are: list, status, info, refresh, fixup, create
ovm_servercontrol: Performs actions at Server level. Actions allowed are: start, stop, restart, kill, mainton, maintoff, status, info, lock, upgrade, events, refresh, discover, list, listnfsexports, createnfsexport, deletenfsexport
ovm_vmcontrol: Performs actions at Virtual Machine level. Actions allowed are: start, stop, suspend, resume, status, restart, kill, info, lock, list, migrate, events, vcpuset, vcpuget, gettags, settags, fixcfg, delete
ovm_vmdisks: Query the Virtual Disks associated with a Virtual Machine.
ovm_vmmessage: Allows the user to send a message to a Virtual Machine in the form of a key/value pair or send a query to see if a message with a key was set inside the Virtual Machine.
These utilities have to be called passing some parameters:
./ovm_UTILITYNAME -u ADMIN_USERNAME -p ADMIN_PASSWORD -h VMMANAGER_HOSTNAME -c COMMAND_TO_SEND [-OPTIONAL_PARAMETERS]
For example here are some commands:
1)Perform a server rediscovery. My server IP Address is 10.0.0.102
./ovm_servercontrol -u admin -p password -h localhost -c discover -s 10.0.0.102 -P server_password
2)List all VMs in the Pool
./ovm_vmcontrol -u admin -p password -h localhost -c list
This command produced, in my case, the following output:
VM name : 'Win7'
uuid : '0004fb00000600003ace83d53d5313b0'
server : 'orclvmsrv1'
pool : 'CHP'
status : 'Stopped'
VM name : 'EnterpriseManager'
uuid : '0004fb00000600005d4bfe48c8fe0cf9'
server : 'orclvmsrv1'
pool : 'CHP'
status : 'Running'
VM name : 'VMM'
uuid : '0004fb0000060000e0f49015b41ead02'
server : 'orclvmsrv1'
pool : 'CHP'
status : 'Running'
3)Stop a running VM
./ovm_vmcontrol -u admin -p password -h localhost -c stop -v EnterpriseManager
If you need more informations about OVM Utils you can just read the manual located at
/u01/app/oracle/ovm-manager-3/ovm_utils/man/man8
That's all!!
martedì 24 luglio 2012
Oracle Middleware: How to autostart Middleware services with NodeManager
This post explains how to configure NodeManager in order to perform services autostart in case of failure or manually via WebLogic Server web interface.
In order to configure NodeManager we need to create a configuration file, so login to your Oracle Middleware/WebLogic machine:
[oracle@orcl /]$ cd /home/oracle/Oracle/Middleware/wlserver_10.3/common/nodemanager
[oracle@orcl nodemanager]$ nano nodemanager.properties
Copy/paste the following configuration, changing "ListenAddress" and "ListenPort" according to your server configuration.
DomainsFile=/home/oracle/Oracle/Middleware/wlserver_10.3/common/nodemanager/nodemanager.domains
LogLimit=0
PropertiesVersion=10.3
DomainsDirRemoteSharingEnabled=false
javaHome=/home/oracle/Oracle/Middleware/jrockit_160_24_D1.1.2-4
AuthenticationEnabled=false
NodeManagerHome=/home/oracle/Oracle/Middleware/wlserver_10.3/common/nodemanager
JavaHome=/home/oracle/Oracle/Middleware/jrockit_160_24_D1.1.2-4/jre
LogLevel=INFO
DomainsFileEnabled=true
StartScriptName=startWebLogic.sh
ListenAddress=10.0.0.84
NativeVersionEnabled=true
ListenPort=5556
LogToStderr=true
SecureListener=false
LogCount=1
DomainRegistrationEnabled=false
StopScriptEnabled=false
QuitEnabled=false
LogAppend=true
StateCheckInterval=500
CrashRecoveryEnabled=true
StartScriptEnabled=true
LogFile=/home/oracle/Oracle/Middleware/wlserver_10.3/common/nodemanager/nodemanager.log
LogFormatter=weblogic.nodemanager.server.LogFormatter
ListenBacklog=50
Once this is done you can start Nodemanager:
[oracle@orcl nodemanager]$ /home/oracle/Oracle/Middleware/wlserver_10.3/server/bin/startNodeManager.sh
Now we need to configure WebLogic in order to make him communicate with NodeManager:
http://YOUR_MIDDLEWARE_SERVER_IP:7001/console
Click Machines -> Lock & Edit button -> New

Select a Name for Machine, set Unix and click Next button

Set "Type PLAIN" as we will not use SSL, "Listen Address" the IP address of your WLS machine and "Listen Port" the one configured in nodemanager.properties. Click Finish button then Activate Changes.

Click on the Machine you just created, in my case "Machine-0" then Configuration tab, Servers tab, Add button

Select an existing server to associate with NodeManager, click Finish button and then Activate Changes button.

Move to Servers tab, Control tab, select server and you will be able to control it from there.
In case of service failure it will be automatically restarted as long as Nodemanager and WebLogic Server are running.
I suggest you to add an autostart script for WebLogic and NodeManager in order to make them start automatically on boot.
In order to configure NodeManager we need to create a configuration file, so login to your Oracle Middleware/WebLogic machine:
[oracle@orcl /]$ cd /home/oracle/Oracle/Middleware/wlserver_10.3/common/nodemanager
[oracle@orcl nodemanager]$ nano nodemanager.properties
Copy/paste the following configuration, changing "ListenAddress" and "ListenPort" according to your server configuration.
DomainsFile=/home/oracle/Oracle/Middleware/wlserver_10.3/common/nodemanager/nodemanager.domains
LogLimit=0
PropertiesVersion=10.3
DomainsDirRemoteSharingEnabled=false
javaHome=/home/oracle/Oracle/Middleware/jrockit_160_24_D1.1.2-4
AuthenticationEnabled=false
NodeManagerHome=/home/oracle/Oracle/Middleware/wlserver_10.3/common/nodemanager
JavaHome=/home/oracle/Oracle/Middleware/jrockit_160_24_D1.1.2-4/jre
LogLevel=INFO
DomainsFileEnabled=true
StartScriptName=startWebLogic.sh
ListenAddress=10.0.0.84
NativeVersionEnabled=true
ListenPort=5556
LogToStderr=true
SecureListener=false
LogCount=1
DomainRegistrationEnabled=false
StopScriptEnabled=false
QuitEnabled=false
LogAppend=true
StateCheckInterval=500
CrashRecoveryEnabled=true
StartScriptEnabled=true
LogFile=/home/oracle/Oracle/Middleware/wlserver_10.3/common/nodemanager/nodemanager.log
LogFormatter=weblogic.nodemanager.server.LogFormatter
ListenBacklog=50
Once this is done you can start Nodemanager:
[oracle@orcl nodemanager]$ /home/oracle/Oracle/Middleware/wlserver_10.3/server/bin/startNodeManager.sh
Now we need to configure WebLogic in order to make him communicate with NodeManager:
http://YOUR_MIDDLEWARE_SERVER_IP:7001/console
Click Machines -> Lock & Edit button -> New

Select a Name for Machine, set Unix and click Next button

Set "Type PLAIN" as we will not use SSL, "Listen Address" the IP address of your WLS machine and "Listen Port" the one configured in nodemanager.properties. Click Finish button then Activate Changes.

Click on the Machine you just created, in my case "Machine-0" then Configuration tab, Servers tab, Add button

Select an existing server to associate with NodeManager, click Finish button and then Activate Changes button.

Move to Servers tab, Control tab, select server and you will be able to control it from there.
In case of service failure it will be automatically restarted as long as Nodemanager and WebLogic Server are running.
I suggest you to add an autostart script for WebLogic and NodeManager in order to make them start automatically on boot.
venerdì 20 luglio 2012
Oracle VM: Upgrade VM Manager to 3.1.1-365
This post is related to a recent patch released by Oracle with improves and corrects some issues affecting VM Manager 3.1.1.
To apply this patch first you need to download it from MOS:
Download Patch 14227416
When downloaded burn .iso file to a cd and mount it to your VM Manager Linux
[root@vmm /]# mount /dev/cdrom /mnt/cdrom
[root@vmm /]# cd /mnt/cdrom
Or if you like you can mount the .iso directly
[root@vmm /]# mount -o loop ovmm-3.1.1-upgrade-b365.iso /mnt/cdrom
[root@vmm /]# cd /mnt/cdrom
Start installation process by simply running
[root@vmm /]# ./runUpgrader.sh
Please note that you should perform a full backup of VM Manager database in case something goes wrong during installation process.
Here is the output produced during patch apply:
Stating OVM Manager upgrade on Thu Jul 19 11:15:58 CEST 2012
Oracle VM Manager 3.1.1.365 upgrade utility
Upgrade logfile : /tmp/upgrade-2012-07-19-15.log
It is highly recommended to do a full database repository backup prior to upgrading Oracle VM Manager ...
Press any key to continue ...
Oracle VM Manager is running ...
Verifying installation status ...
Read Oracle VM Manager config file ...
Skipping database upgrade for the same product version (3.1.1 to 3.1.1)
Found Oracle VM Manager install files ...
Found Oracle VM Manager upgrader ...
Found Oracle WebLogic Server ...
Found Java ...
Using the following information :
Database Host : 10.0.0.74
Database SID : ORCL
Database LSNR : 1521
Oracle VM Schema : ovs
Oracle VM Manager UUID : 0004fb0000010000aef89d7d546a0d5e
Current Build ID : 3.1.1.305
Upgrade from version : 3.1.1
Upgrade to version : 3.1.1
Using /tmp/workdir.RnNTi2YzKa for backup and export location.
Using /tmp/patchdir.5j35ZzYWj for patching.
Undeploying previous version of Oracle VM Manager application ...
Undeploying Oracle VM Manager help ...
Undeploying Oracle VM Manager console ...
Undeploying Oracle VM Manager core ...
Waiting for Oracle VM Manager core to fully undeploy...
Waiting...
Finished undeploying previous version ...
Upgrading Oracle VM Manager ...
Backing up old files to /tmp/ovm-manager-3-backup-2012-07-19-111726...
Removing old files ...
Unpacking Oracle VM Manager 3.1.1.365
Refresh system-jazn-data.xml file ...
Redeploying Oracle VM Manager core container ...
Redeploying Oracle VM Manager console ...
Redeploying Oracle VM Manager help ...
Unpacking Oracle VM Manager OVM CLI Tool
Completed upgrade to 3.1.1.365 ...
Writing updated config in /u01/app/oracle/ovm-manager-3/.config
Restart WebLogic ...
Stopping Oracle VM Manager [ OK ]
Starting Oracle VM Managernohup: ignoring input and redirecting stderr to stdout
[ OK ]
OVM Manager upgrade finished on Thu Jul 19 11:18:57 CEST 2012
Once installation is completed login to your VM Manager and everything should be back as normal and if you go to Help -> About you will see:
Oracle VM Manager
Version: 3.1.1.365
Build: 20120615_365
That's all!!
To apply this patch first you need to download it from MOS:
Download Patch 14227416
When downloaded burn .iso file to a cd and mount it to your VM Manager Linux
[root@vmm /]# mount /dev/cdrom /mnt/cdrom
[root@vmm /]# cd /mnt/cdrom
Or if you like you can mount the .iso directly
[root@vmm /]# mount -o loop ovmm-3.1.1-upgrade-b365.iso /mnt/cdrom
[root@vmm /]# cd /mnt/cdrom
Start installation process by simply running
[root@vmm /]# ./runUpgrader.sh
Please note that you should perform a full backup of VM Manager database in case something goes wrong during installation process.
Here is the output produced during patch apply:
Stating OVM Manager upgrade on Thu Jul 19 11:15:58 CEST 2012
Oracle VM Manager 3.1.1.365 upgrade utility
Upgrade logfile : /tmp/upgrade-2012-07-19-15.log
It is highly recommended to do a full database repository backup prior to upgrading Oracle VM Manager ...
Press any key to continue ...
Oracle VM Manager is running ...
Verifying installation status ...
Read Oracle VM Manager config file ...
Skipping database upgrade for the same product version (3.1.1 to 3.1.1)
Found Oracle VM Manager install files ...
Found Oracle VM Manager upgrader ...
Found Oracle WebLogic Server ...
Found Java ...
Using the following information :
Database Host : 10.0.0.74
Database SID : ORCL
Database LSNR : 1521
Oracle VM Schema : ovs
Oracle VM Manager UUID : 0004fb0000010000aef89d7d546a0d5e
Current Build ID : 3.1.1.305
Upgrade from version : 3.1.1
Upgrade to version : 3.1.1
Using /tmp/workdir.RnNTi2YzKa for backup and export location.
Using /tmp/patchdir.5j35ZzYWj for patching.
Undeploying previous version of Oracle VM Manager application ...
Undeploying Oracle VM Manager help ...
Undeploying Oracle VM Manager console ...
Undeploying Oracle VM Manager core ...
Waiting for Oracle VM Manager core to fully undeploy...
Waiting...
Finished undeploying previous version ...
Upgrading Oracle VM Manager ...
Backing up old files to /tmp/ovm-manager-3-backup-2012-07-19-111726...
Removing old files ...
Unpacking Oracle VM Manager 3.1.1.365
Refresh system-jazn-data.xml file ...
Redeploying Oracle VM Manager core container ...
Redeploying Oracle VM Manager console ...
Redeploying Oracle VM Manager help ...
Unpacking Oracle VM Manager OVM CLI Tool
Completed upgrade to 3.1.1.365 ...
Writing updated config in /u01/app/oracle/ovm-manager-3/.config
Restart WebLogic ...
Stopping Oracle VM Manager [ OK ]
Starting Oracle VM Managernohup: ignoring input and redirecting stderr to stdout
[ OK ]
OVM Manager upgrade finished on Thu Jul 19 11:18:57 CEST 2012
Once installation is completed login to your VM Manager and everything should be back as normal and if you go to Help -> About you will see:
Oracle VM Manager
Version: 3.1.1.365
Build: 20120615_365
That's all!!
domenica 15 luglio 2012
OBIEE: Creating ASInstance Failed
I've encountered this problem sometimes while installing OBIEE on Oracle Linux: during installation process "Creating ASInstace" task was unable to be completed.
This seems to be a well know issue infact it has a pretty good amount of threads and discussions over OTN and luckily it's simply solvable by editing "/etc/hosts" file.
The trick is to insert first the machine IP address and then loopback address.
Edit host file in a similar way according to your network configuration.
[oracle@orcl ~]$ nano /etc/hosts
10.0.0.20 orcl
127.0.0.1 localhost
Start a new OBIEE installation and this time "Creating ASInstace" will be completed successfully.
This seems to be a well know issue infact it has a pretty good amount of threads and discussions over OTN and luckily it's simply solvable by editing "/etc/hosts" file.
The trick is to insert first the machine IP address and then loopback address.
Edit host file in a similar way according to your network configuration.
[oracle@orcl ~]$ nano /etc/hosts
10.0.0.20 orcl
127.0.0.1 localhost
Start a new OBIEE installation and this time "Creating ASInstace" will be completed successfully.
giovedì 5 luglio 2012
How To Expand LVM Volume
One of the great features of Oracle Linux is that it uses by default Logical Volume to group physical volumes.
This means that if we ran out of disk space we can add another disk, physical hard drive or virtual disk if we are on a guest VM, and expand the original volume increasing available space.
Log in to your machine and run "df -h" and write somewhere the output it produces:
[root@orcl ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_orcl-lv_root 118G 21G 92G 19% /
/dev/mapper/vg_orcl-lv_home 5.0G 1.7G 3.0G 36% /home
tmpfs 1.5G 0 1.5G 0% /dev/shm
/dev/xvda1 485M 51M 409M 12% /boot
as you can see we have:
Volume Group= vg_orcl
Logical Volume= lv_root and lv_home
Based on what we would like to expand we will use either lv_root or lv_home.
In this post I need to increase disk space for expanding a database tablespace. Since Database is installed on "/u01" directory I need to expand the Logical Volume lv_root which has a mount point of "/".
Power off machine (or VM guest in my case) and attach to it new physical hard drive or virtual disk.
Now we need to boot the machine using a Live CD since we have to do some stuff on partitions and we can't do it if partitions are mounted.
I use RescueLinux which is a pretty small Live CD.
When booted from LiveCD:
[root@orcl ~]# fdisk /dev/sdb (OR /dev/sdc OR /dev/sdd if you add your second or third hard disk)
Press n for creating new partition
Press p for primary
Press 1
Press enter
Press enter
Press t for partition type and choose 8e for LVM
Press w to write changes
[root@orcl ~]# lvm
lvm> pvcreate /dev/sdb1 (OR /dev/sdc1 OR /dev/sdd1 if you add your second or third volume)
Physical volume "/dev/sda1" successfully created
lvm> vgextend vg_orcl /dev/sdb1
Volume group "vg_orcl" successfully extended
lvm> lvextend -l +100%FREE /dev/vg_orcl/lv_root
Extending logical volume lv_root to 250.47 GB
Logical volume lv_root successfully resized
[root@orcl ~]# e2fsck –f /dev/vg_orcl/lv_root
[root@orcl ~]# resize2fs /dev/vg_orcl/lv_root
Reboot and remove LiveCD.
Run "df -h" and if everything went fine you will have increased available disk space on VolumeGroup.
This means that if we ran out of disk space we can add another disk, physical hard drive or virtual disk if we are on a guest VM, and expand the original volume increasing available space.
[root@orcl ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_orcl-lv_root 118G 21G 92G 19% /
/dev/mapper/vg_orcl-lv_home 5.0G 1.7G 3.0G 36% /home
tmpfs 1.5G 0 1.5G 0% /dev/shm
/dev/xvda1 485M 51M 409M 12% /boot
as you can see we have:
Volume Group= vg_orcl
Logical Volume= lv_root and lv_home
Based on what we would like to expand we will use either lv_root or lv_home.
In this post I need to increase disk space for expanding a database tablespace. Since Database is installed on "/u01" directory I need to expand the Logical Volume lv_root which has a mount point of "/".
Power off machine (or VM guest in my case) and attach to it new physical hard drive or virtual disk.
Now we need to boot the machine using a Live CD since we have to do some stuff on partitions and we can't do it if partitions are mounted.
I use RescueLinux which is a pretty small Live CD.
When booted from LiveCD:
[root@orcl ~]# fdisk /dev/sdb (OR /dev/sdc OR /dev/sdd if you add your second or third hard disk)
Press n for creating new partition
Press p for primary
Press 1
Press enter
Press enter
Press t for partition type and choose 8e for LVM
Press w to write changes
[root@orcl ~]# lvm
lvm> pvcreate /dev/sdb1 (OR /dev/sdc1 OR /dev/sdd1 if you add your second or third volume)
Physical volume "/dev/sda1" successfully created
lvm> vgextend vg_orcl /dev/sdb1
Volume group "vg_orcl" successfully extended
lvm> lvextend -l +100%FREE /dev/vg_orcl/lv_root
Extending logical volume lv_root to 250.47 GB
Logical volume lv_root successfully resized
[root@orcl ~]# e2fsck –f /dev/vg_orcl/lv_root
[root@orcl ~]# resize2fs /dev/vg_orcl/lv_root
Reboot and remove LiveCD.
Run "df -h" and if everything went fine you will have increased available disk space on VolumeGroup.
sabato 30 giugno 2012
Oracle VM Backup Running Guests VMs
In this post I provide a way to perform backup of running VMs for disaster recovery purpouse. Basically this procedure transfers VM Disks from production Repository to a different backup Repository placed on another SAN storage.
Please bear in mind that this backup does NOT guarantee data consistency so if your VMs runs apps such as DBs consider a backup strategy using utility tools such as rman.
In case you need to recover a VM you need first to delete the VM and corresponding disks from VM Manager then import backed up disk image and recreate the VM using imported disk image as virtual disk.

I use a dedicated Oracle Linux 6 U2 server to perform backups; it's basically a VM using a virtual disk mapped to a Repository created on an ISCSI separated storage.
Let's start step-by-step:
First I've created a dedicated Backup VM in VM Manager.
NOTE: Consider carefully the VirtualDisk size since in this machine you will store backup VirtualDisks. For example if you need to backup 5 VMs each one with a 20GB hard disk you need to have AT LEAST 20*5=100GB available disk space after system installation.
Second step is to install OS. I use Oracle Linux 6 U2 server.
Please refer to this guide to install oracle Linux: Oracle Linux installation & configuration guide
When OS is installed I created a dedicated user to perform backups:
[root@orcl ~]$ adduser VMBackup
Then I need to install two additional packages to allow backup script to be correctly executed:
[root@orcl ~]$ mkdir /mnt/cdrom
[root@orcl ~]$ mount /dev/cdrom /mnt/cdrom
[root@orcl ~]$ cd /mnt/cdrom/Packages
[root@orcl Packages]# rpm -Uvh tcl-8.5.7-6.el6.x86_64.rpm
[root@orcl Packages]# rpm -Uvh expect-5.44.1.15-2.el6.x86_64.rpm
Switch to VMBackup user:
[root@orcl ~]$ su - VMBackup
and create VMBackup.sh script
[VMBackup@orcl ~]$ nano /home/VMBackup/VMBackup.sh
NOTE: This code is inspired by "Automate SCP command using Shell Script" so credits for part of this script goes to Santhosh Kumar T.
Copy/Paste this code.
I know it's far from an elegant (and clean) code but it does the job so...
#!/bin/bash
##EDIT THIS VALUE
#Insert IP Address of your VM Server
YOUR_SERVER_IP_ADDRESS=10.0.0.12
##EDIT THIS VALUE
#Insert root password of your VM Server
YOUR_SERVER_PASSWORD=password
if [ $# -eq 0 ] ; then
echo 'Usage: VMBackup [backup | restore] [Repository ID] [VM VirtualDisk ID]'
exit 0
fi
case "$1" in
backup)
cat > /home/VMBackup/backup.sh <<EOF
#!/usr/bin/expect -f
spawn scp "root@$YOUR_SERVER_IP_ADDRESS:/OVS/Repositories/$2/VirtualDisks/$3.img" /home/VMBackup/$3.img
expect {
-re ".*es.*o.*" {
exp_send "yes\r"
exp_continue
}
-re ".*sword.*" {
exp_send "$YOUR_SERVER_PASSWORD\r"
}
}
interact
EOF
chmod a+x backup.sh
/home/VMBackup/backup.sh
rm /home/VMBackup/backup.sh
;;
restore)
cat > /home/VMBackup/restore.sh <<EOF
#!/usr/bin/expect -f
spawn scp /home/VMBackup/$3.img "root@$YOUR_SERVER_IP_ADDRESS:/OVS/Repositories/$2/VirtualDisks/$3.img"
expect {
-re ".*es.*o.*" {
exp_send "yes\r"
exp_continue
}
-re ".*sword.*" {
exp_send "$YOUR_SERVER_PASSWORD\r"
}
}
interact
EOF
chmod a+x restore.sh
/home/VMBackup/restore.sh
rm /home/VMBackup/restore.sh
;;
*) echo 'Usage: VMBackup [backup | restore] [Repository ID] [VM VirtualDisk ID]' ;;
esac
Then...
[VMBackup@orcl ~]$ chmod a+x /home/VMBackup/VMBackup.sh
and this is the command you use to perform a backup:
[VMBackup@orcl ~]$ /home/VMBackup/VMBackup.sh backup REPOSITORY_ID VIRTUAL_DISK_ID
or a restore:
[VMBackup@orcl ~]$ /home/VMBackup/VMBackup.sh restore REPOSITORY_ID VIRTUAL_DISK_ID
For example if your VirtualDisk location is:
/OVS/Repositories/0004fb0000030000ad1f4d7286b3abcd/VirtualDisks/0004fb00001200005ab2a78b4b71abcd.img
REPOSITORY_ID=0004fb0000030000ad1f4d7286b3abcd
VIRTUAL_DISK_ID=0004fb00001200005ab2a78b4b71abcd
the command to backup VirtualDisk 0004fb00001200005ab2a78b4b71abcd is
[VMBackup@orcl ~]$ /home/VMBackup/VMBackup.sh backup 0004fb0000030000ad1f4d7286b3abcd 0004fb00001200005ab2a78b4b71abcd
Reasonably you'll need to add this script to crontab so it will perform automated backups at certain time.
That's all!!
mercoledì 27 giugno 2012
Automating Business Intelligence Startup and Shutdown on Linux
It's pretty common to install Oracle Middleware on an "unmanned" server, which means that there's no dedicated server admin or in general a person who could manually start the services in event of server failure. So I usually create boot scripts that prevent services downtime in case of server restart or server crash.
This script is intended for automate starting of Oracle Business Intelligence on a Linux Server. I run this script on Oracle Linux 6 but this should work on other distributions too.
[root@orcl ~]# nano /etc/init.d/bi
#! /bin/bash
#
# OBIEE Start/Stop Script
#
# chkconfig: 345 20 80
# description: Starts and stops the Oracle BI and listeners
#
# Set BI_HOME to be equal to the $ORACLE_HOME
#
# Set ORA_OWNER to the user id of the owner of the OBIEE.
BI_HOME=/home/oracle/obiee
ORA_OWNER=oracle
export ORACLE_INSTANCE=$BI_HOME/instances/instance1
start()
{
echo "Starting BI service "
su $ORA_OWNER -c "$BI_HOME/Oracle_BI1/opmn/bin/opmnctl startall"
su $ORA_OWNER $BI_HOME/user_projects/domains/bifoundation_domain/startWebLogic.sh > /dev/null 2>&1 &
}
stop()
{
echo "Stopping BI service "
su $ORA_OWNER -c "$BI_HOME/Oracle_BI1/opmn/bin/opmnctl stopall"
su $ORA_OWNER $BI_HOME/user_projects/domains/bifoundation_domain/bin/stopWebLogic.sh > /dev/null 2>&1 &
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status -p $pidfile $processname
RETVAL=$?
;;
restart)
stop
start
;;
condrestart)
if [ -f /var/lock/subsys/$servicename ]; then
stop
start
fi
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart}"
;;
esac
exit $RETVAL
Chmod this script and make it executable on boot
[root@orcl ~]# chmod 750 /etc/init.d/bi
[root@orcl ~]# chkconfig --add bi
We need to allow Weblogic autostart forcing username and password, I know it's a security risk display username and password in plaintext, since by default Oracle stores passowrd information in boot.properties by encryprint using AES.
[root@orcl ~]# nano /home/oracle/obiee/user_projects/domains/bifoundation_domain/servers/AdminServer/security/boot.properties
password=YOUR_WEBLOGIC_PASSWORD_HERE
username=YOUR_WEBLOGIC_USERNAME_HERE
[root@orcl ~]# chown oracle /home/oracle/obiee/user_projects/domains/bifoundation_domain/servers/AdminServer/security/boot.properties
Now everything should work as expected!!
Try if everything works fine:
[root@orcl ~]# /etc/init.d/bi start
If you would like to have Weblogic output you can modify script, though I suggest to leave output redirection enabled, maybe change it from /dev/null to an appropriate log file.
su $ORA_OWNER $BI_HOME/user_projects/domains/bifoundation_domain/startWebLogic.sh &
On start Weblogic returned this error:
PKI-02002: Unable to open the wallet. Check password.
which was solved chmodding /tmp directory
chmod -R 777 /tmp
That's all!!
This script is intended for automate starting of Oracle Business Intelligence on a Linux Server. I run this script on Oracle Linux 6 but this should work on other distributions too.
[root@orcl ~]# nano /etc/init.d/bi
#! /bin/bash
#
# OBIEE Start/Stop Script
#
# chkconfig: 345 20 80
# description: Starts and stops the Oracle BI and listeners
#
# Set BI_HOME to be equal to the $ORACLE_HOME
#
# Set ORA_OWNER to the user id of the owner of the OBIEE.
BI_HOME=/home/oracle/obiee
ORA_OWNER=oracle
export ORACLE_INSTANCE=$BI_HOME/instances/instance1
start()
{
echo "Starting BI service "
su $ORA_OWNER -c "$BI_HOME/Oracle_BI1/opmn/bin/opmnctl startall"
su $ORA_OWNER $BI_HOME/user_projects/domains/bifoundation_domain/startWebLogic.sh > /dev/null 2>&1 &
}
stop()
{
echo "Stopping BI service "
su $ORA_OWNER -c "$BI_HOME/Oracle_BI1/opmn/bin/opmnctl stopall"
su $ORA_OWNER $BI_HOME/user_projects/domains/bifoundation_domain/bin/stopWebLogic.sh > /dev/null 2>&1 &
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status -p $pidfile $processname
RETVAL=$?
;;
restart)
stop
start
;;
condrestart)
if [ -f /var/lock/subsys/$servicename ]; then
stop
start
fi
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart}"
;;
esac
exit $RETVAL
Chmod this script and make it executable on boot
[root@orcl ~]# chmod 750 /etc/init.d/bi
[root@orcl ~]# chkconfig --add bi
We need to allow Weblogic autostart forcing username and password, I know it's a security risk display username and password in plaintext, since by default Oracle stores passowrd information in boot.properties by encryprint using AES.
[root@orcl ~]# nano /home/oracle/obiee/user_projects/domains/bifoundation_domain/servers/AdminServer/security/boot.properties
password=YOUR_WEBLOGIC_PASSWORD_HERE
username=YOUR_WEBLOGIC_USERNAME_HERE
[root@orcl ~]# chown oracle /home/oracle/obiee/user_projects/domains/bifoundation_domain/servers/AdminServer/security/boot.properties
Now everything should work as expected!!
Try if everything works fine:
[root@orcl ~]# /etc/init.d/bi start
If you would like to have Weblogic output you can modify script, though I suggest to leave output redirection enabled, maybe change it from /dev/null to an appropriate log file.
su $ORA_OWNER $BI_HOME/user_projects/domains/bifoundation_domain/startWebLogic.sh &
On start Weblogic returned this error:
PKI-02002: Unable to open the wallet. Check password.
which was solved chmodding /tmp directory
chmod -R 777 /tmp
That's all!!
Iscriviti a:
Commenti (Atom)





