Deploying Templates with Oracle Restart on OVM

I decided to post this after investigating how to use these templates in our demo room setup. You would think it’s straight forward but it appears the deploycluster tool, used to deploy these templates, is not yet compatible with OVM 3.3.1 and higher. That surprised me because it has been out for 3+ months now and with Oracle putting the emphasis on templates, it is strange that they do not work out of the box with the 2 most recent OVM versions. ( 3.3.1 & 3.3.2 )

Preparing the template

Let’s start with preparing everything for deployment

  • Download the template on oracle support patch nr: 18888811
    1
  • Unzip the 3 files resulting in 3 *.gz files
  • Join file 2A and 2B together
    (root) # cat OVM_OL6U6_X86_64_12102DBRAC_PVM-2of2-partA.tar.gz  OVM_OL6U6_X86_64_12102DBRAC_PVM-2of2-partB.tar.gz > OVM_OL6U6_X86_64_12102DBRAC_PVM-2of2.tar.gz
  • Place file 1 and the newly joined file 2 on a webserver ready for import into OVM.
  • Import the template
    2

Creating the VM

Follow the readme to create a VM, I decided to use 2 ASM disks in 1 diskgroup instead of the minimum of 5. I’m also deploying the oracle restart and not the RAC at this time.

  • Create the disks needed for ASM
    3
  • Create the VM based on the template
    4
  • Edit the VM and remove a network card, the second card is normally for interconnect in a rac deployment.
    5
  • Add the newly created disks to the VM
    7

Deploying it with deploycluster tool

  • Download the DeployCluster Tool
  • Place it on any linux machine, I normally place it on the OVM manager because of why not.
  • Configure netconfig.ini, start the VM and run the tool
    (root) # ./deploycluster.py -u admin -p password -M BNS -N netconfig.ini
    INFO: Oracle VM Client  (3.2.9.746) protocol (1.9) CONNECTED (tcp) to
          Oracle VM Manager (3.3.1.1065) protocol (1.10) IP (10.100.23.6) UUID (0004fb00000100008948135041eef83e)
    
    ERROR: This deploycluster.py version (v2.1.0) does not support connecting to Oracle VM Manager higher than 3.2; found Oracle Manager version 3.3. See My Oracle Support Note #1185244.1 and OTN for deployment options on this version.

So we see here there is a problem with compatibility. If we go to the mentioned note we see :

The Deploycluster tool currently only supports Oracle VM version 3.2 and below
Manual or Message based deployment is possible on Oracle VM 3.3.1

But no guidelines on manual deployment.

Deploying it with message based or manual deployment

  • Download and install ovm_utils on the ovm manager ( Patch: 13602094 )
  • Boot the VM and send the necessary messages ( or open console and do it manually ), KEYS :
    • com.oracle.racovm.netconfig.arguments => “-n1”
    • com.oracle.racovm.netconfig.contents.0 => send the content of netconfig.ini, this is for initial network setup
    • com.oracle.racovm.params.contents.0 => send the content of params.ini, we’ll leave this empty for now
    • com.oracle.racovm.racowner-password => password for oracle user
    • com.oracle.racovm.racowner-password => password for grid user
    • com.oracle.linux.root-password => password for root user
    • com.oracle.racovm.netconfig.interview-on-console => NO ( do not boot with the rac interview screen )

    Results in :

    export CMD="/u01/app/oracle/ovm-manager-3/ovm_utils/ovm_vmmessage -h 10.100.23.6 -u admin -p password -v BNS"
    
    $CMD -k "com.oracle.racovm.netconfig.arguments" -V "-n1"
    $CMD -k "com.oracle.racovm.netconfig.contents.0" -V "
    # Sample Single Instance or Single Instance/HA (Oracle Restart)
    NODE1=BNS
    NODE1IP=10.100.23.161
    PUBADAP=eth0
    PUBMASK=255.255.255.0
    PUBGW=10.100.23.254
    DOMAINNAME=labo.exitas  # May be blank
    DNSIP=10.100.23.20  
    CLONE_SINGLEINSTANCE_HA=yes  # Setup Single Instance/HA (Oracle Restart)"
    $CMD -k "com.oracle.racovm.params.contents.0"  -V ""
    $CMD -k "com.oracle.racovm.racowner-password" -V "oracle"
    $CMD -k "com.oracle.racovm.gridowner-password" -V "oracle"
    $CMD -k "com.oracle.linux.root-password" -V "ovsroot"
    $CMD -k "com.oracle.racovm.netconfig.interview-on-console" -V "NO"
    
  • Run the script and the machine will boot with a complete functional network
  • Logon as root with the previous specified password
  • Open /u01/racovm/params.ini and modify it for our environment, this file is very well commented and clearly explains every parameter, go wild 😉
    • Change GIHOME and DBHOME ( do not forget to move the clone files on the vm aswell if you change it )
    • Change the ASM settings, because we work with 2 disks
      RACASMDISKSTRING="/dev/xvd[c-d]1"
      ALLDISKS="/dev/xvdc /dev/xvdd"
      ASM_MIN_DISKS=2
    • Change DBNAME and SIDNAME
  • When you are done, perform the build :
    # ./buildsingle.sh
    Are you sure you want to install Single Instance/HA? YES
    Do not run if software is already installed and/or running.. [yes|no]? yes
    ...
    INFO (node:BNS): This entire build was logged in logfile: /u01/racovm/buildsingle.log
    2015-03-13 05:20:11:[buildsingle:Done :BNS] Building 12c Single Instance/HA
    2015-03-13 05:20:11:[buildsingle:Time :BNS] Completed successfully in 1052 seconds (0h:17m:32s)
    

