mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
52 lines
1.6 KiB
Plaintext
52 lines
1.6 KiB
Plaintext
// 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-backup-single-vm_{context}"]
|
|
= Backing up a single VM
|
|
|
|
[role="_abstract"]
|
|
If you have a namespace with multiple virtual machines (VMs), and want to back up only one of them, you can use the label selector to filter the VM that needs to be included in the backup. You can filter the VM by using the `app: vmname` label.
|
|
|
|
|
|
.Prerequisites
|
|
|
|
* You have installed the {oadp-short} Operator.
|
|
* You have multiple VMs running in a namespace.
|
|
* You have added the `kubevirt` plugin in the `DataProtectionApplication` (DPA) custom resource (CR).
|
|
* You have configured the `BackupStorageLocation` CR in the `DataProtectionApplication` CR and `BackupStorageLocation` is available.
|
|
|
|
.Procedure
|
|
|
|
. Configure the `Backup` CR as shown in the following example:
|
|
+
|
|
.Example `Backup` CR
|
|
[source,yaml]
|
|
----
|
|
apiVersion: velero.io/v1
|
|
kind: Backup
|
|
metadata:
|
|
name: vmbackupsingle
|
|
namespace: openshift-adp
|
|
spec:
|
|
snapshotMoveData: true
|
|
includedNamespaces:
|
|
- <vm_namespace> # <1>
|
|
labelSelector:
|
|
matchLabels:
|
|
app: <vm_app_name> # <2>
|
|
storageLocation: <backup_storage_location_name> # <3>
|
|
----
|
|
<1> Specify the name of the namespace where you have created the VMs.
|
|
<2> Specify the VM name that needs to be backed up.
|
|
<3> Specify the name of the `BackupStorageLocation` CR.
|
|
|
|
. To create a `Backup` CR, run the following command:
|
|
+
|
|
[source, terminal]
|
|
----
|
|
$ oc apply -f <backup_cr_file_name> # <1>
|
|
----
|
|
<1> Specify the name of the `Backup` CR file. |