Skip to content

Commit deb5d51

Browse files
author
Bob Gaydos
committed
CNV-8905: Modifyng snapshot assembly to support online VM snapshots
1 parent 4ee9dd4 commit deb5d51

16 files changed

+155
-55
lines changed

_topic_map.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2916,8 +2916,8 @@ Topics:
29162916
File: virt-uploading-local-disk-images-virtctl
29172917
- Name: Uploading a local disk image to a block storage data volume
29182918
File: virt-uploading-local-disk-images-block
2919-
- Name: Managing offline virtual machine snapshots
2920-
File: virt-managing-offline-vm-snapshots
2919+
- Name: Managing virtual machine snapshots
2920+
File: virt-managing-vm-snapshots
29212921
- Name: Moving a local virtual machine disk to a different node
29222922
File: virt-moving-local-vm-disk-to-different-node
29232923
- Name: Expanding virtual storage by adding blank disk images

modules/virt-about-vm-snapshots.adoc

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
// Module included in the following assemblies:
22
//
3-
// * virt/virtual_machines/virtual_disks/virt-managing-offline-vm-snapshots.adoc
3+
// * virt/virtual_machines/virtual_disks/virt-managing-vm-snapshots.adoc
44

55
[id="virt-about-vm-snapshots_{context}"]
66
= About virtual machine snapshots
77

88
A _snapshot_ represents the state and data of a virtual machine (VM) at a specific point in time. You can use a snapshot to restore an existing VM to a previous state (represented by
99
the snapshot) for backup and disaster recovery or to rapidly roll back to a previous development version.
1010

11-
An offline VM snapshot is created from a VM that is powered off (Stopped state). The snapshot stores a copy of each Container Storage Interface (CSI) volume attached to the VM and a copy of the VM
12-
specification and metadata. Snapshots cannot be changed after creation.
11+
A VM snapshot is created from a VM that is powered off (Stopped state) or powred on (Running state).
1312

14-
With the offline VM snapshots feature, cluster administrators and application developers can:
13+
When taking a snapshot of a running VM, the controller checks that the QEMU guest agent is installed and running. If so, it freezes the VM file system before taking the snapshot, and thaws the file system after the snapshot is taken.
14+
15+
The snapshot stores a copy of each Container Storage Interface (CSI) volume attached to the VM and a copy of the VM specification and metadata. Snapshots cannot be changed after creation.
16+
17+
With the VM snapshots feature, cluster administrators and application developers can:
1518

1619
* Create a new snapshot
1720
* List all snapshots attached to a specific VM

modules/virt-creating-offline-vm-snapshot-cli.adoc renamed to modules/virt-creating-vm-snapshot-cli.adoc

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
11
// Module included in the following assemblies:
22
//
3-
// * virt/virtual_machines/virtual_disks/virt-managing-offline-vm-snapshots.adoc
3+
// * virt/virtual_machines/virtual_disks/virt-managing-vm-snapshots.adoc
44

5-
[id="virt-creating-offline-vm-snapshot-cli_{context}"]
6-
= Creating an offline virtual machine snapshot in the CLI
5+
[id="virt-creating-vm-snapshot-cli_{context}"]
6+
= Creating an virtual machine snapshot in the CLI
77

8-
You can create a virtual machine (VM) snapshot for an offline VM by creating a `VirtualMachineSnapshot` object.
8+
You can create a virtual machine (VM) snapshot for an offline or online VM by creating a `VirtualMachineSnapshot` object. Kubevirt will coordinate with the QEMU guest agent to create a snapshot of the online VM.
9+
10+
[NOTE]
11+
====
12+
To create snapshots of an online (Running state) VM with the highest integrity, install the QEMU guest agent.
13+
14+
The QEMU guest agent takes a consistent snapshot by attempting to quiesce the VM’s file system as much as possible, depending on the system workload. This ensures that in-flight I/O is written to the disk before the snapshot is taken. If the guest agent is not present, quiescing is not possible and a best-effort snapshot is taken. The conditions under which the snapshot was taken are reflected in the snapshot indications that are displayed in the web console or CLI.
15+
====
916

