view counter

Chapter 5: Oracle VM Manager Sizing, Installation, Updates and the Oracle VM Manager CLI

Last update 01-28-2010
Copyright © 2009 - 2012 Roddy Rodstein. All rights reserved.
 
Chapter 5 covers the following topics:
  • Oracle VM Manager Introduction
  • Oracle VM Manager Resource Requirements
  • Oracle VM Manager Installation Prerequisites
  • Oracle VM Manager Installation
  • Deploying the Oracle VM Manager Template
  • Updating and Patching Oracle VM Manager
  • Oracle VM Manager Database Backup and Restoration
  • The Oracle VM Manager Command Line Interface
  • Oracle VM 2.1.5 to 2.2 Upgrade
Table of Contents
 

Oracle VM Manager Introduction

Oracle VM Manager is a bare bones stand-alone management solution for Oracle VM servers, Oracle VM server pools and Oracle VM guests. Oracle VM Manager is a light weight private source cluster ready Oracle Application Development Framework 10g (ADF) application that installs on Enterprise Linux. Oracle VM Manager also has a command line interface that allows Oracle VM Manager administrative tasks to be perform from the command line or executed using scripts.
 
Oracle VM Manager is supported on a physical or virtual Enterprise Linux operating system. Oracle VM Manager is a great candidate for virtualization on Oracle VM or Oracle VM VirtualBox. Virtualizing Oracle VM saves on hardware costs and improves application flexibility while reducing data center space.

Note: Oracle VM Manager is not supported and should not be installed in Oracle VM server's dom0. 

List 1 shows the supported Enterprise Linux operating systems and virtualization platforms for Oracle VM Manager.

  • Oracle Enterprise Linux 4 update 5 or later
  • Red Hat Enterprise Linux 4 or later
  • Oracle VM for x86
  • Oracle VM VirtualBox
Oracle VM Manager is distributed in three formats; a) as an ISO file that installs on Enterprise Linux b) as a pre-packaged Oracle VM template (with the CLI) and c) as the Oracle VM Management Pack plug-in.
 
Oracle VM Manager is considered the leading edge development platform for the Oracle VM Management Pack, which is an Oracle Enterprise Manager plug-in. Oracle VM Manager 2.1.2 was ported to Oracle Enterprise Manager 10.2.0.5 and Oracle VM Manager 2.2 was ported to Oracle Enterprise Manager 11g R1. Expect at least a six month lag for Oracle to port a new Oracle VM Manager release to the Oracle VM Management Pack.
 
Note: The Oracle VM Management Pack is licensed software; Oracle VM Server and Oracle VM Manager are not licensed software.
 
Figure 1 highlights the Oracle VM Manager 2.2 user interface.
ORacle VM Manager Portal
 

The next chart shows the matrix of supported Oracle VM Manager and Oracle VM server combinations.

   OVM 2.1.0  2.1.1  2.1.2 2.1.5  2.2.0
OVS --------+------+------+-----+------
2.1.0     O |    O |   O  |  O  |  O
2.1.1     X |    O |   O  |  O  |  O
2.1.2     X |    X |   O  |  O  |  O
2.1.5     X |    X |   X  |  O  |  O
2.2.0     X |    X |   X  |  X  |  O
2.2.1     X |    X |   X  |  X  |  O
  

Note: Oracle VM Manager can manage many Oracle VM server pools, e.g. Oracle VM Manager 2.2 can manage one pool of Oracle VM 2.1.x servers, another pool of Oracle VM 2.2 servers, and many more server pools; But within the same server pool, all the servers must have the same version of Oracle VM server and the Oracle VM agent. Mixing Oracle VM 2.1.x and 2.2.x servers in the same pool is not supported.

Oracle VM Manager Resource Requirements

Oracle's recommends 2 GB of memory and one 1.83 GHz CPU for VM Manager. Oracle's minimum resource recommendations for VM Manager is appropriate for a small Oracle VM pool with a hand full of Oracle VM servers without the Command Line Interface.
 
Oracle VM Manager resource requirements can be quickly tested with Oracle VM Manager user interface (UI) page response times. For example, if the Oracle VM Manager user interface is painfully slow or if you experience page timeouts adding memory and CPUs will speed up the user interface and eliminate page timeouts.
 
Tip: Oracle VM Manager on VMware is performance challenged and will need substantially more CPU and memory than the minimum recommendations. Oracle VM Manager is a great fit running on a virtualized Enterprise Linux operating system on an Oracle VM server.
 
Table 1 lists Oracle's recommended minimum resource requirements for Oracle VM Manager 2.x.
Description
Minimum Resources
Memory
2 GB
Processor
1 1.83 GHz CPU
Swap Space
2 GB
Hard Disk Space
4 GB
The memory and CPU requirements for Oracle VM Manager 2.x scales up as the number of Oracle VM pool members grow.
 
Table 2 shows the recommended CPU and memory allocation for three different Oracle VM Manager deployments.
Number of Oracle VM Server Pool Members
Memory
CPU
Swap
< 10
2 GB
1 1.83 GHz
2 GB
> 10
4 GB
2 2 GHz
8 GB
> 32
8 GB
4 2 GHz
8 GB

Supporting Large Oracle VM Manager User Communities

If Oracle VM Manager will be supporting over 10 users ensure that the OVM Manager host has at least 2.5G of RAM with the following oc4j script modifications.
 
On the OVM Manager host, edit the “/opt/oc4j/bin/oc4j” file and change this line:
OC4J_JVM_ARGS="-XX:PermSize=256m -XX:MaxPermSize=512m"
to:
OC4J_JVM_ARGS="-XX:PermSize=512m -XX:MaxPermSize=1024m -Xms2048m -Xmx2048m"
 
Next, restart the OC4J service on the Oracle VM Manager hosts by typing "service oc4j restart". 

Oracle VM Manager Installation Prerequisites

libaio RPM Package

Oracle VM Manager uses the Oracle Database 10g Express Edition as the default data repository. The Oracle Database 10g Express Edition requires the libaio package release 0.3.96 or above.
 
To validate if your Enterprise Linux system has the libaio 0.3.96 or above package, as root “type rpm -q libaio” as shown in the next example.
# rpm -q libaio
libaio-0.3.106-3.2
If you get no result from typing “rpm -q libaio” you will need to install the libaio package. To install libaio from the Oracle Unbreakable Linux network type “up2date -i libaio” as shown in the next example.
# up2date -i libaio

Name Resolution

Before you install Oracle VM Manager ensure that the Oracle VM Manager server's host name is properly entered in the /etc/hosts file. The host name, i.e. fully qualified domain name (FQDN) must be associated with the public IP address. 
 
The next example shows an “improper” Enterprise Linux /etc/hosts file entry. 
127.0.0.1 servername.com servername localhost.localdomain localhost
192.168.4.8 servername.com servername
The next example shows the proper syntax for an Enterprise Linux /etc/hosts file entry.
127.0.0.1 localhost.localdomain localhost
192.168.4.8 servername.com servername

Host Firewall & Port Test

Oracle VM Manager will reserve tcp ports 8888, 8899 and 4443 for the Oracle VM Manager application. Before installing Oracle VM Manager on the Oracle VM Manager host, check that ports 8888 and 8899 are free. As root type “netstat -na |grep 8888” and then type “netstat -na |grep 8899”. If you do not get a response by typing “netstat -na |grep 8888” and “netstat -na |grep 8899” the ports are free. If you do get a response the ports must be released before you can install Oracle VM Manager.
 
If your Enterprise Linux host uses iptables you will need to allow tcp traffic on ports 8888, 8899 and 4443 to allow access to the Oracle VM Manager portal.
 
To allow tcp traffic on ports 8888, 8899 and 4443 on the Oracle VM Manager host, as root or with sudo type the following three commands:
# system-config-securitylevel-tui -q -p 8888
# system-config-securitylevel-tui -q -p 8899
# system-config-securitylevel-tui -q -p 4443

SMTP Server

Oracle VM Manager has several user notification features that require the use of an SMTP server. During the Oracle VM Manager installation you will be asked to a) enter the SMTP server IP address or fully qualified domain name and b) the SMTP port and c) a valid email address and password for the Oracle VM Manager admin account.
 
Entering the SMTP details during the installation is optional and can be configured after the installation by using the “update_email.sh” script on the Oracle VM Manager host or by editing the values in Oracle VM Manager repository database table ovs_sys_value under the OVS schema.

Oracle VM Manager Guest Console

The semi integrated Oracle VM Manager guest console requires the Oracle VM Manager host to have the TightVNC package installed. The TightVNC package allows non-Linux users, i.e.Windows or MAC clients to use the TightVNC guest console.
 
The TightVNC package can be downloaded from: http://oss.oracle.com/oraclevm/manager/RPMS/
 
The next example shows how to download and install the TightVNC package on the Oracle VM Manager host as root. The TightVNC package can be downloaded and installed in any directory, i.e. /tmp on the Enterprise Linux host.
# wget http://oss.oracle.com/oraclevm/manager/RPMS/tightvnc-java-1.3.9-3.noarch.rpm
# rpm -ivh tightvnc-java-version.noarch.rpm
 
Note: If you use Firefox on Linux to access the Oracle VM Manager user interface and would like to use the TightVNC guest console you will also need to install the Oracle VM Manager console plug in (ovm-console) on your Linux workstation. The ovm-console package is available at http://oss.oracle.com/oraclevm/manager/RPMS/.
 

Required Installation Passwords and Password Complexity Requirements

During the Oracle VM Manager Installation you will be prompted for a total of five required passwords.
 
