Using APIs and command line options to manage, protect, or recover RHV virtual machines
This topic lists the APIs and command line options to protect or recover the Red Hat Virtualization virtual machines. Only the important variables and options are mentioned in this topic.
Following sections are part of this topic:
For detailed information on the APIs and command lines, use these references:
Add the RHV manager credentials
Table: Add the RHV manager credentials
API or command line options | Important variables and options |
---|
POST
/netbackup/config/servers/vmservers | |
tpconfig command | |
Validate the RHV manager credentials
Table: Validate the RHV manager credentials
API or command line options | Important variables and options |
---|
POST
/netbackup/config/servers/vmservers/
{serverName}/validate-credential
| |
Create an RHV VM backup policy
Table: Create an RHV VM backup policy
API or command line options | Important variables and options |
---|
POST
/netbackup/config/policies/
| policyType is Hypervisor backuphost is a whitelisted Windows or Linux host. snapshotMethodArgs can have the following values to back up a VM using VM UUID: application_consistent=1
Virtual_machine_backup=1
nameuse=2 (catalog uses VM UUID)
file_system_optimization=1
exclude_swap=1 In backupSelections > selections, use the filter option as "rhv:/?filter=Displayname Contains <name_filter>" to filter RHV VMs of a specific name. Apart from Displayname , you can use the other filter criteria mentioned for Intelligent VM groups.
|
admincmd command | In bpplclients -add <discoveryhost> Hypervisor Hypervisor,
the hypervisor discovery host is a whitelisted Windows or Linux host. In bpplinfo, the policy type (-pt) is Hypervisor. In bpplinclude, use the filter option as "rhv:/?filter=Displayname Contains <name_filter>" to filter RHV VMs of a specific name. In bpplinfo For optimized backup, you can use: file_system_optimization=1
exclude_swap=1
|
After you create the policy, other commands like creating the schedule for the policy or triggering the policy backup remain the same. For more information about the commands, refer to the NetBackup Commands Reference Guide.
Restore the RHV VM at the original location
Table: Restore the RHV VM at the original location
API or command line options | Important variables and options |
---|
POST
/netbackup/recovery/workloads/rhv/
scenarios/full-vm/recover
| client is the VM identifier of the protected VM. The VM identifier is the VM UUID.
recoveryHost is a whitelisted Windows or Linux host. Set the following values: defaultVmDiskProvisioning
powerOnAfterRecovery
overwriteExistingVm
removeNetworkInterfaces
retainVmGuid
removeTagAssociations
|
bprestore command | vmproxy is a whitelisted Windows or Linux backup host. vmserver is the name of the RHV manager. vmhypervisor specifies restore from the Hypervisor policy type Use the following values to modify the VM configuration: vmst to remove the VM tags. vmpoweron to start the VM after the VM restore. vmsn to remove the VMs network interfaces. vmid to retain the original VM UUID of the VM. Alternatively, use the -K option to retain the existing VM with the same UUID and not overwrite it. thickdisk to configure the restored virtual disks in the thick format. The virtual disk space is allocated when the disk is created. thindisk to configure the restored virtual disks in the thin format. The populated blocks are restored but the vacant blocks are not initialized or committed.
|
Restore the RHV VM to an alternate location
Table: Restore the RHV VM to an alternate location
API or command line options | Important variables and options |
---|
POST
/netbackup/recovery/workloads/rhv/
scenarios/full-vm/recover
| client is the VM name of the protected VM. The VM name can either be the display name (displayName) or the UUID. rhvServer is the name of the alternate RHV manager.
recoveryHost is a whitelisted Windows or Linux host. vmhypervisor specifies restore from the Hypervisor policy type Set the following values: defaultVmDiskProvisioning
powerOnAfterRecovery
overwriteExistingVm
removeNetworkInterfaces
retainVmGuid
removeTagAssociations
|
bprestore command | vmproxy is a whitelisted Windows or Linux backup host.
vmserver is the name of the RHV manager. Use the following values to modify the VM configuration: vmst to remove the VM tags. vmpoweron to start the VM after the VM restore. vmsn to remove the VMs network interfaces. vmid to retain the original VM UUID of the VM. Alternatively, use the -K option to retain the existing VM with the same UUID and not overwrite it.
The -R option defines the path of the rename file. Use the rename file to recover the VM to an alternate location or change the VM configuration. Sample rename file: change vmname to new_vm_name
change /storage_domain_1/disk1_UUID
to /storage_domain_2/
change /storage_domain_1/disk2_UUID
to /storage_domain_2/
change cluster to new_cluster_name
For a Windows NetBackup host, you must add an empty line at the end of the rename file entries. See Additional information about the rename file. |