That’s it, We deployed a VM with Oracle Restart and a 12c database with ease.

Converting a windows 2003R2 VM from VMWare vCenter to Oracle VM 3.x

With more and more VMWare customers choosing to use Oracle VM as virtualisation platform for running Oracle Software, the need rose at a client to convert some of the windows VM’s on vCenter to OVM. Surprisingly, I didn’t find a guide in the OVM 3 manual. I knew OVM 2.2 had a chapter about V2V, but only P2V gets covered in the OVM 3 manual.

This is the procedure I successfully followed :

Pre-export

  • Apply fix for kb31408 if you are using scsi devices in your VM. ( This is also documented in Metalink note. 754071.1 )
  • Uninstall vmware tools
  • Stop the VM ( Downtime starts here )
  • Make sure there are no snapshots on the vm.

Export

  • Select the VM in vCenter and click on the menu bar on File > Export > OVF
  • When you get the question if you want a single OVA file, answer yes.
  • Place the exported ova file on the http server you use to import into OVM Manager. ( I use httpd on the ovm manager )

Import

  • Follow all the usual steps you would follow to import an ova template into OVM.
    • Import as assembly
    • Create VM Template
    • Create VM
    • Start VM ( TIP: open the console before you boot, so you can follow the boot sequence ). If you receive a blue screen, chances are that you didn’t apply the fix for kb31408 correctly.

Post-Import

  • You need to reconfigure your network because the mac address of the network card in the vm has now changed. 
  • Reactivate windows ( because your hardware has changed )
  • Install the paravirtual drivers ( version 3.0.1 ) and reboot ( Downtime ends here )

And we had a running VM on OVM identical to the one we had on vCenter in about 45 minutes. Most of the time is spent in the export process of vCenter.

Oracle VM Disaster Recovery

A lot of my clients ask me about Disaster Recovery in a OVM setup. I hope this new event of oracle gives us some more insight. You can register here. I’ll certainly check it out. The whitepaper the event is based on can be found here.

Consistency between the Primary and DR site is not handled in this paper.According to Oracle this is a task for the application (f.e. Dataguard ) or the Storage layer (f.e. EMC Recoverpoint ). The white paper handles all the necessary tasks to make sure vm’s can be seen and started on the DR site. I hoped there was more possible with the tight integration of UEK and OVM. But offcourse, is that really needed when you can already have consistency solutions on storage/application level?

I believe VMWare has some solutions for this. Anyone care to elaborate on those?

 

 

IOUG Virtualization SIG – Day 1

