
// Module included in the following assemblies:
//
// * backup_and_restore/application_backup_and_restore/installing/installing-oadp-kubevirt.adoc


:_mod-docs-content-type: PROCEDURE
[id="oadp-restore-single-vm_{context}"]
= Restoring a single VM

[role="_abstract"]
After you have backed up a single virtual machine (VM) by using the label selector in the `Backup` custom resource (CR), you can create a `Restore` CR and point it to the backup. This restore operation restores a single VM.

.Prerequisites

* You have installed the {oadp-short} Operator.
* You have backed up a single VM by using the label selector.

.Procedure

. Configure the `Restore` CR as shown in the following example:
+
.Example `Restore` CR
[source,yaml]
----
apiVersion: velero.io/v1
kind: Restore
metadata:
  name: vmrestoresingle
  namespace: openshift-adp
spec:
  backupName: vmbackupsingle
  restorePVs: true
----
+
where:
+
`vmbackupsingle`:: Specifies the name of the backup of a single VM.

. To restore the single VM, run the following command:
+
[source, terminal]
----
$ oc apply -f <restore_cr_file_name>
----
+
where:
+
`restore_cr_file_name`:: Specifies the name of the `Restore` CR file.
+
[NOTE]
====
When you restore a backup of VMs, you might notice that the Ceph storage capacity allocated for the restore is higher than expected. This behavior is observed only during the `kubevirt` restore and if the volume type of the VM is `block`.

Use the `rbd sparsify` tool to reclaim space on target volumes. For more details, see link:https://access.redhat.com/documentation/en-us/red_hat_openshift_data_foundation/latest/html-single/managing_and_allocating_storage_resources/index#reclaiming-space-on-target-volumes_rhodf[Reclaiming space on target volumes].
====
// end of module. Need to add this comment because the level offset attribute does not get unset at the end of this module due to the continuation plus symbol. Causing the level offset from this module to stack on to the next module. This causes build failures or deeply nested modules.
