You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/modules/ROOT/pages/06-vm-backup.adoc
+18-36Lines changed: 18 additions & 36 deletions
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ Three (3) OpenShift API's are available to manage Virtual Machine Snapshots
29
29
30
30
The VM snapshot controller binds a VirtualMachineSnapshotContent object with the VirtualMachineSnapshot object for which it was created, with a one-to-one mapping.
31
31
32
-
We can use Ansible and Ansible Automation Platform to manage the creation of these OpenShift API's at scale so that we can snapshot a single VM or a fleet of VM's.
32
+
We can use Ansible Automation Platform to manage the creation of these OpenShift API's at scale so that we can snapshot a single VM or a fleet of VM's.
33
33
34
34
== Automating taking Snapshots of Virtual Machines
35
35
@@ -39,19 +39,11 @@ When using Ansible, the *loop* directive can be used to execute a task or a seri
39
39
40
40
=== Create the `snapshot_vms.yml` File
41
41
42
-
. Navigate to the Tasks Folder:
42
+
. Within your VSCode editor, right click `tasks` of the `vm_management` collection and create a New File labeled `snapshot_vms.yml`
43
43
+
44
-
----
45
-
cd collections/ansible_collections/redhatone/vm_management/roles/vm_management/tasks/
. Open the `snapshot_vms.yml` File in Your Favorite Editor and Add the Following Task:
46
+
. Add the following content to the `snapshot_vms.yml`:
55
47
+
56
48
----
57
49
---
@@ -78,15 +70,13 @@ This is a fairly complex task, so let's break it down:
78
70
79
71
=== Create the `_snapshot_vm.yml` File
80
72
81
-
A task file beginning with an underscore (`_`) indicates that it is included within another task file. While still within the _tasks_ folder, perform the following steps:
73
+
A task file beginning with an underscore (`_`) indicates that it is included within another task file. While still within the _tasks_ folder, perform the following steps.
82
74
83
-
. Create the `_snapshot_vm.yml` File:
75
+
. Within your VSCode editor, right click `tasks` of the `vm_management` collection and create a New File labeled `_snapshot_vm.yml`
. Open the `_restore_vm_snapshot.yml` File in Your Favorite Editor and Add the Following Tasks:
258
+
. Add the following content to the `_restore_vm_snapshot.yml`:
279
259
+
280
260
----
281
261
---
@@ -356,7 +336,7 @@ One key difference during the creation of the `VirtualMachineRestore` using the
356
336
357
337
== Create and Run the Restore VM Snapshots Job Template
358
338
359
-
. Navigate to *Automation Execution → Templates*.
339
+
. Head to the AAP UI Dashboard, navigate to *Automation Execution → Templates*.
360
340
. Click *Create Template* and select *Create job template*.
361
341
. Fill in the following details making sure to include the name of the snapshot created previously for the `rhel9-vm1` Virtual Machine:
362
342
@@ -377,6 +357,8 @@ One key difference during the creation of the `VirtualMachineRestore` using the
377
357
378
358
WARNING: Replace <snapshot_name> with the name of your snapthot created previously.
379
359
360
+
Launch the template.
361
+
380
362
Once the Job completes successfully, confirm the restoration of the Snapshot was applied to the `rhel9-vm1` by navigating to the OpenShift UI, Virtualization -> VirtualMachines within the `vms-aap-day2` project.
381
363
382
364
Select the `rhel9-vm1` instance and then select the *Snapshots* tab. Locate the Snapshot created previously and notice the date and time within the _Last restored_ column indicating that the Snapshot was successfully restored against the Virtual Machine instance.
0 commit comments