May 15th, 2012 | Tags: , , ,

Oracle VM, is a centrally managed hypervisor.  All administrative actions must be performed from the Oracle VM Manager.  In order to facilitate the initial discovery of the Hypervisor by the Management Server part of the setup requires that we not only set the password for the root user, but also the password for the ovs-agent.  We then initiate a discovery process from the management server to the hypervisor and end up able to manage our hypervisor.

During my setup I misplaced the password for the agent.  This resulted in my management server being unable to successfully authenticate with the hypervisor in order to complete the discovery process.

Once you have successfully discovered the hypervisor you can change the agent password at the server pool level, which will allow you to maintain different agent passwords for different logical areas.

In my environment I am using OVM 3.1.1.

# ovs-agent-passwd oracle
Password: <yourpasshere>
Again: <yourpasshere>

After changing the password, discovery went off without a hitch, of course I could have just as easily misplaced it again, and I would have been right back at square one.

May 14th, 2012 | Tags: , , ,

In my new role at Keste, I am tasked with staying on the bleeding edge of software release cycles, so that we can be knowledgeable and authoritative about technology when we engage with customers.  One of the areas where Keste leads is on Oracle’s Virtualization Offerings.  So I will be posting more and more content with respect to those offerings.

Today I will be documenting the steps to install Oracle VM Manager 3.1.1.  Oracle VM (OVM) is a Xen-based Virtualization Technology.  An OVM Deployment consists of the OVM Server (the bare metal hypervisor) and the OVM Manager, the application stack which manages the afforementioned hypervisors (organized into Server Pools).

The OVM Server installation is really no different from a standard Oracle Linux, or even RHEL install, so I am not going to bother writing that one up unless something changes architecturally.

Now to get started I have pre-provisioned a Oracle Linux Server (5.6) machine which will accept the OVM Manager application.

# cat /etc/issue
Oracle Linux Server release 5.6
Kernel \r on an \m

Download Media

Download Oracle VM Manager 3.1.1 from

Mount Media

I have an NFS mount which holds my media, but the process is the same if you are using local storage.  We want to mount the iso image file into a folder (/mnt in my case)

# mount -o loop /nfsmount/OracleVM-Manager-3.1.1.iso /mnt
# cd /mnt
# ls
components       EULA     oracle-validated.params  TRANS.TBL  LICENSE  ovmm-installer.bsx   upgrade

Prepare Machine for Installation

Oracle VM Manager includes a script which does most of the dirty work for us…  This will create the users/groups, folders, and iptables rules needed by OVM.  If you are going to be using an external firewall, then these are the ports you will need to open on your firewall (bold denotes client to management server communications – remainder are management server to hypervisor).

tcp: 7001-7002, 15901, 54321-5432

udp: 123

Luckily though all we need to do is execute the below script…

# ./
Adding group 'oinstall' with gid '54321' ...
Adding group 'dba'
Adding user 'oracle' with user id '54321', initial login group 'dba', supplementary group 'oinstall' and  home directory '/home/oracle' ...
Changing ownership of '/home/oracle' to oracle:dba
Creating user 'oracle' succeeded ...
Verifying user 'oracle' OS prerequisites for Oracle VM Manager ...
oracle  soft    nofile          8192
oracle  hard    nofile          8192
oracle  soft    nproc           4096
oracle  hard    nproc           4096
oracle  soft    core            unlimited
oracle  hard    core            unlimited
Setting  user 'oracle' OS limits for Oracle VM Manager ...
Altered file /etc/security/limits.conf
Original file backed up at /etc/security/limits.conf.orabackup
Verifying &amp; setting of user limits succeeded ...
Modifying iptables for OVM
Adding rules to enable access to:
7001  : Oracle VM Manager http
7002  : Oracle VM Manager https
15901 : Oracle VM Manager VM console proxy
54321 : Oracle VM Manager core
54322 : Oracle VM Manager core via SSL
123 : NTP
Saving firewall rules to /etc/sysconfig/iptables:          [  OK  ]
Rules added.

The documentation mentions libaio, bc, and unzip as prerequsites.  My install already included this, so installing them was redundant.