List 2 shows the five required passwords.
  • The password for the Oracle XE SYS and SYSTEM accounts.
  • The password for the Oracle VM Manager OVS database schema.
  • The password for the OC4J oc4jadmin account.
  • The password for the Web Service keystore file.
  • The password for the admin account.
List 3 shows the password complexity requirements for the required passwords.
  • The password must begin with an uppercase or lowercase letter.
  • The password may include the following characters:
    • Numbers (such as 1, 2, 3, and so on), letters (from a to z, A to Z), and underscores (_).
  • Examples of valid passwords: Password01, Password_123, password.
Tip: Select and write down all the passwords before you start the installation. Unfortunately you may not be able to use the same password for all four services because the Web Service has a slightly different password policy.
 

Oracle VM Manager Installation

An Oracle VM Manager installation takes approximately 5-15 minutes depending on the performance of the Oracle VM Manager host.
 
During the Oracle VM Manager installation, you are required to set the following ports. Please note that the installer program will provide defaults.
  • The Oracle XE HTTP port. The default port number is 8080.
  • The Oracle XE listening port. The default port number is 1521.
1. Download the Oracle VM Manager ISO file from the Oracle eDelivery Linux portal.
2. Log in to the Oracle VM Manager host as root.
3. Copy the Oracle VM Manager ISO file to a directory on the Oracle VM Manager host, i.e. to the /tmp directory.
4. Create a directory to mount the ISO file, i.e. mkdir -p /tmp/mount-point.
5. Mount the ISO file by typing “mount -o loop,ro OracleVM-Manager-version.iso mount-point”
6. Change into the directory where the ISO file is mounted, i.e. “cd /tmp/mount-point.
7. Type “sh runInstaller.sh” to start the Oracle VM Manager installation and then type “1” to select the “Install Oracle VM Manager” option as shown in the next example.
# sh runInstaller.sh
Welcome to Oracle VM Manager 2.2
 
Please enter the choice: [1|2|3]
1. Install Oracle VM Manager
2. Uninstall Oracle VM Manager
3. Upgrade Oracle VM Manager
1
 
Starting Oracle VM Manager 2.2 installation …
 
8. From the ”Do you want to install a new database or use an existing one? [1|2]” prompt type ”1” to select the ”Install a new Oracle XE database on localhost” option as shown below.
Do you want to install a new database or use an existing one? [1|2]
1. Install a new Oracle XE database on localhost
2. Use an existing Oracle database in my network
1
 
Prepare to install the Oracle XE database ...
Checking the supported platforms ... Done
 
Checking the prerequisite packages are installed ... Done
 
Checking the available disk space ... Done
 
Installing the oracle-xe-univ package (rpm) now ...
Done
 
Oracle Database 10g Express Edition Configuration
-------------------------------------------------
This will configure on-boot properties of Oracle Database 10g Express
Edition. The following questions will determine whether the database should
be starting upon system boot, the ports it will use, and the passwords that
will be used for database accounts. Press <Enter> to accept the defaults.
Ctrl-C will abort.
 
9. Press the enter key to select the default HTTP port 8080 for Oracle Application Express.
Specify the HTTP port that will be used for Oracle Application Express [8080]:
 
10. Press the enter key to select the default database listener port 1521.
Specify a port that will be used for the database listener [1521]:
 
11. Type a secure password for the database accounts.
Specify a password to be used for database accounts. Note that the same
password will be used for SYS and SYSTEM. Oracle recommends the use of
different passwords for each database account. This can be done after
initial configuration:
Confirm the password:
 
12. Type y and press enter to configure the Oracle Database 10g Express Edition to start on boot.
Do you want Oracle Database 10g Express Edition to be started on boot (y/n) [y]:y
 
Starting Oracle Net Listener...Done
Configuring Database...Done
Starting Oracle Database 10g Express Edition Instance...Done
Installation Completed Successfully.
To access the Database Home Page go to "http://127.0.0.1:8080/apex"
 
Checking the availability of the database …
 
Set default database schema to 'OVS'.
 
12. Type a secure password for the OVS account.
Please enter the password for account 'OVS':
Confirm the password:
 
Creating the Oracle VM Manager database schema ...Done
 
Installing the ovs-manager package (rpm) ...
Done
 
Installing the oc4j package (rpm) ...
Done
 
Please enter the password for account 'oc4jadmin':
Confirm the password:
 
Starting OC4J ... Done.
To access the OC4J Home Page and change the password go to http://127.0.0.1:8888/em
 
Deploying Oracle VM Manager application to OC4J container.
Creating connection pool ... Done
Creating data source ... Done
Deploying application help ... Done
Deploying application ... Done
 
13. Type a secure password for the keystore password for the Web Service.
Please enter the keystore password for the Web Service:
Confirm the password:
 
Setting keystore password for Web Service ... Done
 
14. You can enable HTTPS for the Oracle VM Manager user interface by typing Y, or n if you do not want to enable HTTPS. If you select Y a private SSL certificate will be generated and used to secure the Oracle VM Manager user interface. In the example we typed Y to enable HTTPS.
 
Do you want to use HTTPS access for Oracle VM Manager (Y|n)?y
 
Configuring OC4J to use HTTPS ... Done
Stopping OC4J ... Done
Starting OC4J ... Done
 
15. Type a secure password for the default Oracle VM Manager admin account. You will use the admin user name and the admin password to log into the Oracle VM Manager user interface.
 
Please enter the password for the default account 'admin':
Confirm the password:
 
Configuring SMTP server …
 
16. Type the outgoing SMTP mail server IP address or the fully qualified domain name (optional).
Please enter the outgoing SMTP mail server (e.g. - mail.abc.com, mail.abc.com:25): mail.my.domain.net:25
Mail server checking, may need some time, please wait...
Setting the SMTP server to mail.my.domain.net...
Done
 
17. Type the e-mail address for the admin account.
Please enter an e-mail address for account 'admin': my.admin.account@my.domain.com
Confirm the e-mail address: my.admin.account@my.domain.com
 
The console feature is not enabled by default.
For detailed setup, refer to Oracle VM Manager User's Guide
 
Installation of Oracle VM Manager completed successfully.
 
To access the Oracle VM Manager 2.2 home page go to:
https://<Oracle VM Manager Host>:4443/OVS
 
To access the Oracle VM Manager web services WSDL page go to:
https://<Oracle VM Manager Host>:4443/OVSWS/LifecycleService.wsdl
https://<Oracle VM Manager Host>:4443/OVSWS/ResourceService.wsdl
https://<Oracle VM Manager Host>:4443/OVSWS/PluginService.wsdl
https://<Oracle VM Manager Host>:4443/OVSWS/ServerPoolService.wsdl
https://<Oracle VM Manager Host>:4443/OVSWS/VirtualMachineService.wsdl
https://<Oracle VM Manager Host>:4443/OVSWS/AdminService.wsdl
 
To access the Oracle VM Manager help page go to:
https://<Oracle VM Manager Host>:4443/help/help
 
If you selected HTTP:
 
To access the Oracle VM Manager 2.2 home page go to:
 http://<Oracle VM Manager Host>:8888/OVS

To access the Oracle VM Manager web services WSDL page go to:
 http://<Oracle VM Manager Host>:8888/OVSWS/LifecycleService.wsdl
 http://<Oracle VM Manager Host>:8888/OVSWS/ResourceService.wsdl
 http://<Oracle VM Manager Host>:8888/OVSWS/PluginService.wsdl
 http://<Oracle VM Manager Host>:8888/OVSWS/ServerPoolService.wsdl
 http://<Oracle VM Manager Host>:8888/OVSWS/VirtualMachineService.wsdl
 http://<Oracle VM Manager Host>:8888/OVSWS/AdminService.wsdl

To access the Oracle VM Manager help page go to:
 http://<Oracle VM Manager Host>:8888/help/help
 
The Oracle VM Manager application was successfully installed and can be accessed by typing https://<Oracle VM Manager Host>:4443/OVS if you selected HTTPS or http://<Oracle VM Manager Host>:8888/OVS if you did not select HTTPS in a web browser. Enter the admin user name and the admin password to log into the Oracle VM Manager portal.
 
List 2 shows the supported Web browsers for the Oracle VM Manager user interface.
  • Microsoft Internet Explorer 5.5 or later
  • Firefox 1.0.4 or later (Linux and Windows)
  • Safari 2.x (Mac)
If you configured the SMTP server the admin account will receive the following email:
 
OVM Administrator
Figure 2 shows the Oracle VM Manager Log in page.
 
The Oracle Database Express Edition portal can be accessed from the Oracle VM manager server locally by entering http://127.0.0.1:8080/apex or remotely by entering the ip address or the FQDN followed by :8080/apex, i.e. http://<Oracle VM Manager Host>:8080/apex in a web browser. You can use the SYS, SYSTEM or the OVS user account and the associated password to log in to the Oracle Database Express Edition portal.
 
Figure 3 shows the Oracle Database Express Edition portal login page.
 
The Application Server Control portal is also part of the Oracle VM Manager install. The oc4jadmin account can be maintained from the Application Server Control portal. The Application Server Control portal can only be access locally from the Oracle VM Manager host by typing http://127.0.0.1:8888/em. Use the oc4jadmin account and password to access the Application Server Control portal.
 

Figure 4 shows the Application Server Control login page. 

Applying the 2.2.16 Oracle VM Manager Patch

The Oracle VM Manager 2.2.16 patch provides several Oracle VM Manager updates and bug fixes. The Oracle VM Manager 2.2.16 patch is available from the Unbreakable Linux Network in the Oracle Software for Enterprise Linux channels.
 
