Ovm BKP Userguide v1
Ovm BKP Userguide v1
Ovm BKP Userguide v1
4 Backup Utilities
Installation and User Guide
| FEBRUARY 2019
Disclaimer
The following is intended to outline our general product direction. It is intended for information
purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any
material, code, or functionality, and should not be relied upon in making purchasing decisions. The
development, release, and timing of any features or functionality described for Oracle’s products
remains at the sole discretion of Oracle.
Disclaimer 1
Summary 1
Oracle VM Manager 1
Assumptions 1
Solution Architecture 2
ovm-backup.sh 8
ovm-delete.sh 11
ovm-listbackup.sh 12
ovm-preserve.sh 13
ovm-restore.sh 14
Oracle VM is a platform that provides a fully equipped environment that enables you to leverage the benefits of
virtualization technology and enables you to deploy operating systems and application software within a supported
virtualization environment.
Oracle VM enables rapid enterprise application deployment, such as Oracle Database, Middleware, and
Applications as well as many non-Oracle applications.
Oracle VM supports Oracle Linux, Microsoft Windows, Oracle Solaris, and many other Linux distributions.
Oracle VM Manager
Oracle VM Manager is an application that allows you to configure and manage your Oracle VM environment. Oracle
VM Manager includes both a command line interface and a web-based user interface, which is a standard
Application Development Framework (ADF) web application. Oracle VM Manager provides virtual machine
management facilities, including creating virtual machines from installation media or from templates. It provides
features such as power on, power off, deleting, importing, deploying, and live migration of virtual machines. Oracle
VM Manager also manages resources, including ISO files, virtual machine templates, and shared virtual disks.
For further details about Oracle VM Server and Oracle VM Manager, see the Oracle VM 3.4 documentation Library.
Assumptions
Oracle VM 3.4 Backup Utilities for Virtual Machines have following requirements:
• "ovm-bkp" Backup Utilities have to be installed on Oracle VM Manager machine; no other option is
actually supported.
• “ovm-bkp” properly works on environments where resources do not contain spaces in their names:
• Running Virtual Machines backups can be taken only if virtual-disks reside on OCFS2 repositories (iSCSI
and Fiber Channel storage); Virtual Machines running on NFS repositories have to be stopped.
• Backup obtained from a running Virtual Machine is always a crash-consistent backup of the running vm.
• If the Virtual Machine also owns physical-disks, the backup taken will contain only virtual-disks and so, a
manual intervention may be required to have it correctly restored and consequently booted.
• Having a dedicated NFS repository for Virtual Machines backups is strongly suggested; OCFS2 repository
can be used and possibly also shared to external systems by "Repository Exports" feature.
Solution Architecture
Target of the ovm-bkp utilities is to get a crash-consistent backup of a running Virtual Machine and, between the
others, give the option to get this backup shared to external systems like Storages or Media Server.
As shown in the picture below, thanks to the utility, so, you can get a real backup of your Virtual Machines and
constantly share the same to your media server:
All the backup operations will be executed starting from Oracle VM Manager machine managing the Oracle VM
Pool(s); the entire solution is based on scripts and Oracle VM CLI interface.
On the picture above operations like "Replicas by NDMP" or "Backup to Media Server" have to be managed by
your own existing solution; "ovm-bkp" utilities will manage backups taken and saved on the dedicated "NFS
Repository".
• “ovm-setup-vm.sh” now includes the option to configure virtual-disk exclusion for VM backups
• openssl.x86_64 : Utilities from the general purpose cryptography library with TLS implementation
"ovm-bkp" uses the Oracle VM CLI (Command Line Interface) to execute operations on Oracle VM
Pool(s)/Server(s) so following Oracle VM Manager Linux services have to be enabled and running:
• ovmm_mysql
• ovmm
• ovmcli
• http://www.oracle.com/technetwork/server-storage/vm/downloads/ovm-tools-3604795.html
Once downloaded, please copy this RPM on your Oracle VM Manager machine and, by "Yum", execute following
command:
Yum will take care of missing dependencies and will install everything required to get "ovm-bkp" correctly installed.
Example:
Dependencies Resolved
===============================================================================
================
Package Arch Version Repository Size
===============================================================================
Transaction Summary
===============================================================================
=================
Install 1 Package (+2 Dependent packages)
Installed:
ovm-bkp.noarch 0:1.0-20180208
Dependency Installed:
expect.x86_64 0:5.45-14.el7_1 nmap-ncat.x86_64 2:6.40-7.el7
Complete!
Once the RPM has been installed on Oracle VM Manager system, you can proceed to configure the Oracle VM
Manager access for "ovm-bkp" utilities.
# cd /opt/ovm-bkp/bin
# ./ovm-setup-ovmm.sh
This script will proceed to configure the ssh-key exchange required to get all the "ovm-bkp" scripts working with
Oracle VM CLI without the need to supply any password; the same script will create a configuration file dedicated to
Example:
To get a backup configured you have to execute the "ovm-setup-vm.sh" script for each Virtual Machine; this script
is required before executing a backup for a Virtual Machine.
This script will create a dedicated configuration file for each Virtual Machine with following information:
• retention: Backup retention for the Virtual Machine; retention can be time-based or redundancy-based
• disktoexclude: Disk slots that have to be excluded while executing the backup
Example:
# Oracle VM Pool
ovmpool=it-pool
# VM Details
vmname=ol4_hvmpv
vmuuid=0004fb00000600005e4ec501b59878c4
vdiskstoexclude=3,5
# Retention to Apply
retention=4c
# Target Repository
targetrepo=it-nfs-backup
"ovm-setup-vm.sh" has to be executed for each Virtual Machine you want to manage backups with "ovm-bkp"
utilities.
Existing VM configuration files can be edited to add the “vdisktoexclude” option or recreated by re-executing the
“ovm-setup-vm.sh” binary.
Disk slots can be easily identified by using the Oracle VM Manager UI:
• common.sh
• ovm-backup.sh
• ovm-delete.sh
• ovm-listbackup.sh
• ovm-preserve.sh
• ovm-restore.sh
• common.sh
"common.sh" script does not have to be executed; this script only contains different functions that are used by other
scripts part of the tool.
ovm-backup.sh
"ovm-backup.sh" script is the real executor of Virtual Machines backups; by executing the script without any option
you can get information required:
###############################################################################
You have to specify <guest id> or <guest name>:
Use ovm-backup.sh <guest name> <backup type> <preserve>
<backup_type> options are (no case-sensitive):
- FULL => ovm-backup will create a full vdisk backup on a further repository
- SNAP => ovm-backup will create an ocfs2 reference-link snapshot of the vm on
the same repository
- OVA => ovm-backup will create a packaged OVA file on a further repository -
available only from 3.4
Example:
ovm-backup.sh vmdb01 FULL Y
ovm-backup.sh vmdb01 SNAP n
ovm-backup.sh vmdb01 OVA N
###############################################################################
• "guest name": name of the Virtual Machine you want to get backup
o FULL: the backup will be a full sparse copy of the virtual machine configuration file and all virtual
disks saved to the Oracle VM repository specified into the Virtual Machine configuration file (see
"ovm-setup-vm.sh")
o SNAP: the backup will be a copy of the virtual machine configuration file and an OCFS2 reflink of
all virtual disks; the backup will remain on same repository as source Virtual Machine
• "preserve": this option allows to declare a backup as "preserved"; a preserved backup will be ignored by
the retention policy applied and so "preserved".
All other information, required to get the virtual machine backup, will be picked up from the configuration file created
by "ovm-setup-vm.sh"
Example:
======================================================
=======>> GUEST BACKUP EXPIRED AND REMOVED: <<========
======================================================
=============================================================
Based on retention policy any guest backup will be deleted!!!
=============================================================
=====> Backup available for guest ca-osbovm (sorted by date) :
<====================
===============================================================================
==============
= BACKUP TYPE == BACKUP DATE == BACKUP TIME == BACKUP NAME == PRESERVED ==
===============================================================================
1. Collect all the information required: Virtual Machine name, id and configuration.
2. Create a dedicated "Clone Customizer" based on the info of the Virtual Machine.
3. Create a clone of the Virtual Machine on the same ocfs2 repository ( using ocfs2-reference-link ) where it
excludes possible physical disks associated to the Virtual Machine.
o If the "backup type" declared is "FULL" then it moves the cloned Virtual Machine to the target
Oracle VM Repository ( that could be NFS and/or OCFS2 ) reported into the configuration file.
o If the "backup type" declared is "OVA" then it creates an OVA file - starting from the clone taken
on step (3) - and saves it to the target Oracle VM Repository reported into the configuration file.
4. Move the cloned Virtual Machine under folder "Unassigned Virtual Machine" on Oracle VM Manager
o All "SNAP" and "FULL" backups will be displayed under "Unassigned Virtual Machines"
to get the complete list of backups available see "ovm-listbackup.sh" script on this document.
• Apply retention policy declared into the configuration file and proceed to delete obsolete backups that are
not "preserved".
• are running
• own vNic(s)
ovm-delete.sh
####################################################
Use ovm-delete.sh <backup name>
Example:
ovm-delete.sh vmdb01-FULL-20170824
ovm-delete.sh vmdb01-SNAP-20170629
ovm-delete.sh vmdb01-OVA-20170529
####################################################
So, by this script you can force the deletion of a specific Virtual Machine backup (preserved or not).
Example:
ovm-listbackup.sh
#############################################
Use ovm-listbackup.sh <vm name>
Example:
ovm-listbackup.sh vmdb01
#############################################
So, by this script you can evaluate all the backups available for a specific Virtual Machine ordered by date;
information available are:
• Backup Name (that reflects the Virtual Machine name for Oracle VM)
• Preserved (Y/N)
Example:
ovm-preserve.sh
"ovm-preserve.sh" script is dedicated to change the "Preserve" option for a specific Virtual Machine backup.
#####################################################
Use ovm-preserve.sh <backup name> <preserve>
Example:
ovm-preserve.sh vmdb01-FULL-20170824 Y
ovm-preserve.sh vmdb01-SNAP-20170629 n
ovm-preserve.sh vmdb01-OVA-20170529 N
#####################################################
By this script you can change the "Preserve" option for an existing backup, where:
• Preserve=n means that the backup will be treated by the retention policy and if obsolete will be according
deleted.
Example:
ovm-restore.sh
#################################################
Use ovm-restore.sh <guest name>
Example:
ovm-restore.sh vmdb01
#################################################
o On this step a list of backups will be displayed; by the number associated you have the option to
decide which backup will be picked-up.
o On the example below you have so supply (1) to get backup named "ca-osbovm-FULL-
20170801-0105" or (2) to get backup named "ca-osbovm-OVA-20170828-2002".
o On this step a list of Oracle VM Pool(s) will be displayed; to get a specific Oracle VM Pool
showed up on this step you need, at least, one Oracle VM Server (part of the pool) that mounts
the Oracle VM Repository where the backup resides; consider that an Oracle VM Repository can
be shared between more Oracle VM Pools only if it's of NFS type.
1
============================================================
===================================================================
Here you can see the Oracle VM Pool(s) with the backup available
If you want to see other Oracle VM Pool(s) you should present the
backup repository ca-nfs-backup to at least one server of those Pools.
Please consider that only NFS Repositories can be presented to
different Oracle VM Pool(s) at the same time.
Please choose the Oracle VM Pool where to restore ca-osbovm-FULL-20170801-0105:
==================================================================
=======================================================
1) ca-pool
=======================================================
Choice:
o On this step a list of Oracle VM repositories will be displayed; the script will also check the free
disk-space required to get the Virtual Machine restored and will propose only the Oracle VM
repositories that can guest the restore.
o If an Oracle VM Repository is available but the free disk-space is not enough, the same won't be
selectable (see "it-nfs-backup" in the example below); at the same time, the Virtual Machine
backup size will be displayed.
1
==================================================================
==================================================================
Refreshing repository - it-nfs-backup - to get updated information...
==================================================================
Refreshing repository - ca-nfs-backup - to get updated information...
==================================================================
Refreshing repository - ca-repo01 - to get updated information...
==================================================================
===================================================================
Here you can see the list of repositories where the restore can be
executed on Oracle VM Pool ca-pool.
Backup ca-osbovm-FULL-20170801-0105 size is equal to 45 GB
*******************************************************************************
****
Consider that following repositories have been excluded due to low free-disk
space:
*******************************************************************************
****
it-nfs-backup - Free 35 GB
*******************************************************************************
****
Please choose the Oracle VM repository where to restore the backup
named ca-osbovm-FULL-20170801-0105:
===================================================================
=======================================================
1) ca-nfs-backup - Free 82 GB 2) ca-repo01 - Free 73 GB
=======================================================
Choice:
• [OPTIONAL] Do you want to keep the same vNICs HWADDR for the restored VM ? (y/n)
o This step is optional; only if the source VM is not more available the script will ask the
confirmation to restore the same vNIC HW-ADDR (MAC Address) on the Virtual Machine
restored.
2
===================================================================
===================================================================
Source VM ca-osbovm was configured with following vNIC(s) and HW-ADDR
vNic 1 on Network-Id 0ad30000 with HW-ADDR 00:21:f6:d5:2f:52
vNic 2 on Network-Id 10e098228f with HW-ADDR 00:21:f6:38:56:12
===================================================================
Do you want to keep the same vNICs HWADDR for the restored VM ? (y/n)
y
==============================================================
==============================================================
Following vNICs will be configured with the source-VM HW-ADDR:
==============================================================
vNic 1 with Hw-Addr 00:21:f6:d5:2f:52
vNic 2 with Hw-Addr 00:21:f6:38:56:12
================================================
At this point the restore process starts; you'll get an update each 10 seconds:
================================================
Creating Clone-Customizer to get VM restored....
================================================
=======================================================
Restoring to target repository ca-repo01....
=======================================================
=======================================================
Waiting for Vm restore to be available......0 seconds
Waiting for Vm restore to be available......10 seconds
Waiting for Vm restore to be available......20 seconds
Waiting for Vm restore to be available......30 seconds
Waiting for Vm restore to be available......40 seconds
Waiting for Vm restore to be available......50 seconds
Waiting for Vm restore to be available......60 seconds
Waiting for Vm restore to be available......70 seconds
Waiting for Vm restore to be available......80 seconds
Waiting for Vm restore to be available......90 seconds
Waiting for Vm restore to be available......100 seconds
• Once the restore process is completed you'll get further information related like:
o If source Virtual Machine owns physical-disks you'll also see which physical-disks were
associated; thanks to this option, by Oracle VM Manager web console or Oracle VM CLI, you'll
get the chance to re-associate physical-disks that were used by the source Virtual Machine.
=======================================================
Deleting temporary CloneCustomizer created......
=======================================================
=======================================================
Addinv vNIC(s) using configuration of the source VM
vNic 1 on Network-Id: 0ad30000
vNic 1 with source Hw-Addr 00:21:f6:d5:2f:52
vNic 2 on Network-Id: 10e098228f
vNic 2 with source Hw-Addr 00:21:f6:38:56:12
=======================================================
=======================================================
Moving Vm ca-osbovm-RESTORE-20180209-1613
to the Oracle VM Pool: ca-pool
• The same restored Virtual Machine, will be also displayed on Oracle VM Manager web-interface:
So the retention can be managed between the two solutions (ovm-bkp Utilities and Tape Library/NDMP) where:
• Low-retention on the NFS allows faster restore for Single Virtual Machine or a list of them
So, this script can be also integrated to further backup solutions that work on Tape Library and/or any other support
type.
CONNEC T WITH US
blogs.oracle.com/oracle
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. This document is provided for information purposes only, and the
contents hereof are subject to change without notice. This document is not warranted to be error-free, nor subject to any other
facebook.com/oracle warranties or conditions, whether expressed orally or implied in law, including implied warranties and conditions of merchantability or
fitness for a particular purpose. We specifically disclaim any liability with respect to this document, and no contractual obligations are
formed either directly or indirectly by this document. This document may not be reproduced or transmitted in any form or by any
twitter.com/oracle means, electronic or mechanical, for any purpose, without our prior written permission.
oracle.com Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and
are trademarks or registered trademarks of SPARC International, Inc. AMD, Opteron, the AMD logo, and the AMD Opteron logo are
trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open Group. 0219