# yum install libaio bc unzip
Loaded plugins: rhnplugin, security
This system is not registered with ULN.
ULN support will be disabled.
Setting up Install Process
Package libaio-0.3.106-5.x86_64 already installed and latest version
Package libaio-0.3.106-5.i386 already installed and latest version
Package bc-1.06-21.x86_64 already installed and latest version
Package unzip-5.52-3.0.1.el5.x86_64 already installed and latest version
Nothing to do.

Install the Oracle VM Manager Software

Here we simply execute the installer script and follow the prompts.  Notice the first prompt asks us the installation type.  I am using Demo, this will install the XE database, and configure OVM Manager to use that.  This is not a support configuration.  If you plan on using this stack in production you will need to install using option two, which will not install a database but rather will require that you connect to a pre-created database, on either the local or a remote server.

# ./

Oracle VM Manager Release 3.1.1 Installer

Oracle VM Manager Installer log file:
Please select an installation type:
1: Demo
2: Production
3: Uninstall
4: Help

Select Number (1-4): 1

Starting demo installation ...

Just some warnings about the XE database.  If you are installing this for production, make sure you heed this warning.

The Demo installation type will use an XE database.  The usage of XE is for *demo purposes only* and is not supported for production. Please *do not* plan to start with XE and migrate to a supported version of the database as this may not be possible. For production environments or any long term usage please use the "Production" option with an SE or EE database.
1: Continue
2: Abort

Select Number (1-2): 1

Now we are going to enter the password to be used for all purposes.  You must have a password with only alpha-numeric characters, no special characters here, you also must have both upper and lower case, with a length of 8.

Verifying installation prerequisites ...

One password is used for all users created and used during the installation.
Enter a password for all logins used during the installation: &lt;enter password here&gt;
Enter a password for all logins used during the installation (confirm): &lt;re-enter password here&gt;

Now that we are ready to begin, this is your last chance to back out.

Verifying configuration ...

Start installing the configured components:
1: Continue
2: Abort

Select Number (1-2): 1

Beginning the installation, now we just wait.

Step 1 of 9 : Database ...
Installing Database ...
Retrieving Oracle Database 11g XE ...
Installing Oracle Database 11g XE ...
Configuring Oracle Database 11g XE ...

Step 2 of 9 : Java ...
Installing Java ...

I ran into a problem here.  I used a password which I believe met all of the requirements, 1 upper-case, 1 number, 8 lower-case, no special characters.  However the install failed here with a failed authentication error.  I suspected this had something to do with differing password requirements for various components.  I tried re-running the installation with a 8 digit password, that met the requirements, but it was having a problem since the Database and Java were already installed.  I got around this by choosing the uninstall option when first executing the install script.  Then the subsequent run with the 8 digit-only password worked an example of a password which meets the requirements would be Gpdf5098.

Step 3 of 9 : Database Schema ...
Creating database schema 'ovs' ...

Step 4 of 9 : WebLogic ...
Retrieving Oracle WebLogic Server 11g ...
Installing Oracle WebLogic Server 11g ...

Step 5 of 9 : ADF ...
Retrieving Oracle Application Development Framework (ADF) ...
Unzipping Oracle ADF ...
Installing Oracle ADF ...
Installing Oracle ADF Patch...

Step 6 of 9 : Oracle VM  ...
Retrieving Oracle VM Manager Application ...
Extracting Oracle VM Manager Application ...
Installing Oracle VM Manager Core ...

Step 7 of 9 : Domain creation ...
Creating Oracle WebLogic Server domain ...
Starting Oracle WebLogic Server 11g ...
Configuring data source 'OVMDS' ...
Creating Oracle VM Manager user 'admin' ...

Step 8 of 9 : Deploy ...
Deploying Oracle VM Manager Core container ...
Deploying Oracle VM Manager UI Console ...
Deploying Oracle VM Manager Help ...
Enabling HTTPS ...
Granting ovm-admin role to user 'admin' ...

Step 9 of 9 : Oracle VM Manager Shell ...
Retrieving Oracle VM Manager Shell &amp; API ...
Extracting Oracle VM Manager Shell &amp; API ...
Installing Oracle VM Manager Shell &amp; API ...