Table 3 lists the ovs-manager-2.2-16.noarch package and the channels where the ovs-manager-2.2-16.noarch package is hosted.
 
Table 3
Package
Channel
Description
ovs-manager-2.2-16.noarch
Oracle Software for Enterprise Linux 4 (i386)
Oracle Software for Enterprise Linux 4 (i386)
ovs-manager-2.2-16.noarch
Oracle Software for Enterprise Linux 4 (x86_64)
Oracle Software for Enterprise Linux 4 (x86_64)
ovs-manager-2.2-16.noarch
Oracle Software for Enterprise Linux 5 (x86_64)
Oracle Software for Enterprise Linux 5 (x86_64)
ovs-manager-2.2-16.noarch
Oracle Software for Enterprise Linux 5 (i386)
Oracle Software for Enterprise Linux 5 (i386)
 
While applying the ovs-manager-2.2-16.noarch package you will be prompted for a total of three passwords.
 
List 4 shows the three passwords.
  • The password for the Oracle XE SYS account.
  • The password for the Oracle VM Manager OVS database schema.
  • The password for the OC4J oc4jadmin account.

The next example shows how to install the ovs-manager-2.2-16.noarch package as root or using sudo.

Updating Oracle VM Manager using the Installation Media

Unlike Oracle VM Server, which has multiple update options Oracle VM Manager is updated by downloading the media from Oracle’s eDelivery portal and executing an installation script. Oracle VM media is freely downloadable from Oracle’s eDelivery system at http://edelivery.oracle.com/linux. 
 
Updating Oracle VM Manager is accomplished by running the Oracle VM Manager installation program on the Oracle VM Manager host and to select the upgrade installation option. The Oracle VM Manager installation program will ask for the passwords for the existing Oracle VM Manager OVS database account and the oc4jadmin account. The Oracle VM Manager OVS database account and the oc4jadmin account passwords are selected during the Oracle VM Manager installation process. The account passwords for the Oracle VM Manager OVS database account and the oc4jadmin account can be managed from their respected web portals.
 
Note: The Oracle Database Express Edition portal and the Application Server Control portal are installed by default with the Oracle VM Manager portal. The Oracle VM Manager Template does not enclude the Oracle Database Express Edition portal and the Application Server Control portal.

OVS Database and oc4jadmin Accounts and Passwords

 The OVS account can be maintained from the Oracle Database Express Edition portal. The Oracle Database Express Edition portal is a part of the Oracle VM Manager install and can be accessed locally by entering http://127.0.0.1:8080/apex or remotely by entering the ip address or the FQDN followed by :8080/apex, i.e. http://OracleVM_Manager_fqdn:8080/apex in a web browser.
 
The next Figure shows the Oracle Database Express Edition portal login page.
The Application Server Control portal is a part of the Oracle VM Manager install. The oc4jadmin account can be maintained from the Application Server Control portal. The Application Server Control portal can only be accessed locally from the Oracle VM server console by entering http://127.0.0.1:8888/em in a local web browser.
 
The next Figure shows the Application Server Control portal login page.
 

Updating Oracle VM Manager

The following section will review each of the steps of a successful Oracle VM Manager upgrade.

The update process requires you to select the upgrade option from the install prompt as well as enter the passwords for the Oracle VM Manager OVS database account and the Oracle VM Manager oc4jadmin account. 

Step 1 is to download the ISO image from http://edelivery.oracle.com/linux.
Once the ISO image is downloaded and placed on the Oracle VM Manager host or made available from a network share then it should be mounted as root user.
 
The following example shows how to mount the Oracle VM Manager ISO image from the Oracle VM Manager server console as root user.
# mount -o ro,loop OracleVM-Manager-2.1.2.iso mnt/
# cd mnt
# ls
EULA LICENSE readme.txt runInstaller.sh scripts source TRANS.TBL
Step 2 is to execute the runInstaller.sh script within the Oracle VM Manager root directory from the Oracle VM Manager server console as root.
 
The following example shows how to execute the runInstaller.sh from the Oracle VM Manager server console as root user.
# sh runInstaller.sh
Step 3 is to select the Upgrade option (number 3) from the install prompt. The next example shows the installation choice prompt.
Please enter the choice: [1|2|3]
1. Install Oracle VM Manager
2. Uninstall Oracle VM Manager
3. Upgrade Oracle VM Manager
Step 4 asks if you would like to proceed or cancel the upgrade. You can enter y to proceed or n to cancel the upgrade. The following example shows the upgrade acceptance prompt.
Are you sure you want to upgrade Oracle VM Manager from version 2.1.1 to 2.1.2 ? [y|N] y
Step 5 is to enter the OVS password. The following example shows the OVS installation password prompt.
Please enter the password for database account 'OVS':
Step 6 is to enter the oc4jadmin password. The following example shows the oc4jadmin installation password prompt.
Please enter the password for account 'oc4jadmin':
Step 7 is to enter yes or no to backup the Oracle VM Manager database. This step is optional, i.e. entering no will not abort the upgrade. The following example shows the Oracle VM Manager database backup prompt.
Would you like to back up the Oracle VM Manager database?
Now back up the Oracle VM Manager database to /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/dump-2008-10-06-05-24-25-PM.dmp
A successful upgrade will exit with the following informational warnings.
Export terminated successfully with warnings.
 Done.
 
Now upgrading the database schema ... Done.
 
Now upgrading the Oracle VM Manager application ...
Done.
Upgrade Oracle VM Manager successfully.
Please check the log /var/log/ovm-manager/upgrade_2.1.1_2.1.2.log for more information.
 
To access the Oracle VM Manager 2.1.2 home page go to:
 http://ovm01.com:8888/OVS
 
To access the Oracle VM Manager help page go to:
 http://ovm01.com:8888/help/help
#
Step 8 is to validate the Oracle VM Manager version number from the Oracle VM Manager home page. The Oracle VM home page URL can be accessed locally via http://127.0.0.1:8888/OVS or from a remote web browser via http://ip_address_of_host:8888/OVS or http://fqdn:8888/OVS. From the Oracle VM Manager home page you can validate the version number from the footer of the home page.
 

Oracle VM Manager Database Backup and Restoration

Oracle VM Manager Database Backup

The Oracle VM Manager batabase can be backed up using the backup.sh script. Before you backup the Oracle VM Manager database, access Oracle VM Manager and ensure that the status of all of the Oracle VM servers is "Running". You will need the following details for the backup procedure a) the password for database account 'OVS', which was assigned during the Oracle VM Manager install, b) the path for dump file, i.e. /tmp/ovs.dmp and c) the path for log file, i.e. /tmp/ovs.log. We will conclude Step 1 with a complete Oracle VM Manager database restore.
 
The following example shows how to execute the “/opt/ovs-manager-2.2/bin/backup.sh” script from the Oracle VM Manager host as root user.
# sh /opt/ovs-manager-2.2/bin/backup.sh
Next to backup the Oracle VM Manager database select the Backup Oracle VM Manager option (number 1) from the backup prompt. The next example shows the backup selection prompt.
sh /opt/ovs-manager-2.2/bin/backup.sh
Welcome to Oracle VM Manager
 
Completed backup:
 
Please enter the choice: [1|2]
1. Back up Oracle VM Manager
2. Restore Oracle VM Manager
1
The next example reviews a complete Oracle VM Manager database backup. Access the Oracle VM Manager server console as root and type "sh /opt/ovs-manager-2.2/bin/backup.sh" to start the Oracle VM Manager database backup as shown in the following example.
# sh /opt/ovs-manager-2.2/bin/backup.sh
Welcome to Oracle VM Manager
 
Completed backup:
 
Please enter the choice: [1|2]
1. Back up Oracle VM Manager
2. Restore Oracle VM Manager
1
 
Back up data now ...
Please enter the password for database account 'OVS':
Please enter the path and filename for the dump file (eg /tmp/ovs.dmp):/tmp/ovs.dmp
Please enter the path and filename for the log file (eg /tmp/ovs.log):/tmp/ovs.log
 
SQL*Plus: Release 10.2.0.1.0 - Production on Sat Oct 17 10:00:51 2009
 
Copyright (c) 1982, 2005, Oracle. All rights reserved.
 
 
Connected to:
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
 
SQL>
PL/SQL procedure successfully completed.
 
SQL> Disconnected from Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
 
Export: Release 10.2.0.1.0 - Production on Sat Oct 17 10:00:52 2009
 