So, Day 1 of the Virtualization SIG on www.ioug.org is over. All by all an interesting day.
The schedule was :

Session 1 – Oracle on Oracle VM – Expert Panel
Session 2 – Maximizing your Virtualized Environment with Oracle VM
Session 3 – The RAC OVM Templates and the new DeployCluster tool on OVM3
Session 4 – The Latest on Oracle VM
Session 5 – Simplifying Application Deployment in Cloud Using Virtual Assemblies and EM 12c

The first session was a general session about Cloud, Virtualization and introduction to OVM.

Roger Lopez talked about OVM and it’s features in detail in the second session. I had the pleasure of seeing Roger on OOW with this session. It was very well structured and provided a look at how you deploy RAC clusters on OVM with the new templates and DeployCluster tool. A perfect introduction for the next session off course where Saar Maoz talked really enthusiastic about this tool and explained in detail how it worked and how you could go to a very low level and perform the commands yourself. It was no surprise to me that the tool used the same OVM API as I blogged about here. It was a surprise however to see how robust the application was written and how well it adjusted to reruns and failures. There was even some time for demo’s that I really appreciated.

Xsigo was something I talked about in my presentation aswell and was glad to see it in the presentation of Ronen Kofman ( Latest on OVM ). It really simplifies your whole Network topology. I have no idea on prices yet though. The rest of his presentation handled the new features in the 3.2.1 open Beta.

The last session of the day handled the Virtual Assembly Builder, A pretty powerful tool to create, manage and deploy your assemblies as fully functional interconnected Virtual Machines. It’s on my todo list to play around with it.

Tonight is Day 2, the VMWare day. I hope this time it will talk a little bit more about best practices on running Oracle Databases Virtualised, but from the titles of the sessions, I’m sure that will be the case.

You can register here

using ovmd and ovm_vmmessage to (re)configure your virtual machines.

What you need

  • Installation of ovm_utils on your manager ( p13602094_30_Linux-x86-64.zip available on metalink )
  • A VM with ovmd installed. Keep in mind that all OVM3 templates come with OVMD already installed. If you need to install it manually see this manual

How it works

ovmd is a listening process on your vm that allows messages to be send from and to the manager.
ovm_vmmessage is a utility included in ovm_utils that allows you to send messages to a vm in key/value pair.
the ovmd has a script called configure that can be executed to set system information. When you call it manually :

(vm1) # ovmd -s configure
Parameters:

u’com.oracle.linux.network.hostname’:
u’com.oracle.linux.network.host.0′:
u’com.oracle.linux.network.device.0′:
u’com.oracle.linux.network.hwaddr.0′:
u’com.oracle.linux.network.mtu.0′:
u’com.oracle.linux.network.onboot.0′:
u’com.oracle.linux.network.bootproto.0′:
u’com.oracle.linux.network.ipaddr.0′:
u’com.oracle.linux.network.netmask.0′:
u’com.oracle.linux.network.gateway.0′:
u’com.oracle.linux.network.dns-servers.0′:
u’com.oracle.linux.network.dns-search-domains.0′:
u’com.oracle.linux.root-password’: [required]

============================================================================

Input or edit parameter:

To use the current value, press “Enter”.
To input an empty string, input ” and press “Enter”.

Script: network
Key: com.oracle.linux.network.hostname
Description: System host name.
Required: False

Please input new value:

the parameters section will show you which keys the script accepts and recognises.
You can send these key/value pairs from the manager to the vm to skip the dialog.
f.e.

(manager) # ./ovm_vmmessage
Arguments :
-u [user name] Oracle VM Manager admin username (required)
-p [password] admin password (required)
-h [hostname] Oracle VM Manager hostname (required)
-X use secure (ssl) connection to port 54322
-v [vm name] virtual machine name
-U [vm UUID] virtual machine UUID
-k [key] key to send
-V [value] key-value to send (required when using -k)
-q [key] key to query

(manager) # ./ovm_vmmessage -u admin -p password -h localhost -v vm1 -k com.oracle.linux.network.hostname -V test_ovmd
(manager) # ./ovm_vmmessage -u admin -p password -h localhost -v vm1 -k com.oracle.linux.root-password -V rootroot

