Ransomware attackers specifically target and attempt to destroy backup systems to increase the probability of payment. Hardening your system is critical. Please ensure you have reviewed your platform security using the Security Hardening Checklist
Cohesity

COHESITY Documentation

Explore our documentation to get started, discover products & new features, access troubleshooting guides, register sources, platforms support.

Products
Data Security Alliance
Visit Cohesity.com
Demos
Support
Blogs
Developers
Partner Portals
Cohesity Community
© 2026 Cohesity, Inc. All Rights Reserved.
Terms of Use|
Privacy Policy|
Legal|
  1. Home
  2. NetBackup™ for VMware Administrator's Guide
  3. Appendix A. NetBackup commands to back up and restore virtual machines
  4. Using the nbrestorevm command to restore virtual machines into vSphere
NetBackup™ for VMware Administrator's Guide

Using the nbrestorevm command to restore virtual machines into vSphere

To restore VMs, run the nbrestorevm command on the primary server or recovery host. The command is located in the following directory:

UNIX and Linux:

/usr/openv/netbackup/bin/nbrestorevm

Windows:

install_path\NetBackup\bin\nbrestorevm.exe

The following nbrestorevm options are used in these examples:

  • - vmw

    Required for all VMware virtual machine restores.

  • - C virtual_machine_to_restore

    The VM name must match the type of name that was selected in the Primary VM identifier option of the backup policy. For example, if the VM was backed up by its VM display name, specify the display name on the -C option.

  • -R absolute_path_to_rename_file

    Restores to a different location. The required entries in the rename file depend on the destination for the restore. See each example in this topic. Further notes are available on the rename file.

    See The nbrestorevm -R rename file for restoring virtual machines.

  • -O

    Overwrites the VMs and associated resources if they already exist.

  • - S primary_server

    Specifies the primary server that made the backup (if different from the current primary).

  • -vmserver vCenter_server

    Specifies a different vCenter server for the restore destination.

  • - vmproxy VMware_recovery_host

    Specifies a different VMware recovery host (overrides the default backup host that backed up the VMs).

    Note:

    Storage lifecycle policies (SLPs) can use Auto Image Replication to replicate a virtual machine backup image to another NetBackup domain. To restore the virtual machine from the replicated image, you must include the -vmproxy option. Use -vmproxy to specify the backup host (access host) that is in the domain where the virtual machine was replicated.

  • -vmkeephv

    Retains the hardware version upon recovery.

  • -vmid

    Retains the BIOS UUID of the original virtual machine.

  • -vmInstanceId

    Retains the Instance UUID of the original virtual machine (note that the Instance UUID is a vCenter specific unique identifier of a virtual machine).

  • -vmsn

    Removes the network from the restored VM.

  • -vmvmxd

    Restores the .vmdk files to the vmx datastore (the configuration datastore).

  • -vmpo

    Turns on the VM after the restore.

Following are examples of nbrestorevm, for various restore destinations and options.

A. Restore to the original location and overwrite the VM.

nbrestorevm - vmw - C VM_to_restore - O

B. Restore to the original location, overwrite the VM, and retain the BIOS UUID.

nbrestorevm - vmw - C VM_to_restore - O -vmid

C. Restore to the original location, overwrite the VM, and retain the instance UUID.

nbrestorevm - vmw - C VM_to_restore - O -vmInstanceId

D. Restore to the original location, overwrite the VM, and remove the network.

nbrestorevm - vmw - C VM_to_restore - O - vmsn

E: Restore to the original location from a VM backup that a different primary server made, and overwrite the VM.

nbrestorevm - vmw - C VM_to_restore - S primary_server - O

F: Restore to the original vCenter and ESX, but to a different datastore that also contains the VM configuration files.

nbrestorevm - vmw - C VM_to_restore - R absolute_path_to_rename_file -vmvmxd

For the -R rename file, create a text file with the following entry:

change datastore to new_vmx_datastore