Copyright (c) 1982, 2005, Oracle. All rights reserved.
 
 
Connected to: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
Export done in US7ASCII character set and AL16UTF16 NCHAR character set
server uses AL32UTF8 character set (possible charset conversion)
. exporting pre-schema procedural objects and actions
. exporting foreign function library names for user OVS
. exporting PUBLIC type synonyms
. exporting private type synonyms
. exporting object type definitions for user OVS
About to export OVS's objects ...
. exporting database links
. exporting sequence numbers
. exporting cluster definitions
. about to export OVS's tables via Conventional Path ...
. . exporting table                      OVS_AGENT          2 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
. . exporting table                      OVS_ALERT         11 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
. . exporting table                   OVS_CATEGORY          1 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
. . exporting table                      OVS_CDROM          5 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
. . exporting table             OVS_CDROM_RESOURCE          0 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
. . exporting table                      OVS_GROUP          4 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
. . exporting table                    OVS_HD_TEMP
. . exporting table                     OVS_IMG_OS          0 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
. . exporting table                   OVS_IMG_TEMP
. . exporting table                       OVS_LOCK         19 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
. . exporting table                        OVS_MAP         35 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
. . exporting table                   OVS_NIC_TEMP
. . exporting table                OVS_OS_RESOURCE         17 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
. . exporting table                    OVS_PARTNER          0 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
. . exporting table           OVS_PREFERRED_SERVER          0 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
. . exporting table                  OVS_PRIVILEGE          4 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
. . exporting table             OVS_PRIVILEGE_ROLE          5 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
. . exporting table                   OVS_RESOURCE          4 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
. . exporting table                       OVS_ROLE          3 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
. . exporting table                     OVS_SERVER          2 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
. . exporting table                       OVS_SITE          1 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
. . exporting table                  OVS_STATISTIC      16593 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
. . exporting table                  OVS_SYS_VALUE         8 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
. . exporting table                       OVS_TASK          0 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
. . exporting table                       OVS_USER         19 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
. . exporting table                 OVS_USER_GROUP         75 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
. . exporting table                  OVS_USER_ROLE         19 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
. . exporting table                  OVS_USER_SITE         19 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
. . exporting table                     OVS_VD_IMG         39 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
. . exporting table               OVS_VIRTUAL_DISK         73 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
. . exporting table                OVS_VM_GEN_INFO         25 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
. . exporting table                     OVS_VM_IMG         25 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
. . exporting table                 OVS_VM_NETWORK         25 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
. . exporting table                OVS_VM_SNAPSHOT          0 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
. . exporting table             OVS_WORKSPACE_TEMP
. exporting synonyms
. exporting views
. exporting stored procedures
. exporting operators
. exporting referential integrity constraints
. exporting triggers
. exporting indextypes
. exporting bitmap, functional and extensible indexes
. exporting posttables actions
. exporting materialized views
. exporting snapshot logs
. exporting job queues
. exporting refresh groups and children
. exporting dimensions
. exporting post-schema procedural objects and actions
. exporting statistics
Export terminated successfully with warnings.
 
SQL*Plus: Release 10.2.0.1.0 - Production on Sat Oct 17 10:01:05 2009
 
Copyright (c) 1982, 2005, Oracle. All rights reserved.
 
 
Connected to:
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
 
SQL>
PL/SQL procedure successfully completed.
 
SQL> Disconnected from Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
Done
Please check the log file /tmp/ovs.log
#

Oracle VM Manager Database Restore

The Oracle VM Manager batabase can be restored from a backup using the backup.sh script. Before you restore the Oracle VM Manager database, access Oracle VM Manager and ensure that the status of all of the Oracle VM servers is "Running".
 
The following details are required to restore the Oracle VM Manager databasee a) the password for database account 'OVS', which was assigned during the Oracle VM Manager install, b) the path for dump file, i.e. /tmp/ovs.dmp and c) the path for log file, i.e. /tmp/ovs.log.
 
The following example shows how to execute the “/opt/ovs-manager-2.2/bin/backup.sh” script from the Oracle VM Manager server console as root user.
# sh /opt/ovs-manager-2.2/bin/backup.sh
Next, to backup the Oracle VM Manager database, select the Restore Oracle VM Manager option (number 2) from the backup prompt. The next example shows the backup selection prompt.
sh /opt/ovs-manager-2.2/bin/backup.sh
Welcome to Oracle VM Manager
 
Completed backup:
 
Please enter the choice: [1|2]
1. Back up Oracle VM Manager
2. Restore Oracle VM Manager
2
The next example reviews a complete Oracle VM Manager database restore. Access the Oracle VM Manager server console as root and type "sh /opt/ovs-manager-2.1/bin/backup.sh" to start the Oracle VM Manager database restore as shown in the following example.
 
The next example reviews an Oracle VM Manager database restore procedure. Access the Oracle VM Manager server console as root and type "sh /opt/ovs-manager-2.1/bin/backup.sh" as shown in the following example.
# sh /opt/ovs-manager-2.1/bin/backup.sh
Welcome to Oracle VM Manager
 
Please enter the choice: [1|2]
1. Back up Oracle VM Manager
2. Restore Oracle VM Manager
2
 
Restore data now ...
Please enter the password for database account 'SYS':
Please enter the path and filename for the dump file (eg /tmp/ovs.dmp):/tmp/ovs.dmp
Please enter the path and filename for the log file (eg /tmp/ovs.log):/tmp/ovs.log
 
Import: Release 10.2.0.1.0 - Production on Sun Oct 18 11:15:24 2009
 
Copyright (c) 1982, 2005, Oracle. All rights reserved.
 
 
Connected to: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
 
Export file created by EXPORT:V10.02.01 via conventional path
 
Warning: the objects were exported by OVS, not by you
 
import done in US7ASCII character set and AL16UTF16 NCHAR character set
import server uses AL32UTF8 character set (possible charset conversion)
. . importing table                    "OVS_AGENT"          2 rows imported
. . importing table                    "OVS_ALERT"         11 rows imported
. . importing table                 "OVS_CATEGORY"          1 rows imported
. . importing table                    "OVS_CDROM"          5 rows imported
. . importing table           "OVS_CDROM_RESOURCE"          0 rows imported
. . importing table                    "OVS_GROUP"          4 rows imported
. . importing table                   "OVS_IMG_OS"          0 rows imported
. . importing table                     "OVS_LOCK"         19 rows imported
. . importing table                      "OVS_MAP"         35 rows imported
. . importing table              "OVS_OS_RESOURCE"         17 rows imported
. . importing table                  "OVS_PARTNER"          0 rows imported
. . importing table         "OVS_PREFERRED_SERVER"          0 rows imported
. . importing table                "OVS_PRIVILEGE"          4 rows imported
. . importing table           "OVS_PRIVILEGE_ROLE"          5 rows imported
. . importing table                 "OVS_RESOURCE"          4 rows imported
. . importing table                     "OVS_ROLE"          3 rows imported
. . importing table                   "OVS_SERVER"          2 rows imported
. . importing table                     "OVS_SITE"          1 rows imported
. . importing table                "OVS_STATISTIC"      16593 rows imported
. . importing table                "OVS_SYS_VALUE"          8 rows imported
. . importing table                     "OVS_TASK"          0 rows imported
. . importing table                     "OVS_USER"         19 rows imported
. . importing table               "OVS_USER_GROUP"         75 rows imported
. . importing table                "OVS_USER_ROLE"         19 rows imported
. . importing table                "OVS_USER_SITE"         19 rows imported
. . importing table                   "OVS_VD_IMG"         39 rows imported
. . importing table             "OVS_VIRTUAL_DISK"         73 rows imported
. . importing table              "OVS_VM_GEN_INFO"         25 rows imported
. . importing table                   "OVS_VM_IMG"         25 rows imported
. . importing table               "OVS_VM_NETWORK"         25 rows imported
. . importing table              "OVS_VM_SNAPSHOT"          0 rows imported
Import terminated successfully without warnings.
Done
Please check the log file /tmp/ovs.log
#

Deploying the Oracle VM Manager Template

This section will review how to deploy the Oracle VM Manager Template. The section starts with a review of the Oracle VM Manager Template prerequisites, followed with the procedure to deploy the Oracle VM Manager Template on an Oracle VM server.
 

Oracle VM Manager Template Prerequisites

Table 4 shows the disk, storage, RAM and networking prerequisits for an Oracle VM server hosting the Oracle VM Manager Template.
Oracle VM Server Resource Requirements
Minimum Requirements
Disk Space
The Oracle VM Manager Template requires at least 4GB of free space on the Oracle VM server for the compressed and uncompressed files.
Storage Repositories
The Oracle VM Manager Template can be configured on an Oracle VM server with a local OCFS2 storage repository or with a shared OCFS2 or NFS storage repository. If the Oracle VM server is using a shared storage repository, mount only the root repository before running the Deploy_Manager_Template.sh script. Only after the Oracle VM Manager Template has been deployed can extended storage repositories be configured and mounted.
RAM
The Oracle VM Manager Template requires at least 2GB of free memory on the Oracle VM Server.
Networking
The Oracle VM Server will need to have a working Xen bridge for the Oracle VM Manager Template. The Oracle VM Manager Deploy_Manager_Template.sh script will list the “Available network bridges” and ask to select a bridge for the Oracle VM Manager Teample. The xen bridge that is selected, i.e. xenbr0, xenbr1, xenbr2, etc.. must be active and accessable on the network.
 
Note: The Oracle VM Manager Template requires a static IP address that will be assigned to the Oracle VM Manager template virtual machine. The Oracle VM Manager Deploy_Manager_Template.sh script will ask for the following network details for the Oracle VM Manager virtual machine:
* Static IP address
* Netmask
* Default Gateway IP address
* DNS Server IP address
* Hostname

SMTP Server

Oracle VM Manager has several user notification features that require the use of an SMTP server. During the Oracle VM Manager installation you will be asked to a) enter the SMTP server IP address or fully qualified domain name and b) the SMTP port and c) a valid email address and password for the Oracle VM Manager admin account.
 
Entering the SMTP details during the template configuration is optional and can be configured after the template is deployed using the “update_email.sh” script or by editing the values in Oracle VM Manager repository database table ovs_sys_value under the OVS schema.
 
Tip: The Deploy_Manager_Template.sh script can be run with options “--skipsmtpcheck” and “--skipmailcheck” to skip the SMTP server check and email check.

User Accounts, Passwords and Password Complexity Requirements

The Oracle VM Manager Template configuration will create two operating system users with default passwords; root with password ovsroot and oracle with password oracle. The default passwords for the root and oracle accounts should be chaged once the template is deployed. The oracle account belongs to the oinstall and dba groups.
 
The default vnc console password for the Oracle VM Manager Template is oracle.
 