1017
.Prerequisites
1118

1219
* Ensure that the persistent volume claims (PVCs) are in a storage class that supports Container Storage Interface (CSI) volume snapshots.
1320
* Install the OpenShift CLI (`oc`).
14-
* Power down the VM for which you want to create a snapshot.
21+
* Optional: Power down the VM for which you want to create a snapshot.
1522

1623
.Procedure
1724

@@ -42,6 +49,27 @@ of the `VirtualMachineSnapshot` object.
4249
$ oc create -f <my-vmsnapshot>.yaml
4350
----
4451

52+
. Optional: If you are taking an online snapshot, you can use the `wait` command and monitor the status of the snapshot:
53+
.. Enter the following command:
54+
+
55+
[source,terminal]
56+
----
57+
$ kubectl wait my-vm my-vmsnapshot --for condition=Ready
58+
----
59+
.. Verify the status of the snapshot:
60+
* `InProgress` - The online snapshot operation is still in progress.
61+
* `Succeeded` - The online snapshot operation completed successfully.
62+
* `Failed` - The online snapshot operaton failed.
63+
+
64+
[NOTE]
65+
====
66+
Online snapshots have a default time deadline of five (`5`) minutes. If the snapshot does not complete successfully in five minutes, the status is set to `failed`. Afterwards, the file system will be thawed and the VM unfrozen but the status remains `failed` until you delete the failed snapshot image.
67+
68+
To change the default time deadline, add the `FailureDeadline` attribute to the VM snapshot spec with the time (in minutes) that you want to specify before the snapshot operation times out.
69+
70+
To set no deadline, you can specify `0`, though this is generally not recommended, as it can result in an unresponsive VM.
71+
====
72+
4573
.Verification
4674

4775
. Verify that the `VirtualMachineSnapshot` object is created and bound with `VirtualMachineSnapshotContent`. The `readyToUse` flag must be set to `true`.

modules/virt-creating-offline-vm-snapshot-web.adoc renamed to modules/virt-creating-vm-snapshot-web.adoc

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
11
// Module included in the following assemblies:
22
//
3-
// * virt/virtual_machines/virtual_disks/virt-managing-offline-vm-snapshots.adoc
3+
// * virt/virtual_machines/virtual_disks/virt-managing-vm-snapshots.adoc
44

5-
[id="virt-creating-offline-vm-snapshot-web_{context}"]
6-
= Creating an offline virtual machine snapshot in the web console
5+
[id="virt-creating-vm-snapshot-web_{context}"]
6+
= Creating a virtual machine snapshot in the web console
77

88
You can create a virtual machine (VM) snapshot by using the web console.
99

10+
[NOTE]
11+
====
12+
To create snapshots of an online (Running state) VM with the highest integrity, install the QEMU guest agent.
13+
14+
The QEMU guest agent takes a consistent snapshot by attempting to quiesce the VM’s file system as much as possible, depending on the system workload. This ensures that in-flight I/O is written to the disk before the snapshot is taken. If the guest agent is not present, quiescing is not possible and a best-effort snapshot is taken. The conditions under which the snapshot was taken are reflected in the snapshot indications that are displayed in the web console or CLI.
15+
====
16+
1017
[NOTE]
1118
====
1219
The VM snapshot only includes disks that meet the following requirements:
1320
1421
* Must be either a data volume or persistent volume claim
1522
* Belong to a storage class that supports Container Storage Interface (CSI) volume snapshots
16-
17-
If your VM storage includes disks that do not support snapshots, you can either edit them or contact your cluster administrator.
1823
====
1924

2025
.Procedure

modules/virt-deleting-vm-snapshot-cli.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Module included in the following assemblies:
22
//
3-
// * virt/virtual_machines/virtual_disks/virt-managing-offline-vm-snapshots.adoc
3+
// * virt/virtual_machines/virtual_disks/virt-managing-vm-snapshots.adoc
44

55
[id="virt-deleting-vm-snapshot-cli_{context}"]
66
= Deleting a virtual machine snapshot in the CLI