If you now check on your vm for the values, you’ll see the following :

(vm1) # ovmd -l
{“com.oracle.linux.network.hostname”:”test_ovmd”}
{“com.oracle.linux.root-password”:”rootroot”}

In order to make them active. Just run the ovmd -s configure script again. No dialog will be shown and all settings will be saved and active after a reboot.

(vm1) # ovmd -s configure
(vm1) # reboot

Configuring Templates

Now it becomes interesting!
Some of you might have recognised the questions the ‘ovmd -s configure’ command asked. These are actually the questions a newly created vm asks when it is cloned from the OVM3 templates of oracle. Wouldn’t it be interesting you don’t need to launch the console for each and every vm you create?

Well try this :

  • Create a new VM by cloning it from an OVM3 template/assembly available on edelivery ( f.e. OVM_OL6U2_x86_64_PVM.ova )
  • Boot the vm and let it sit on its dialogs
  • Run the following commands :

    (manager) # ./ovm_vmmessage -u admin -p password -h localhost -v vm1 -k com.oracle.linux.network.hostname -V vm1
    (manager) # ./ovm_vmmessage -u admin -p password -h localhost -v vm1 -k com.oracle.linux.network.device.0 -V eth0
    (manager) # ./ovm_vmmessage -u admin -p password -h localhost -v vm1 -k com.oracle.linux.network.onboot.0 -V yes
    (manager) # ./ovm_vmmessage -u admin -p password -h localhost -v vm1 -k com.oracle.linux.network.bootproto.0 -V static
    (manager) # ./ovm_vmmessage -u admin -p password -h localhost -v vm1 -k com.oracle.linux.network.ipaddr.0 -V 10.100.23.36
    (manager) # ./ovm_vmmessage -u admin -p password -h localhost -v vm1 -k com.oracle.linux.network.netmask.0 -V 255.255.255.0
    (manager) # ./ovm_vmmessage -u admin -p password -h localhost -v vm1 -k com.oracle.linux.network.gateway.0 -V 10.100.23.254
    (manager) # ./ovm_vmmessage -u admin -p password -h localhost -v vm1 -k com.oracle.linux.network.dns-servers.0 -V 10.0.13.44
    (manager) # ./ovm_vmmessage -u admin -p password -h localhost -v vm1 -k com.oracle.linux.root-password -V rootroot

  • And voila. The minute your root password is set ( remember to do it last ), the information is loaded and the vm becomes active with all these settings applied. No need to launch the console. Awesome for batch creating vm’s.

It can be nice to reset all settings and make sure ovmd boots with the configure script again on next boot. You can do that by editing the /etc/sysconfig/ovmd script and set INITIAL_CONFIG=yes. Now stop the vm and clone it as vm/template, on first boot the dialog will start again and you’ll be able to send the commands or answer the questions.

I would like to point out this was tested on OracleVM 3.2.1 public beta but it should be applicable to 3.1.1 aswell.

You can find more information about this on the blog of Wim Couckaert.

News from Oracle Open World 2012

I’m just back from OOW and the following is a small summary of the items that were hot and new.

Clusterware 12c announced for 2013

  • Flexasm : ASM no longer needs to be on the same node as the database. Allows for HA on ASM level.
  • Flexcluster : Clusterware now has a lightweight mode in the installer for application/middletier setups. You can combine these with the normal clusterware mode to form 1 big cluster. ( hub nodes and leaf nodes )
  • You can now create a Scan vip for each public network.
  • gsd service is removed because there is no support for 9i databases on clusterware 12c.
  • Shared GNS : You can now have a shared GNS over multiple clusters.