During the Oracle VM Manager Installation you will be prompted for a total of six required passwords.
 
List 5 shows the six required passwords.
  • The password for the Oracle XE SYS and SYSTEM accounts.
  • The password for the Oracle VM Manager OVS database schema.
  • The password for the OC4J oc4jadmin account.
  • The password for the Web Service keystore file.
  • The password for the admin account.
  • The Oracle VM agent password.
Tip: The Oracle VM agent password can be reset by typing “service ovs-agent configure” from dom0 as root.
 
List 6 shows the password complexity requirements for the required passwords.
  • The password must begin with an uppercase or lowercase letter.
  • The password may include the following characters:
    • Numbers (such as 1, 2, 3, and so on), letters (from a to z, A to Z), and underscores (_).
  • Examples of valid passwords: Password01, Password_123, password.
 
Tip: Select and write down all the passwords before you start the installation. Unfortunately you may not be able to use the same password for all four services because the Web Service has a slightly different password policy.

HTTP and Oracle VM Manager XE Database listening Ports

During the Oracle VM Manager Template configuration phase the installer asks to set the XE HTTP port and XE Database port. The installer program will provide defaults for the XE HTTP port and XE Database port.
  • The Oracle XE HTTP port. The default port number is 8080.
  • The Oracle XE listening port. The default port number is 1521.

Oracle VM Server Cluster Configurations

If the Oracle VM Manager Template is being deployed on an Oracle VM server that had been in an Oracle VM server pool, the Oracle VM servers cluster configurations must be cleaned before deploying the template.
 
To clean an Oracle VM server's cluster configurations it is necessary to a) empty the /etc/ocfs/cluster.conf file b) delete and recreate the local BerkleyDB and c) run the cleanup.py script to stop o2cb heartbeat, offline o2cb, remove o2cb configuration file, umount ovs-agent storage repositories and to cleanup ovs-agent local database.
 