Retrieving Oracle VM Manager Upgrade tool ...
Extracting Oracle VM Manager Upgrade tool ...
Installing Oracle VM Manager Upgrade tool ...
Copying Oracle VM Manager shell to '/usr/bin/' ...
Installing in '/u01/app/oracle/ovm-manager-3/bin' ...
Installing in '/u01/app/oracle/ovm-manager-3/bin' ...
Enabling Oracle VM Manager service ...
Shutting down Oracle VM Manager instance ...
Restarting Oracle VM Manager instance ...
Waiting 15 seconds for the application to initialize ...
Oracle VM Manager is running ...
Oracle VM Manager installed.

Please wait while WebLogic configures the applications... This can take up to 5 minutes.

Well the installation is nearly done.  It is doing the last step of the installation, before giving you the information you need for accessing the GUI.

Installation Summary
Database configuration:
Database host name          : localhost
Database instance name (SID): XE
Database listener port      : 1521
Application Express port    : 8080
Oracle VM Manager schema    : ovs

Weblogic Server configuration:
Administration username     : weblogic

Oracle VM Manager configuration:
Username                    : admin
Core management port        : 54321
UUID                        : 0004fb00000100004ac53f7c774415a7

There are no default passwords for any users. The passwords to use for Oracle VM Manager, Oracle Database 11g XE, and Oracle WebLogic Server have been set by you during this installation. In the case of a default install, all passwords are the same.
Oracle VM Manager UI:

Log in with the user 'admin', and the password you set during the installation.

Please note that you need to install tightvnc-java on this computer to access a virtual machine's console.

For more information about Oracle Virtualization, please visit:

Oracle VM Manager installation complete.

Please remove configuration file /tmp/ovm_configD62uIU.

So now with the completion of the install we can see that the site is available at both an http and an https site running on ports 7001 and 7002 respectively.

Now that we have laid this foundation we can start to get into some of the neat processes around using this particular stack.


ref: Oracle VM Installation and Upgrade Guide for Release 3.1.1 –

May 1st, 2012 | Tags: , , ,

So I frequently find myself in a situation where I need to modify files on a fairly programmatic basis, so sed has become a friend of mine for a lot of these situations.  So lets start with some basic sed…

If I have a file..

# cat /etc/file.txt

And I want to replace “teststring” with “productionvalue” then I could use sed.

# sed -i 's/teststring/productionvalue/g' /etc/file.txt
# cat /etc/file.txt

This is all well and good, but recently I found a better way…

Using perl, not only can we make the change, but we also create a backup file of the original configuration.

# perl -pi.orig -e 's/teststring/productionvalue/g' /etc/file.txt

So now lets take a look at our original file with the .orig extension…

# cat /etc/file.txt.orig

And finally our changed file…

# cat /etc/file.txt

This is certainly a more useful way of making programmatic changes while retaining the ability to quickly recover from programmatic errors…

Comments Off
April 30th, 2012 | Tags: , , ,

I recently ran into a situation where I needed to create a large number of Logical Volumes for a server replacement situation.  I could have done some manual data input, but why not take the opportunity to quickly write a script to do the hard work for me?

For my situation this was a server that pulls data from other servers in order to optimize getting that data to tape.  So we had 2 VGs, one for the system and one for the data we wanted to move.  We planned on simply performing a rsync to move the data itself, but the volumes had to be pre-staged.

Here is the full script.  Nothing fancy, but very effective.

for line in `ssh root@oldserver.domain 'lvs --noheadings -o lv_name,lv_size,vg_name --separator , | tr -d " " | grep oldserver-vg | grep -v unneeded-lv'`
lvname=`echo $line | cut -d , -f 1`
lvsize=`echo $line | cut -d , -f 2`
lvcreate -L${lvsize} newserver-vg -n ${lvname}
mkfs.reiserfs -q /dev/newserver-vg/${lvname}
mkdir /backups/${lvname}

Gather Existing Configuration

Lets break it down…  The core of this script is gathering and formatting the existing LV configuration.

lvs --noheadings -o lv_name,lv_size,vg_name --separator , | tr -d " " | grep oldserver-vg | grep -v unneeded-lv

You will notice we are using lvs to show all of our logical volumes, but we are also telling it that we don’t want the headings to be displayed, and we only want the lv_name, lv_size, and vg_name columes to be displayed.  Additionally we want to use a comma as the separator, which makes our output easier to parse.  This gives us the core of the data we need, however we have some white space to remove, so we just pipe it through tr to get rid of that.  Now we just want to trim out some of the extra data from our output using grep.  We have two statements, one where we only include anything that contains the string oldserver-vg, and the other where we specifically exclude (with the -v) something that is not needed but previously included in our case unneeded-lv.  This would also work if you had a vgname which matched more than it should have.