Database 12c announced for 2013

  • RAC Application Continuity : First ever database to preserve commit outcome and ensure application continuity during unplanned downtime.
  • Pluggable Databases : Databases can now be plugged in a container. Consolidating the background processes, redo and undo.
  • Xstream : A GUI on streams apply/capture processes is further enhanced but only available when you have Golden Gate license.
  • dbua : now has backup/restore and moving database files during upgrade built in.
  • dbua : Gathering statistics is now optional.
  • dbua : Now runs the upgrade scripts in parallel mode. Speeding up the whole process.
  • smart flash : Can use SSD’s as extention of Buffer Cache.
  • RMAN : can now do recover table
  • RMAN : Standby databases can now use RMAN to apply an incremental backup automatically ( Recover database from for standby )
  • RMAN : Now automatically converts datafiles from 1 platform to the other. ( big-little endian )
  • dbconsole is renamed to “EM Express” and now runs from inside the database.
  • Many more new features but I concentrated on virtualization and linux during OOW while my colleague did 12c.

OVM 3.2.1 in public beta

  • Support for mySQL databases as repository for the OVM Manager
  • OVM Manager now supports OVM on SPARC
  • Statistics of OVM Servers now available in OVM Manager ( Health tab)
  • Minor GUI changes and fixes
  • UEK2 kernel in dom0 for driver compatibility with Oracle Linux
  • OVM CLI now integrated and further enhanced
  • next Beta refresh will contain open Vswitch
  • OVM is now integrated in ODA and Exalogic, but each node has a local OVM cluster. No HA.

Oracle Linux

  • ksplice : allows for kernel upgrades without downtime
  • yum security updates : Now possible to apply only security updates to your system using yum
  • Dtrace : Solaris utility that was ported to Oracle Linux.
  • BTRFS : ZFS-like filesystem for Linux.
  • UEK3 is coming
  • SELinux profiles for every oracle product will be provided in the future
  • Linux Containers : Allows for isolation of applications while maintaining 1 OS.
  • support for swapfile over NFS
  • cgroups : Allows for limiting CPU,IO and memory on process level.

Acquisition of Xsigo was announced

  • Allows for virtualizing of network layer.
  • Will be integrated in OVM Manager in future releases.


    • I’ll try to focus on some of these new things in later Blogposts. As always if you have some questions, feel free to contact me or comment.

Tips and Tricks for OVM – 2. Fakeuuid it

part 2 in the “Tipd and Tricks for OVM” series. Part 1 is here

The UUID

Every OVM Server receives an unique ID when the agent starts. Without this ID, a server can’t join a cluster and the manager can’t dispatch commands to the agent. But how does this ID get set?

Well if you look into the OVM source RPM’s for the ovs-agent-3.1.1-89.src, you’ll see in the file linux_xen/Extensions/discover.c file the following :

/* agent_unique_id – report a unique 16 byte identifier for this node
*
* Generates a 16 byte response string containing a unique 16 byte
* identifier for this node. Uses the SMBIOS UUID if it appears to be valid.
* Otherwise generate a fallback value based on ethernet MAC addresses.
* Returns non-zero status if no id can be constructed.

And a bit further

/* generate_fallback_unique_id – create a unique ID without using SMBIOS UUID

// Try using a sequence of ethernet MAC addresses as the unique ID.
// MAC’s are not good because the NIC could be replaced, or worse
// moved between systems. Using multiple MACs will catch a few
// more cases (unless it’s a multiport NIC, sigh).

So We can conclude that the agent will :

  • Ask SMBIOS for an id and if it’s valid use it. If not valid or no ID then
  • Get the MAC address of physical eth devices on the system and concatenate in an UUID

This poses a great risk because if for some reason you change the motherboard ( other SMBIOS ) or 1 of the network devices on the system ( other MAC ), you’ll have a new UUID.

How to detect a changed UUID?

The following points to a changed uuid :

  • Unable to join cluster after reboot
  • “Unable to send notification” messages on the console
  • The OVM Manager fails to rediscover the server after reboot ( tries 5 times and gives up )
  • The OVM Server in OVM Manager will become in ERROR state with an error that looks like : “The server has changed IP or is unreachable”

Fakeuuid it !

In order to solve this issue, the agent has a ini parameter you can set to ensure the same UUID all the time. You can find it in the file /etc/ovs-agent/agent.ini. Get the server uuid from OVM Manager and set it in this parameter.

[server]
fakeuuid=34:45:4c:4c:5a:00:10:20:80:59:b5:c0:4a:42:35:45

I personally set this on every OVM install i’m doing to ensure there are no issues with this ID changing.