modules/virt-deleting-vm-snapshot-web.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Module included in the following assemblies:
22
//
3-
// * virt/virtual_machines/virtual_disks/virt-managing-offline-vm-snapshots.adoc
3+
// * virt/virtual_machines/virtual_disks/virt-managing-vm-snapshots.adoc
44

55
[id="virt-deleting-vm-snapshot-web_{context}"]
66
= Deleting a virtual machine snapshot in the web console

modules/virt-installing-qemu-guest-agent-on-linux-vm.adoc

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
// Module included in the following assemblies:
22
//
3+
// * virt/virtual_machines/virtual_disks/virt-managing-vm-snapshots.adoc
34
// * virt/virtual_machines/virt-installing-qemu-guest-agent.adoc
45

56
[id="virt-installing-qemu-guest-agent-on-linux-vm_{context}"]
67
= Installing QEMU guest agent on a Linux virtual machine
78

89
The `qemu-guest-agent` is widely available and available by default in Red Hat
9-
virtual machines. Install the agent and start the service
10+
virtual machines. Install the agent and start the service.
11+
12+
To check if your virtual machine (VM) has the QEMU guest agent installed and running, verify that `AgentConnected` is listed in the VM spec.
13+
14+
[NOTE]
15+
====
16+
To create snapshots of an online (Running state) VM with the highest integrity, install the QEMU guest agent.
17+
18+
The QEMU guest agent takes a consistent snapshot by attempting to quiesce the VM’s file system as much as possible, depending on the system workload. This ensures that in-flight I/O is written to the disk before the snapshot is taken. If the guest agent is not present, quiescing is not possible and a best-effort snapshot is taken. The conditions under which the snapshot was taken are reflected in the snapshot indications that are displayed in the web console or CLI.
19+
====
1020

1121
.Procedure
1222

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
// Module included in the following assemblies:
22
//
3+
// * virt/virtual_machines/virtual_disks/virt-managing-vm-snapshots.adoc
34
// * virt/virtual_machines/virt-installing-qemu-guest-agent.adoc
45

5-
[id="installing-qemu-guest-agent-on-a-windows-virtual-machine"]
6+
[id="installing-qemu-guest-agent-on-windows-vm_{context}"]
67
= Installing QEMU guest agent on a Windows virtual machine
78

89
For Windows virtual machines, the QEMU guest agent is included in the
9-
VirtIO drivers, which can be installed using one of the following procedures:
10+
VirtIO drivers. Install the drivers on an existng or new Windows system.
11+
12+
To check if your virtual machine (VM) has the QEMU guest agent installed and running, verify that `AgentConnected` is listed in the VM spec.
13+
14+
[NOTE]
15+
====
16+
To create snapshots of an online (Running state) VM with the highest integrity, install the QEMU guest agent.
17+
18+
The QEMU guest agent takes a consistent snapshot by attempting to quiesce the VM’s file system as much as possible, depending on the system workload. This ensures that in-flight I/O is written to the disk before the snapshot is taken. If the guest agent is not present, quiescing is not possible and a best-effort snapshot is taken. The conditions under which the snapshot was taken are reflected in the snapshot indications that are displayed in the web console or CLI.
19+
====

modules/virt-installing-virtio-drivers-existing-windows.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Module included in the following assemblies:
22
//
3+
// * virt/virtual_machines/virtual_disks/virt-managing-vm-snapshots.adoc
34
// * virt/virtual_machines/virt-installing-qemu-guest-agent.adoc
45
// * virt/virtual_machines/virt-installing-virtio-drivers-on-existing-windows-vm.adoc
56

modules/virt-installing-virtio-drivers-installing-windows.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Module included in the following assemblies:
22
//
3+
// * virt/virtual_machines/virtual_disks/virt-managing-vm-snapshots.adoc
34
// * virt/virtual_machines/virt-installing-qemu-guest-agent.adoc
45
// * virt/virtual_machines/virt-installing-virtio-drivers-on-new-windows-vm.adoc
56

0 commit comments

Comments
 (0)