2.4.4 Oracle VM Repository Restore (ovm_reporestore)

The ovm_reporestore utility allows the administrator to easily back up metadata about assemblies, ISO files and virtual disks that are stored in a given storage repository. The resulting XML file can then be used to restore this data to an Oracle VM Manager instance in the case that the repository imported into the Oracle VM Manager afresh. Typical use cases would be for back up and restore or disaster recovery, or alternately where the storage for the repository is moved to an alternate location or to a clone of the environment. The utility works in two modes:

  • A back up mode, where the metadata is dumped to an XML file. Ideally, this should be run as a regular cronjob, so that the data is consistently backed up.

  • A restore mode, where the metadata stored in the XML file is imported into an Oracle VM Manager instance to update the information stored for assemblies, ISO files and virtual disks with matching UUIDs.

Syntax

ovm_reporestore { -u username } { -p password | -E } { -h hostname } { -r repository | -a } [ -f filename.xml ] [ -F OVMModelDump.xml ] [ -y ] [ -D ] [ -R ] [ -N ]

Options

The following table shows the available options for this command.

Option

Description

-u username

The username of an Oracle VM Manager admin user. This option is required.

{ -p password | -E }

The -p option is the password corresponding with the admin username. Alternatively, you can use the -E option to set the password in an environment variable named OVMUTIL_PASS, and securely submit the password. To set this variable for a single session on Oracle Linux, use:

# export OVMUTIL_PASS=password

This option is required.

-h hostname

The hostname of the server running Oracle VM Manager. This option is required.

{ -r repository | -a }

The -r option is the name of the storage repository. Alternatively, you can run the command against all repositories using the -a option. This option is required.

-f filename.xml

The XML file to read or write to.

-F OVMModelDump.xml

Use an Oracle VM Manager model dump XML file as input

-y

Assume yes on restoring a filename and description without prompting.

-D

Dump metadata to a file.

This command is intended to be used in combination with:

-f -r -a

-R

Restore metadata from file.

This command is intended to be used in combination with:

-f -r -a -y

-N

Fix metadata after a refresh without an XML file.

This command is intended to be used in combination with:

-R -r -a

Examples

Example 2.7 Backing up metadata for all repositories to an XML file

This example shows how to dump all of the metadata stored across all repositories to an XML file.

# ./ovm_reporestore -u admin -E -h localhost -D -f /tmp/dump2.xml -a
Oracle VM Repository Repair utility version.
Connected.
Export mode.
Processing repository 'iscsirepo'
->Processing assemblies.
->Processing Virtual ISOs.
->Processing Virtual Disks.
Processing repository 'MyRepository'
->Processing assemblies.
->Processing Virtual ISOs.
->Processing Virtual Disks.
Processing repository 'nfs1'
->Processing assemblies.
->Processing Virtual ISOs.
->Processing Virtual Disks.
Wrote to '/tmp/dump2.xml'
Finished...

Example 2.8 Restoring metadata from data in an XML file

This example shows how to restore the names and descriptions for assemblies, ISOs and virtual disks that have the same UUIDs as those stored in the provided XML file across all repositories. As it is used without the -y option, the user is prompted with the option to update the name and description of each matching item in a repository.

# ./ovm_reporestore -u admin -E -h localhost -R -f /tmp/dump2.xml -a
Oracle VM Repository Repair utility version.
Connected.
Repair mode.
Reading from '/tmp/dump2.xml'
Processing repository 'iscsirepo'
->Processing assemblies.
->Processing Virtual ISOs.
->Processing Virtual Disks.
Processing repository 'MyRepository'
->Processing assemblies.
->Processing Virtual ISOs.
->Processing Virtual Disks.
Processing repository 'nfs1'
->Processing assemblies.
->Processing Virtual ISOs.
->Processing Virtual Disks.
The following element has no name: '0004fb0000120000ea4a4a161bdf8de7.img'
Element found. Name : '0004fb0000120000ea4a4a161bdf8de7.img' Description :  ''
Are you sure you want to modify this entry? [y/N] n
Skipping element.
Finished...