where new_vmx_datastore specifies the path to the vmx datastore (configuration datastore) for the restored VM. After the restore, this datastore contains the .vmdk files of the restored VM.

Note:

In the rename file, the change line must end with a carriage return.

G: Restore to a different vCenter server.

nbrestorevm - vmw - C VM_to_restore - R absolute_path_to_rename_file - vmserver vCenter_server

For the -R rename file, create a text file with the following entries. Replace the italicized values with the actual name for the restored VM and for the other vSphere objects in this list:

change vmname to new_display_name 
change esxhost to new_ESX_host
change datacenter to /new_datacenter 
change folder to /new_datacenter/new_folder
change resourcepool to new_datacenter/host/new_ESX_host/resources
/new_resource_pool
change datastore to new_vmx_datastore
change /original_vmdk_path to /new_datastore/

Note:

In the rename file, each change line must end with a carriage return.

The last change entry in this list (change /original_vmdk_path to /new_datastore/) designates the following: the original path to the .vmdk file, and the new datastore for the .vmdk file of the restored VM. This change entry is required when you restore to a different datastore (unless you use the nbrestorevm - vmvmxd option). Depending on your VMware environment, this change entry may take the following form:

change /original_datastore/original_VM_folder/original_vmdk.vmdk to /new_datastore/

Note:

If the change vmdk directive specifies a different path for some of the VM's vmdk files, the other vmdk files are restored to their original datastore.

See The nbrestorevm -R rename file for restoring virtual machines.

H: Restore to a different vCenter server that has multiple networks.

nbrestorevm - vmw - C VM_to_restore - R absolute_path_to_rename_file - vmserver vCenter_server

Create a rename file with the change entries listed for example G. Add the following change entry:

change network to new_network, new_network(n)

Note:

In the rename file, each change line must end with a carriage return.

I: Restore by means of a different recovery host, to a different ESX server under the same vCenter Server. After recovery, turn on the VM.

nbrestorevm - vmw - C VM_to_restore - R absolute_path_to_rename_file - vmproxy VMware_recovery_host - vmpo

The - vmpo option turns on the restored VM.

Include the following in the rename file:

change esxhost to new_ESX_host

To restore the .vmdk files to a different datastore, include the following entry in the rename file:

change /original_vmdk_path to /new_datastore/

Note:

In the rename file, each change line must end with a carriage return, even if the file contains only one line.

Note:

The rename file may require other change entries, depending on your vSphere environment. See the available entries under example G.

Note:

Configure the recovery host as a VMware Access Host on the primary server. Communication between the primary server and the backup host or recovery host (client) should be established before the restore.

J. Restore to a different location, to a standalone ESX server

nbrestorevm - vmw - C VM_to_restore - R absolute_path_to_rename_file

Include the following in the rename file:

change esxhost to new_ESX_host
change datacenter to None 
change folder to None
change resourcepool to /ha_datacenter/host/new_ESX_host/Resources
change datastore to new_datastore
change /original_vmdk_path to /new_datastore/
change network to new_network

Note:

For restore to a standalone ESX server, the resource pool entry must include the literal string ha-datacenter in the pool path.

Note:

The rename file may require other change entries, depending on your vSphere environment. See the available entries under example G.

K. Restore to a different location in a vSphere cluster, retaining the VM hardware version

nbrestorevm - vmw - C VM_to_restore - R absolute_path_to_rename_file - vmkeephv

Include the following in the rename file:

change resourcepool to /new_datacenter/host/cluster/resources/new_resource_pool

Note:

The rename file may require other change entries, depending on your vSphere environment. See the available entries under example G.

For further descriptions of the nbrestorevm options, see the command's man page or the NetBackup Commands Reference Guide.

The following topics contain additional information:

See Logs for troubleshooting the nbrestorevm command.

See The nbrestorevm -R rename file for restoring virtual machines.

Feedback

Was this page helpful?
Previous

Using the nbdiscover command to search the virtual environment

Next

Using the nbrestorevm command to restore virtual machines into vCloud Director

Feedback

Was this page helpful?