To clear /etc/ocfs/cluster.conf file type “cat /dev/null> /etc/ocfs2/cluster.conf” from dom0, as shown in the next example.
# cat /dev/null> /etc/ocfs2/cluster.conf
To remove the local BerkleyDB first type “service ovs-agent stop”, which stops the Oracle VM agent. Next, type “rm -fr /etc/ovs-agent/db/*” to delete the BerkleyDB. Finally, type “service ovs-agent start” to start the Oracle VM agent, which also recreate a new local BerkleyDB.
 
To stop the o2cb heartbeat, offline o2cb, remove o2cb configuration file, unmount ovs-agent storage repositories and to cleanup ovs-agent local database, type "/opt/ovs-agent-2.3/utils/cleanup.py" and then type “y” as shown in the next example.
# /opt/ovs-agent-2.3/utils/cleanup.py
This is a cleanup script for ovs-agent.
It will try to do the following:
 
*) stop o2cb heartbeat
*) offline o2cb
*) remove o2cb configuration file
*) umount ovs-agent storage repositories
*) cleanup ovs-agent local database
 
Would you like to continue? [y/N] y
Cleanup done.
 

Download and Deploy the Oracle VM Manager Template

It takes approximately 15 to 30 minutes to download and deploy the Oracle VM Manager Template, depending on download bandwidth, and the performance of the Oracle VM host.
 
List 7 reviews the five steps to deploy the Oracle VM Manager Template.
  1. Download the Oracle VM Manager template named “Oracle VM Manager 2.2.0 for x86 (32 bit) with Oracle Linux 5.4” from “http://edelivery.oracle.com/linux”. Note: Do not unzip the V21186-01.zip file until Step 2.
  2. Copy the zip file named V21186-01.zip to your Oracle VM server's /OVS/running_pool directory.
  3. Unzip the V21186-01.zip file. The V21186-01.zip file contains two file, Deploy_Manager_Template.sh and OVM_EL5U4_X86_OVM_MANAGER_PVM.tgz. Note: Do not untar the OVM_EL5U4_X86_OVM_MANAGER_PVM.tgz file.
  4. From dom0 as root type “sh Deploy_Manager_Template.sh”. The Deploy_Manager_Template.sh script is used to check the prerequisite and gather all the details to configure and create the Oracle VM Manager virtual machine.
  5. After the Deploy_Manager_Template.sh script completes and the Oracle VM Manager template is deployed, you will need to wait about 3 to 5 minutes for the Oracle VM Manager application to start. Once the Oracle VM Manager application is running log in to the Oracle VM Manager URL that is displayed at the end of the Deploy_Manager_Template.sh script using the admin account and the password youe selected durring the installation. You can ssh to the Oracle VM Manager Template using the IP address assigned durring the configuration phase using the root account with the default “ovsroot” password.

Running the Deploy_Manager_Template.sh Script

The next example shows a complete Deploy_Manager_Template.sh script session run as root from dom0. The Oracle VM server in the example was configed with a shared root storage repository. The Deploy_Manager_Template.sh and OVM_EL5U4_X86_OVM_MANAGER_PVM.tgz files are in the /OVS/running_pool directory.
 
Tip: The Deploy_Manager_Template.sh script can be run with options “--skipsmtpcheck” and “--skipmailcheck” to skip the SMTP server check and email check.
 
# sh Deploy_Manager_Template.sh --skipsmtpcheck --skipmailcheck
Starting prerequisite checking ...
 
Checking the Oracle VM Server ...
Done
Checking the xend status ...running
Done
Checking the Oracle VM Agent version ...Done
Checking the Oracle VM Agent status ...
Done
Checking the Oracle VM Server free memory: 15623 MB
Done
Checking the available disk space ...
[ R ] 6a16e7f3-36aa-475e-9181-37f65c944487 => ca-fileserver4:/vol/vol1_nfs_demo
*** Storage repositories initialized.
**ca-fileserver4.us.oracle.com:/vol/vol1_nfs_scdemo mounted, set as cluster root.
[ R ] 6a16e7f3-36aa-475e-9181-37f65c944487 => ca-fileserver4:/vol/vol1_nfs_demo
You have 90 GB in /var/ovs/mount/6A16E7F336AA475E918137F65C944487
Checking the running pool directory .../var/ovs/mount/6A16E7F336AA475E918137F65C944487/running_pool
Done
Checking the HA cluster prerequisite ...
Please enter the password for Oracle VM Agent: cluster_precheck...2.3
 
Done
Checking whether Oracle VM Agent DB is clean ...
Done
 
Setting up the network for Oracle VM Manager ...
Oracle VM Manager needs to be configured using a static IP address. Follow
the prompts to provide your network settings for Oracle VM Manager.
 
Press any key to continue...
Available network bridges:
0) xenbr0 Link encap:Ethernet HWaddr 00:1F:29:68:55:FC
inet addr:10.211.0.115 Bcast:0.0.0.0 Mask:255.255.252.0
1) xenbr1 Link encap:Ethernet HWaddr 00:1F:29:68:55:B4
Please choose one of the network bridges(default is xenbr0):
You selected the network bridge: xenbr0
Enter static IP address: 10.211.0.216
Enter netmask: [255.0.0.0] 255.255.252.0
Enter gateway: 10.211.0.1
Enter DNS server: 139.185.51.1
 
Enter hostname (e.g, host.domain.com): [ca-scdemo-ovm2.2.1-01]
Generating parameter file ...
 
Note following password setting will be used for SYS and SYSTEM.
Oracle recommends the use of different passwords for each database account.
This can be done after initial configuration.
 
Specify a password to be used for database accounts:
Confirm the password:
 
Please enter the password for account 'OVS':
Confirm the password:
 
Please enter the password for account 'oc4jadmin':
Confirm the password:
 
Please enter the keystore password for Web Service:
Confirm the password:
 
Do you want to use HTTPS access for Oracle VM Manager (Y|n)? n
 
Please enter the password for the default account 'admin':
Confirm the password:
 

Set Oracle VM Server Information:

Enter the Server Pool Name: HQ
 
Enter the Oracle VM Server login user name: root
Enter the Oracle VM Server login password:
Do you want to enable HA(y|N)? y
 
Please confirm the following information:
Server Pool name : HQ
Oracle VM Server name : ca-scdemo1
Oracle VM Server login user name : root
Enable HA : true
 
Is the Oracle VM Server information correct(Y|n)? Y
Untar the Oracle VM Manager template tarball ...
Done
Move the parameter file to Manager.img
Done
Create Oracle VM Manager virtual machine ...
Done
The Oracle VM Manager virtual machine is booting. To finish the Oracle VM
Manager configuration, connect to the virtual machine console using any
VNC Viewer from a desktop machine via the command:
vncviewer ca-scdemo1:5900
 
After Oracle VM Manager has been successfully deployed, access the Oracle
VM Manager home page at:
http://10.211.0.216:8888/OVS

The Oracle VM Manager Command Line Interface Introduction

The Oracle VM Manager Command Line Interface is an Oracle VM Manager add on that is available to Oracle Unbreakable Linux support customers via the Oracle Unbreakable Linux Network.  The Oracle VM Manager Command Line Interface offers a command-line interface for Oracle VM Manager.  The Oracle VM Manager Command Line Interface allows Oracle VM Manager functions to be executed from the command-line. Oracle VM Manager Command Line Interface commands can be scripted allowing automation of administrative tasks, such as checking status, performing lifecycle management, and executing bulk actions.
 
List 8 highlights the most common use cases for the Oracle VM Manager Command Line Interface:
  • Guest, server and server pool lifecycle management:
    • Power On, Power Off, Clone, Save as Template, Import, Migrate, Pause, Unpause, Suspend, Resume and Delete virtual machines
    • Manage virtual machine resources, including ISO files, virtual machine templates and virtual machine images
    • Manage Oracle VM Manager users, and Oracle VM Manager groups
    • Create and configure server pools
    • Manage the Oracle VM Agent
  • Checking the status of guests, server, and server pools:
    • Get a list of running guests in server pool
    • Get a list of active pool servers
    • Diagnose and troubleshoot issues with guests, servers, and server pools
    • Get configuration and status information for guests, servers and server pools
  • Performing bulk operations:
    • With multiple guests
    • With multiple servers
    • With multiple server pools
The Oracle VM Manager Command Line Interface (ovmcli) is a stand-alone application that is written in Python that leverages the Oracle VM Manager Web Services API to communicate with Oracle VM Manager. The Oracle VM Manager Command Line Interface can be installed on any Oracle Enterprise Linux or RHEL host with connectivity to your Oracle VM Manager system.  The Oracle VM Manager Command Line Interface can be accessed from a local or remote console.
 
Figure 6 illustrates the Oracle VM Manager Command Line Interface intra-component communication and firewall requirements.
List 9 highlights the Oracle VM Manager Command Line Interface communication ports and system passwords:
Oracle VM Manager:
  • The default HTTP port of Oracle VM Manager UI is 8888.
  • The default HTTPS port of Oracle VM Manager UI is 4443
  • Remote access to the Command Line Interface hosts via ssh on port 22
  • Guest console access uses ports 5900 through 5999.
  • Guest console access requires a password without a user name.
The Oracle VM Manager Command Line Interface has one prerequisite, namely the python-ZSI RPM. The ovmcli and python-ZSI RPMs are hosted at ULN. The ovmcli RPM is located in the el5_i386_oracle_addons and the el5_x86_64_oracle_addons channel. The python-ZSI RPM is located in the el5_i386_addons and el5_x86_64_addons channel. 

Downloading the Oracle VM Manager Command Line Interface from ULN

In this section we will walk through the procedure to download the Oracle VM Manager Command Line Interface. We will start with a visit to ULN, to search for, and download, the ovmcli and python-ZSI RPMs. After the download section, we will walk through the installation and configuration of the Oracle VM Manager Command Line Interface on an Oracle Enterprise Linux host. If you have already downloaded the RPMs from ULN, please skip to the next section.
 
Note: ULN is password protected. To access ULN you will need a valid Oracle Unbreakable Linux support contract and a CSI number. Support contracts for Oracle VM can be purchased from your Oracle VM sales representative or directly from the Oracle Store. Once you have a valid support contract, you can register at the ULN portal or you can register by running the “up2date –register” command from one of your Oracle VM servers. Please review Oracle VM: How to update an Oracle VM Server for details about registering an Oracle VM server with ULN.
 
The Oracle VM Manager Command Line Interface (ovmcli) is hosted at ULN in the el5_i386_oracle_addons and el5_x86_64_oracle_addons channels. The Oracle VM Manager Command Line Interface prerequisite python-ZSI is hosted in the el5_i386_addons and el5_x86_64_addons channel.
 
Table 5 shows the Oracle VM Manager Command Line Interface package names with the associated ULN channel names.
Package
ULN Channel
ovmcli-1.0-1.el5.noarch.rpm
el5_i386_oracle_addons and el5_x86_64_oracle_addons
python-ZSI-2.1-a1.el5.noarch.rpm
el5_i386_addons and el5_x86_64_addons
1- Point your browser to http://linux.oracle.com as shown in Figure 7. Enter you user name and password and click the Login button to access ULN.
 2- From the ULN home page click on the Channels tab as shown in Figure 8.
 
3- From the Channels page click the i386_oracle_addons channel for the x86 platform or click the el5_x86_64_oracle_addons channel for the x86-64 platform to download the appropriate ovmcli RPM.
 
In our example we are looking for the el5_x86_64_oracle_addons channel which is not displayed on the current page. We will need to access the next page to locate the el5_x86_64_oracle_addons channel. Click the Next button at the bottom of the page as shown in Figure 9 to display the next page.
 
4- From the Channels page click the el5_x86_64_oracle_addons channel as shown in Figure 10.
 
5- From the Oracle Software addons for Enterprise Linux 5 (X86-64) page, click the Packages link as shown in Figure 11.
 
6- From the Oracle Software addons for Enterprise Linux 5 (X86-64) > Packages page, click the ovmcli-1.0-1.el5.noarch link as shown in Figure 12 to display the ovmcli-1.0-1.el5.noarch RPM Package Details page.
 
7- From the Oracle Software addons for Enterprise Linux 5 (X86-64) > Packages > ovmcli-1.0-1.el5.noarch page, click the ovmcli-1.0-1.el5.noarch.rpm link as shown in Figure 13 to download the ovmcli-1.0-1.el5.noarch RPM.
 
Note: The File list link lists the details about all the files for the ovmcli-1.0-1.el5.noarch RPM. The Requires link lists the requirements for the ovmcli-1.0-1.el5.noarch RPM. The Provides link lists what the ovmcli-1.0-1.el5.noarch RPM provides, i.e. the ovmcli. The Obsoletes link lists what application(s) the ovmcli-1.0-1.el5.noarch RPM obsoletes. The Conflicts link lists the conflicts for the ovmcli-1.0-1.el5.noarch RPM.
 
8- From the Oracle Software addons for Enterprise Linux 5 (X86-64) > Packages > ovmcli-1.0-1.el5.noarch page, click the Channel link as shown in Figure 14 to return to the Channel page to download the python-ZSI RPM.
 
9- From the Channels page locate and click the el5_x86_64_addons channel link as shown in Figure 15 to access the Enterprise Linux 5 Add ons (X86-64) > Packages page.
 
10- From the Oracle Enterprise Linux 5 Add ons (x86-64) > Packages page click the python-ZSI-2.1-a1.el5.noarch.rpm link as shown in Figure 16 to display the Enterprise Linux 5 Add ons (X86-64) > Packages >  python-ZSI-2.1-a1.el5.noarch.rpm page.
 
11- From the Enterprise Linux 5 Add ons (X86-64) > Packages >  python-ZSI-2.1-a1.el5.noarch.rpm page, click the python-ZSI-2.1-a1.el5.noarch.rpm link as shown in Figure 17 to download the python-ZSI-2.1-a1.el5.noarch.rpm RPM.
 
Note: The File list link lists the details about all the files for the python-ZSI-2.1-a1.el5.noarch.rpm RPM. The Requires link lists the requirements for the python-ZSI-2.1-a1.el5.noarch.rpm RPM. The Provides link lists what the python-ZSI-2.1-a1.el5.noarch.rpm RPM provides, i.e. python-ZSI. The Obsoletes link lists what application(s) the python-ZSI-2.1-a1.el5.noarch.rpm RPM obsoletes. The Conflicts link lists the conflicts for the python-ZSI-2.1-a1.el5.noarch.rpm RPM. 
 
In the Oracle VM Manager Command Line Interface Download section we visted ULN and downloaded the ovmcli and python-ZSI RPM. In the next section we will walk through the installation and configuration of the Oracle VM Manager Command Line Interface. 

Oracle VM Manager Command Line Interface Installation & Configuration

In the Oracle VM Manager Command Line Interface installation and configuration section we will first walk through the Oracle VM Manager Command Line Interface installation followed by the Oracle VM Manager Command Line Interface configuration.
 
The Oracle VM Manager Command Line Interface installation is a quick and simple process that requires two RPMs, a) ovmcli and b) python-ZSI. As soon as you have downloaded both RPMs and a) placed them on the host or b) mounted a share with the RPMs you can install the Command Line Interface RPMs by running “rpm –Uvh ovmcli-1.0-1.el5.noarch.rpm python-ZSI-2.1-a1.el5.noarch.rpm” on the Enterprise Linux host as root.
 
Table 6 shows a successful Oracle VM Manager Command Line Interface installation.
# rpm -Uvh ovmcli-1.0-1.el5.noarch.rpm python-ZSI-2.1-a1.el5.noarch.rpm
Preparing...                ########################################### [100%]
   1:python-ZSI             ########################################### [ 50%]
   2:ovmcli                 ########################################### [100%]
#
Once you have installed the Oracle VM Manager Command Line Interface you can configure the Oracle VM Manager Command Line Interface by running "ovm config" as root.  The Oracle VM Manager Command Line Interface configuration will ask for the following five pieces of information as shown in List 10.
  1. Oracle VM Manager hostname
  2. Oracle VM Manager port number (the default is 8888)
  3. Deploy path (use the default)
  4. Location of vncviewer (required for vncviewer command, e.g. /usr/bin/vncviewer – i.e. run ”which vncviewer” to find the path to vncviewer)
  5. Enable or disable HTTPS support (depends on Oracle VM Manager setup)
 The next example shows a complete "ovm config" session.
# ovm config
This is a wizard for configuring the Oracle VM Manager Command Line Interface.
CTRL-C to exit.
Oracle VM Manager hostname: ovm1.sf.seo.com
Oracle VM Manager port number: 8888
Deploy path (leave blank for default):
Location of vncviewer (leave blank to skip): /usr/bin/vncviewer
Enable HTTPS support? (Y/n): n
Configuration complete.
Please rerun the Oracle VM Manager Command Line Interface.
#
You have successfully configured the Oracle VM Manager Command Line Interface. The Oracle VM Manager Command Line Interface is now ready for use and can be accessed from local or remote console by typing "ovm". 
 
The next section introduces how to use the Oracle VM Manager Command Line Interface starting with a single command, then a bulk command and concluding with batch script examples. 

Oracle VM Manager Command Line Interface Command Examples

This section will start with an introduction to using the Oracle VM Manager Command Line Interface. After the Oracle VM Manager Command Line Interface introduction we will walk through various example Oracle VM Manager Command Line Interface use cases starting with single operation command followed by bulk commands and batch scripting examples.
 
The Oracle VM Manager Command Line Interface can be accessed from the local or remote console from the server hosting the Oracle VM Manager Command Line Interface. Commands can be executed directly from the command line or from within the Oracle VM Manager Command Line Interface shell.
 
The Oracle VM Manager Command Line Interface shell can be accessed by typing “ovm –u username –p your_password shell” as shown in the following example:
# ovm -u username -p password shell
ovm>
You would substitute username with a valid Oracle VM Manager user name and substitute password with a valid password to authenticate into the shell.
 
Once you have successfully authenticated in to the Oracle VM Manager Command Line Interface shell you will be presented with the “ovm>” prompt. From the “ovm>” prompt you can enter the desired subcommands. From the Oracle VM Manager Command Line Interface shell, type “ovm help”, to display an abbreviated list of the help messages, as shown below.
ovm> help
Usage: subcommand [suboptions]
 
Oracle VM Manager Command Line Interface
 
Subcommands:
 
group             ---   Group management
img               ---   Virtual machine image management
iso               ---   ISO image management
sd                ---   Shared virtual disk management
svr               ---   Server management
svrp              ---   Server pool management
tmpl              ---   Virtual machine template management
user              ---   User management
val               ---   System parameter management
vm                ---   Virtual machine management
config            ---   CLI configuration
connect           ---   Connect to Oracle VM Manager from CLI shell
exit              ---   Exit
help              ---   Show help
shell             ---   Launch an interactive shell
use               ---   Specify a server pool to use
vncviewer         ---   Start a VNC console
 
"help <subcommand>" displays help message for that subcommand.
"help all" displays complete list of subcommands.
 
ovm>
Tip: Help messages for subcommands, i.e. "help <subcommand>" will display the help message for that subcommand. The "help all" command displays a complete list of all the subcommands.
 
Subcommands can also be run directly from the command line outside of the Oracle VM Manager Command Line Interface shell. The next example shows how to display the help message from the command line, not from the Oracle VM Manager Command Line Interface shell.
# ovm -u username -p password help
Usage: ovm [options] subcommand [suboptions]
 
Oracle VM Manager Command Line Interface
 
Subcommands:
 
group             ---   Group management
img               ---   Virtual machine image management
iso               ---   ISO image management
sd                ---   Shared virtual disk management
svr               ---   Server management
svrp              ---   Server pool management
tmpl              ---   Virtual machine template management
user              ---   User management
val               ---   System parameter management
vm                ---   Virtual machine management
config            ---   CLI configuration
connect           ---   Connect to Oracle VM Manager from CLI shell
exit              ---   Exit
help              ---   Show help
shell             ---   Launch an interactive shell
use               ---   Specify a server pool to use
vncviewer         ---   Start a VNC console
#
To recap, subcommands can be entered from the Oracle VM Manager Command Line Interface shell or directly from the server’s console. Table 3 shows the same “help” command run from the Oracle VM Manager Command Line Interface shell and from the Oracle VM Manager Command Line Interface server’s console.
Command Line Interface shell
Server console
# ovm -u username -p password shell
ovm> help
# ovm -u username -p password help

Bulk Commands and Batch Scripting

In this section, we will start with an introduction to Oracle VM Manager Command Line Interface bulk commands and batch scripting. After the introduction, we will walk through two Oracle VM Manager Command Line Interface use case examples. The first use case will show how to suspend and then resume four guests, to accommodate a backup schedule. The last example will show how to add an Oracle VM server to an existing server pool.
 
Note: We will be adding new example Oracle VM Manager Command Line Interface use cases to this chapter on a regular basis. Stay tuned!
 
Bulk commands can be run from the command line or via batch scripts. For example, if you wanted to suspend multiple guests with a single command i.e. “vm suspend”, this could be accomplished by typing multiple “vm suspend” commands separated by a semi-colon.
 
Before we execute our fist “vm suspend” bulk command, lets check the status of our virtual machines using the “vm ls” command. The “vm ls” command can be entered from the Oracle VM Manager Command Line Interface shell or directly from the console.
 
The next example shows the “vm ls” command entered at the server console which will list the status of all of the virtual machines in your Oracle VM server farm.
# ovm -u admin -p password vm ls
Name                  Size(MB) Mem VCPUs Status      Server_Pool
node4                     13313    256       1      Running     SF-HQ
node1                     13313    256       1      Running     SF-HQ
node3                     13313    256       1      Running     SF-HQ
node2                     13313    256       1      Running     SF-HQ
The same command can be executed from the Oracle VM Manager Command Line Interface shell as shown in the next example.
# ovm -u admin -p password shell
Type "help" for a list of commands.
ovm> vm ls
Name                  Size(MB) Mem VCPUs Status      Server_Pool
node4                     13313    256       1      Running     SF-HQ
node1                     13313    256       1      Running     SF-HQ
node3                     13313    256       1      Running     SF-HQ
node2                     13313    256       1      Running     SF-HQ
ovm>
Now that we have checked that status of the guests in our Oracle VM farm we will suspend four “Running” guests named node1, node2, node3, and node4 with a single bulk command. Enter the bulk command from the command line, not the Oracle VM Manager Command Line Interface shell to suspend all four guests as shown in the next example.
# ovm -u admin -p password vm suspend -s serverpool_name -n node1; ovm -u admin -p password vm suspend -s serverpool_name -n node2; ovm -u admin -p password vm suspend -s serverpool_name -n node3; ovm -u admin -p password vm suspend -s serverpool_name -n node4
Suspending.
Suspending.
Suspending.
Suspending.
#
The above example shows four separate “vm suspend” commands separated by a semi-colon. You would replace the password, serverpool_name and hostnames with yours to use this bulk command example in your environment.
 
Tip: The help message for “vm suspend” can be displayed by typing “ovm -u admin -p password help vm suspend” or from the shell by typing “help vm suspend”.
 
Let’s validate that the status of the four virtual machines has changed, from “Running” to “Suspended”, by typing “ovm -u admin -p password vm ls” from the server console, as shown in the next example.
# ovm -u admin -p password vm ls
Name        Size(MB) Mem VCPUs Status      Server_Pool
node4            13313    256 1     Suspended   SF-HQ
node1            13313    256 1     Suspended   SF-HQ
node3            13313    256 1     Suspended   SF-HQ
node2            13313    256 1     Suspended   SF-HQ
The above “vm ls” example validated that our “vm suspend” bulk command was successfully completed.
 
Next we will review how to create a vmsuspend batch script. If you would like to test the vmsuspend batch script, you will need to resume your suspended guest. We will cover how to resume your guests in great detail in a couple of paragraphs. If you need to resume your guests to test our next example vmsuspend batch script, please run the following bulk command from the server console.
# ovm -u admin -p password vm resume -s serverpool_name -n node1; ovm -u admin -p password vm resume -s serverpool_name -n node2; ovm -u admin -p password vm resume -s serverpool_name -n node3; ovm -u admin -p password vm resume -s serverpool_name -n node4
Resuming.
Resuming.
Resuming.
Resuming.
#
The same “vm suspend” bulk command could be run as a batch script. The commands in an Oracle VM Manager Command Line Interface batch script are executed in sequence, identical to how sqlplus runs a sql script. There is no error handling with Oracle VM Manager Command Line Interface batch scripts which means when the previous command finishes, regardless of success or failure, the next command will run.
 
The first step to create an Oracle VM Manager Command Line Interface batch script is to create a file. Let’s call the example file vmsuspend. Save the example commands shown below in the vmsuspend file.
 
vm suspend -s serverpool_name -n node1;
vm suspend -s serverpool_name -n node2;
vm suspend -s serverpool_name -n node3;
vm suspend -s serverpool_name -n node4;
 
Now that we have created the file vmsuspend, we can run the vmsuspend file as a batch script in one of two ways; this assumes that the vmsuspend file is located in the current working directory, i.e. /home/user/vmsuspend. You can run the batch script from the server console or from the Oracle VM Manager Command Line Interface shell.
 
The next example shows how to run our example vmsuspend batch script from the server console. 
# ovm shell -s vmsuspend
Login: admin
Password:
Suspending.
Suspending.
Suspending.
Suspending.
#
The above example runs our batch script from the servers console using the “-s” or script option. As shown in the example, it is necessary to authenticate into the shell to run the vmsuspend batch script. Once the script completes you are dropped back to the server console.
 
Our other option to run the vmsuspend batch script is from the Oracle VM Manager Command Line Interface shell. The next example shows how to run the vmsuspend batch script from the Oracle VM Manager Command Line Interface shell. The example assumes that the vmsuspend file is located in the current working directory, i.e. /home/user/vmsuspend.
# ovm -u admin -p password shell
ovm> @vmsuspend
Suspending.
Suspending.
Suspending.
Suspending.
ovm>
The above example runs our batch script from the Oracle VM Manager Command Line Interface shell. Once the script completes, you are dropped back to the Oracle VM Manager Command Line Interface shell prompt.
 
Let’s validate the status of the four virtual machines by typing “vm ls” from the Oracle VM Manager Command Line Interface shell as shown on the next example.
# ovm> vm ls
Name        Size(MB) Mem VCPUs Status      Server_Pool
node4            13313    256 1     Suspended   SF-HQ
node1            13313    256 1     Suspended   SF-HQ
node3            13313    256 1     Suspended   SF-HQ
node2            13313    256 1     Suspended   SF-HQ
Typing “vm ls” from the Oracle VM Manager Command Line Interface shell validated that our previous vmsuspend batch script did successfully run and suspend all four of the guests. You can also list the status of your virtual machines from the server console, as shown in the next example.
# ovm -u admin -p password vm ls
Name        Size(MB) Mem VCPUs Status      Server_Pool
node4            13313    256 1     Suspended   SF-HQ
node1            13313    256 1     Suspended   SF-HQ
node3            13313    256 1     Suspended   SF-HQ
node2            13313    256 1     Suspended   SF-HQ
Now that we have reviewed running a “vm suspend” bulk command and a vmsuspend batch script along with “vm ls”, let’s examine how to resume our guests. First we will review a “vm resume” bulk command, followed with a vmresume batch script.
 
Next, we will resume four “Suspended” guests named node1, node2, node3, and node4 with a single bulk command. Enter the bulk command from the command line, not the Oracle VM Manager Command Line Interface shell, to resume all four guests as shown in the next example.
# ovm -u admin -p password vm resume -s serverpool_name -n node1; ovm -u admin -p password vm resume -s serverpool_name -n node2; ovm -u admin -p password vm resume -s serverpool_name -n node3; ovm -u admin -p password vm resume -s serverpool_name -n node4
Resuming.
Resuming.
Resuming.
Resuming.
#
You can validate the status of the four virtual machines by typing “ovm -u admin -p password vm ls” from the server console or “vm ls” from the Oracle VM Manager Command Line Interface shell.
 
The same “vm resume” bulk command could be run as a batch script. As discussed in the “vm suspend” section the commands in an Oracle VM Manager Command Line Interface batch script are executed in sequence, identical to how sqlplus runs a sql script. There is no error handling with Oracle VM Manager Command Line Interface batch scripts which means when the previous command finishes, regardless of success or fail, the next command will run.
 
The first step to create our example “vm resume” Oracle VM Manager Command Line Interface batch script, is to create a file. Let’s call the example file vmresume. Save the example commands shown below in the vmsuspend file.
 
vm resume -s serverpool_name -n node1;
vm resume -s serverpool_name -n node2;
vm resume -s serverpool_name -n node3;
vm resume -s serverpool_name -n node4;
 
Now that we have created the file vmresume, we can run the vmreseume file as a batch script in one of two ways; this assumes that the vmreseume file is located in the current working directory, i.e. /home/user/vmresume. You can run the batch script from the server console or from the Oracle VM Manager Command Line Interface shell.
 
The next example shows how to run our example vmresume batch script from the server console. 
# ovm shell -s vmresume
Login: admin
Password:
Resuming.
Resuming.
Resuming.
Resuming.
#
The above example runs our batch script from the servers console using the “-s” or script option. As shown in the example it is necessary to authenticate into the shell to run the vmsuspend batch script. Once the script completes, you are dropped back to the server console.
 
Our other option to run the vmresume batch script is from the Oracle VM Manager Command Line Interface shell. The next example shows how to run the vmresume batch script from the Oracle VM Manager Command Line Interface shell. The example assumes that the vmresume file is located in the current working directory, i.e. /home/user/vmresume.
# ovm -u admin -p password shell
ovm> @vmresume
Resuming.
Resuming.
Resuming.
Resuming.
ovm>
The above example runs our batch script from the Oracle VM Manager Command Line Interface shell. Once the script completes, you are dropped back to the Oracle VM Manager Command Line Interface shell prompt.
 
You can validate the status of the four virtual machines by typing “ovm -u admin -p password vm ls” from the console or “vm ls” from the Oracle VM Manager Command Line Interface shell.
 
We have just completed our review of the “vm suspend” and “vm resume” bulk command and batch scripting. The next example expands from our previous “vm suspend” and “vm resume” with a detailed use case called Guest Backup. The Guest Backup use case will use a batch script that suspends four guests, pauses for 120 seconds and then resumes the guests to accommodate an Oracle VM repository scheduled backup job.

Guest Backup

Our first example use case “Guest Backup”, builds upon what we learned in the previous section with regards to the vm suspend and vm resume examples. The use case shows us how to create a batch script to suspend four guests, pause for 120 seconds and then resume the guests to accommodate a scheduled snapshots/cloning of an Oracle VM extended repository.
 
There are numerous strategies to back up Oracle VM guests. For example, you can use the same agent based backup solution you have always used for your physical machines or you could leverage the snapshots/cloning functionality from your storage solution. Our goal, with the Guest Backup use case, is to provide an Oracle VM Manager Command Line Interface solution to work with the snapshots/cloning functionality from your existing storage.
 
To capture a clean snapshot or backup of a running guest, the guest should be in the suspended state when the snapshot or backup job is executed. When a guest is suspended, the status of the guest operating system is written to disk and removed from system memory. Conversely, when a guest operating system is paused, the system state continues to reside in memory. For the Guest Backup use case we will use the “vm suspend” and “vm resume” commands to ensure that the status of the guest operating system is written to disk and removed from system memory for the duration of the snapshot or backup job.
 
Prerequisites:
  • A storage solution that supports snapshots or cloning.
  • Our example batch script named vmbackup will be scheduled to run each night at 3:00 AM as a cron job.
  • The vmbackup job will run 2 minutes before the scheduled snapshot or clone job.
  • The target guests are in the Running state.
 
List 11 shows the work flow to execute the Guest Backup use case.
  1. Create the vmbackup batch script
  2. Test the vmbackup batch script
  3. Automate the vmbackup batch script with cron.
 
1- The first step is to create an Oracle VM Manager Command Line Interface batch script on the machine hosting the Oracle VM Manager Command Line Interface. Let’s create a file named vmbackup. Save the example commands shown below in the vmbackup file.
 
vm suspend -s serverpool_name -n node1;
vm suspend -s serverpool_name -n node2;
vm suspend -s serverpool_name -n node3;
vm suspend -s serverpool_name -n node4;
sleep 120;
vm resume -s serverpool_name -n node1;
vm resume -s serverpool_name -n node2;
vm resume -s serverpool_name -n node3;
vm resume -s serverpool_name -n node4;
 
2- Next we will test the example vmbackup batch script from the server console, as shown in the example. 
# ovm -u admin -p password shell -s vmbackup
Suspending.
Suspending.
Suspending.
Suspending.
Sleeping for 120 seconds
Resuming.
Resuming.
Resuming.
Resuming.
#
 3- The final step is to automate the vmbackup batch script to run at 3:00 AM every day with cron, as shown in the example.
# crontab –e
* 3 * * * ovm -u admin -p password shell -s vmbackup
:wq!
#
We have just completed our first use case that showed us how to create a batch script to suspend four guests, pause for 120 seconds, and then resume the guests to accommodate a scheduled snapshot or backup job of an Oracle VM extended repository.
 

Create a Server Pool

The next example batch script shows how to create a server pool.
vm ls;
svrp ls;
svrp new -H ovstest19.cn.test.com --serverpool_name=ovstest19 -a -A oracle -U root -P password -L BJ -D "ovstest19 serverpool";
use -s ovstest19;
svrp info;
sleep 10;
svrp status;
svr ls;

Programming with the Oracle VM Manager Command Line Interface

This section will provide an example of a more advanced method of programming with the Oracle VM Manager Command Line Interface commands.
 
You can program Oracle VM Manager Command Line Interface commands to determine whether a command is successfully executed or not. You’re also able to get the return result of commands in a programming friendly way.
 
The following example script will a) Create a serverpool b) Register all the discoverable ISOs c) Create a hvm guest by one of the ISOs and d) Check the status of the guest created, if the status is "Running", then power off the guest.
from ovmcli.Ovm import Ovm
from ovmcli.errorcode import *
import time
 
ovm = Ovm(username='admin', password='oracle')
_ = ovm.runcmd
 
serverpool_name = "ovstest19"
vm_name = "hvmbyiso1"
server_ip = "ovstest19.cn.oracle.com"
# Delete a serverpool
if OVM_OK == _("svrp del -s %s --force" % serverpool_name):
    print "OK serverpool_del"
 
# Create a serverpool
cmd = 'svrp new -H %s --serverpool_name=%s -a -A oracle -U root -P oracle -L BJ ' % (server_ip, serverpool_name)
if OVM_OK == _(cmd):
    print "OK serverpool_create"
 
# Discover and Register ISOs
discoverable_isos = _("iso disc -s %s" % serverpool_name)
for iso in discoverable_isos:
    cmd = "iso reg -s %s -g el51 -l %s" % (serverpool_name, iso)
    if OVM_OK == _(cmd):
        print "OK iso reg %s" % iso
 
isos = _("iso ls -s %s" % serverpool_name)
 
iso = isos[0][1]
 
# Create a VM
cmd = 'vm new --method=iso -x -s %s -n %s -c 1 -i %s -o Other -y 512 -d 1024' % (serverpool_name, vm_name, iso)
if OVM_OK == _(cmd):
    print "OK vm new"
 
 
while 1:
    cmd = "vm status -s %s -n %s" % (serverpool_name, vm_name)
    status = _(cmd)
    if type(status) == type([]):
        vm_status = status[0]
        if vm_status != 'Running':
            print "vm_status:" + vm_status
            print "sleep 10s"
            time.sleep(10)
        else:
            print vm_status
            cmd = 'vm poweroff -s %s -n %s' % (serverpool_name, vm_name)
            if OVM_OK == _(cmd):
                print "OK poweroff"
            break
 

 

view counter