Build “For” Loop

So now that we have a command to gather our original configuration, we need to wrap it in a for loop, and run it through SSH.

for line in `ssh root@oldserver.domain 'lvs --noheadings -o lv_name,lv_size,vg_name --separator , | tr -d " " | grep oldserver-vg | grep -v unneeded-lv'`

The way a “for” loop works is that you define a variable which represents each item in an array of data.  In our case our array of data is coming from another command (the boundaries of this command is delineated by the back-ticks) which happens to be an SSH command to the original server where the LVM configuration is intact (the boundaries of this command is delineated by the single-quotes).

Inside the “For” Loop

This is simple, as it goes through each line of output it will do everything between do and done.  Once it reaches done it goes back and increments to the next ${item} and starts again.  When there are no more $item then the for loop is complete, and we move on to the next part of the script.  In this particular script there is nothing after the “For” loop so the script will now be complete and your prompt will be returned.

Inside the “For” Loop…  Define Variables

Here we simply define our variables based on the content of $line.

lvname=`echo $line | cut -d , -f 1`
lvsize=`echo $line | cut -d , -f 2`

The core of each of these commands is the cut command.  The -d option sets the deliminator to “,” the -f option sets the field to the field which contains the data we need.  Which gives us the appropriate variables to actually do stuff.  So lets do it…

Inside the “For” Loop…  Create the Logical Volumes, Format, and Make a Mounting Directory

Now we actually do work.  If you are running this code I recommend you test it in your environment first, by inserting some debugging code instead of doing this stuff on your first run.  Unless you don’t care about the machine.  Make sure you look for pre-existing file systems and what not, if you accidently format your root you won’t be very happy…  Moving on.

lvcreate -L${lvsize} newserver-vg -n ${lvname}

Here we are simply creating the LVs.  You will need to hardcode the VG Name on your server which is being built up.

mkfs.reiserfs -q /dev/newserver-vg/${lvname}

Here we are formatting the file systems as we create them.  This particular environment prefers reiser, use your choice.

mkdir /backups/${lvname}

And finally to make the directories which will have the LVs mounted into.

Final Thoughts

The final step is to copy over the /etc/fstab and update the VG names in it from oldserver-vg to newserver-vg.  Which can be done with sed.  You could also manually mount the file systems as part of the script, or create the fstab by hand.


Comments Off
April 24th, 2012 | Tags: , , ,

I haven’t been working with ESX for a bit, but while I was I was mostly interacting with it via the command line.  Here is a list I had compiled while I was going through that exercise, and since I while be starting a job next week where I will no longer be interacting with much ESX I will just publish this one as-is.  It is by no means complete and frankly it is not even that helpful.  Notice that the commands which reference a specific virtual machine have a number, this is the VM ID for the VM you’d like to interact with.

This is specifically to interact with VMs on ESX 5.  There is also esxcli which will allow you to make hypervisor level changes such as configuring a vSwitch, the esxcli is similar to a switch in how it behaves but it is beyond the scope of this article.

List All VMs on the Host

# vim-cmd vmsvc/getallvms

Get Information for a Specific VM

# vim-cmd vmsvc/get.guest 30

Get Configuration for a Specific VM

# vim-cmd vmsvc/get.config 30

Get Summary for a Specific VM

# vim-cmd vmsvc/get.summary 30

Get Current Power State of a Specific VM

# vim-cmd vmsvc/power.getstate 30

Power On a Specific VM

# vim-cmd vmsvc/power.on 30

Power Off a Specific VM (Hard)

# vim-cmd vmsvc/ 30

Shutdown a Specific VM

# vim-cmd vmsvc/power.shutdown 30

Reboot a Specific VM

# vim-cmd vmsvc/power.reset 30

List a Specific VM’s Snapshots

# vim-cmd vmsvc/get.snapshot 30

Unregister a VM from a ESX Host

# vim-cmd vmsvc/unregister 30

Register a VM on a ESX Host

# vim-cmd solo/registervm path/to/.vmx
Page 10 of 25« First...89101112...20...Last »