Skip to content

Commit f50c909

Browse files
authored
Merge pull request #63512 from apinnick/fixes
Organize snapshots assembly, update block PVs
2 parents 78b034c + 6b0e0be commit f50c909

13 files changed

+106
-187
lines changed

modules/virt-about-block-pvs.adoc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
// Module included in the following assemblies:
22
//
3-
// * virt/virtual_machines/cloning_vms/virt-cloning-vm-disk-into-new-datavolume-block.adoc
3+
// * virt/virtual_machines/virtual_disks/virt-uploading-local-disk-images-block.adoc
44
// * virt/virtual_machines/importing_vms/virt-importing-virtual-machine-images-datavolumes.adoc
55
// * virt/virtual_machines/cloning_vms/virt-cloning-vm-disk-into-new-block-storage-pvc.adoc
66

7-
87
:_content-type: CONCEPT
98
[id="virt-about-block-pvs_{context}"]
109
= About block persistent volumes

modules/virt-about-vm-snapshots.adoc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
:_content-type: CONCEPT
66
[id="virt-about-vm-snapshots_{context}"]
7-
= About virtual machine snapshots
7+
= About snapshots
88

99
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
1010
the snapshot) for backup and disaster recovery or to rapidly roll back to a previous development version.
@@ -15,17 +15,16 @@ When taking a snapshot of a running VM, the controller checks that the QEMU gues
1515

1616
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.
1717

18-
With the VM snapshots feature, cluster administrators and application developers can:
18+
You can perform the following snapshot actions:
1919

2020
* Create a new snapshot
2121
* List all snapshots attached to a specific VM
2222
* Restore a VM from a snapshot
2323
* Delete an existing VM snapshot
2424
25-
[id="vm-snapshot-controller-and-crds_{context}"]
26-
== Virtual machine snapshot controller and custom resource definitions (CRDs)
25+
.VM snapshot controller and custom resources
2726

28-
The VM snapshot feature introduces three new API objects defined as CRDs for managing snapshots:
27+
The VM snapshot feature introduces three new API objects defined as custom resource definitions (CRDs) for managing snapshots:
2928

3029
* `VirtualMachineSnapshot`: Represents a user request to create a snapshot. It contains information about the current state of the VM.
3130
* `VirtualMachineSnapshotContent`: Represents a provisioned resource on the cluster (a snapshot). It is created by the VM snapshot controller and contains references to all resources required to restore the VM.
Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
// Module included in the following assemblies:
22
//
3-
// * virt/live_migration/virt-migrating-vm-on-secondary-network.adoc
3+
// * virt/vm_networking/virt-dedicated-network-live-migration.adoc
44

55
:_content-type: PROCEDURE
66
[id="virt-configuring-secondary-network-vm-live-migration_{context}"]
77
= Configuring a dedicated secondary network for virtual machine live migration
88

9-
To configure a dedicated secondary network for live migration, you must first create a bridge network attachment definition for the `openshift-cnv` namespace by using the CLI. Then, add the name of the `NetworkAttachmentDefinition` object to the `HyperConverged` custom resource (CR).
9+
To configure a dedicated secondary network for live migration, you must first create a bridge network attachment definition (NAD) by using the CLI. Then, you add the name of the `NetworkAttachmentDefinition` object to the `HyperConverged` custom resource (CR).
1010

1111
.Prerequisites
1212

1313
* You installed the OpenShift CLI (`oc`).
1414
* You logged in to the cluster as a user with the `cluster-admin` role.
15-
* The Multus Container Network Interface (CNI) plugin is installed on the cluster.
16-
* Every node on the cluster has at least two Network Interface Cards (NICs), and the NICs to be used for live migration are connected to the same VLAN.
17-
* The virtual machine (VM) is running with the `LiveMigrate` eviction strategy.
15+
* Each node has at least two Network Interface Cards (NICs).
16+
* The NICs for live migration are connected to the same VLAN.
1817
1918
.Procedure
2019

21-
. Create a `NetworkAttachmentDefinition` manifest.
20+
. Create a `NetworkAttachmentDefinition` manifest according to the following example:
2221
+
2322
.Example configuration file
2423
[source,yaml,subs="attributes+"]
@@ -33,19 +32,18 @@ spec:
3332
"cniVersion": "0.3.1",
3433
"name": "migration-bridge",
3534
"type": "macvlan",
36-
"master": "eth1", <3>
35+
"master": "eth1", <2>
3736
"mode": "bridge",
3837
"ipam": {
39-
"type": "whereabouts", <4>
40-
"range": "10.200.5.0/24" <5>
38+
"type": "whereabouts", <3>
39+
"range": "10.200.5.0/24" <4>
4140
}
4241
}'
4342
----
44-
<1> The name of the `NetworkAttachmentDefinition` object.
45-
<2> The namespace where the `NetworkAttachmentDefinition` object resides. This must be `openshift-cnv`.
46-
<3> The name of the NIC to be used for live migration.
47-
<4> The name of the CNI plugin that provides the network for this network attachment definition.
48-
<5> The IP address range for the secondary network. This range must not have any overlap with the IP addresses of the main network.
43+
<1> Specify the name of the `NetworkAttachmentDefinition` object.
44+
<2> Specify the name of the NIC to be used for live migration.
45+
<3> Specify the name of the CNI plugin that provides the network for the NAD.
46+
<4> Specify an IP address range for the secondary network. This range must not overlap the IP addresses of the main network.
4947

5048
. Open the `HyperConverged` CR in your default editor by running the following command:
5149
+
@@ -56,7 +54,7 @@ oc edit hyperconverged kubevirt-hyperconverged -n {CNVNamespace}
5654

5755
. Add the name of the `NetworkAttachmentDefinition` object to the `spec.liveMigrationConfig` stanza of the `HyperConverged` CR. For example:
5856
+
59-
.Example configuration file
57+
.Example `HyperConverged` manifest
6058
[source,yaml]
6159
----
6260
apiVersion: hco.kubevirt.io/v1beta1
@@ -66,14 +64,13 @@ metadata:
6664
spec:
6765
liveMigrationConfig:
6866
completionTimeoutPerGiB: 800
69-
network: my-secondary-network <1>
67+
network: <network> <1>
7068
parallelMigrationsPerCluster: 5
7169
parallelOutboundMigrationsPerNode: 2
7270
progressTimeout: 150
7371
# ...
7472
----
75-
<1> The name of the Multus `NetworkAttachmentDefinition` object to be used for live migrations.
76-
73+
<1> Specify the name of the Multus `NetworkAttachmentDefinition` object to be used for live migrations.
7774

7875
. Save your changes and exit the editor. The `virt-handler` pods restart and connect to the secondary network.
7976

@@ -83,5 +80,5 @@ spec:
8380
+
8481
[source,terminal]
8582
----
86-
oc get vmi <vmi_name> -o jsonpath='{.status.migrationState.targetNodeAddress}'
83+
$ oc get vmi <vmi_name> -o jsonpath='{.status.migrationState.targetNodeAddress}'
8784
----

modules/virt-creating-local-block-pv.adoc

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
// * virt/virtual_machines/importing_vms/virt-importing-virtual-machine-images-datavolumes.adoc
55
// * virt/virtual_machines/cloning_vms/virt-cloning-vm-disk-into-new-block-storage-pvc.adoc
66

7-
87
:_content-type: PROCEDURE
98
[id="virt-creating-local-block-pv_{context}"]
109
= Creating a local block persistent volume
@@ -18,25 +17,24 @@ virtual machine image.
1817

1918
.Procedure
2019

21-
. Log in as `root` to the node on which to create the local PV. This procedure
20+
. Log in as root user to the node on which to create the local PV. This procedure
2221
uses `node01` for its examples.
2322

2423
. Create a file and populate it with null characters so that it can be used as a block device.
2524
The following example creates a file `loop10` with a size of 2Gb (20 100Mb blocks):
2625
+
2726
[source,terminal]
2827
----
29-
$ dd if=/dev/zero of=<loop10> bs=100M count=20
28+
# dd if=/dev/zero of=loop10 bs=100M count=20
3029
----
3130

32-
. Mount the `loop10` file as a loop device.
31+
. Mount the `loop10` file as a loop device as in the following example:
3332
+
3433
[source,terminal]
3534
----
36-
$ losetup </dev/loop10>d3 <loop10> <1> <2>
35+
# losetup /path/loop10 loop10 <1>
3736
----
38-
<1> File path where the loop device is mounted.
39-
<2> The file created in the previous step to be mounted as the loop device.
37+
<1> Specify the path of the loop device and the loop device file name.
4038

4139
. Create a `PersistentVolume` manifest that references the mounted loop device.
4240
+
@@ -71,7 +69,7 @@ spec:
7169
<3> Optional: Set a storage class for the PV. If you omit it, the cluster default is used.
7270
<4> The node on which the block device was mounted.
7371

74-
. Create the block PV.
72+
. Create the block PV:
7573
+
7674
[source,terminal]
7775
----

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

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,9 @@
44

55
:_content-type: PROCEDURE
66
[id="virt-creating-vm-snapshot-cli_{context}"]
7-
= Creating a virtual machine snapshot in the CLI
7+
= Creating a snapshot by using the command line
88

9-
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.
10-
11-
[NOTE]
12-
====
13-
To create snapshots of an online (Running state) VM with the highest integrity, install the QEMU guest agent.
14-
15-
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.
16-
====
9+
You can create a virtual machine (VM) snapshot for an offline or online VM by creating a `VirtualMachineSnapshot` object.
1710

1811
.Prerequisites
1912

@@ -23,40 +16,38 @@ The QEMU guest agent takes a consistent snapshot by attempting to quiesce the VM
2316
2417
.Procedure
2518

26-
. Create a YAML file to define a `VirtualMachineSnapshot` object that specifies the name of the new `VirtualMachineSnapshot` and the name of the source VM.
27-
+
28-
For example:
19+
. Create a YAML file to define a `VirtualMachineSnapshot` object that specifies the name of the new `VirtualMachineSnapshot` and the name of the source VM as in the following example:
2920
+
3021
[source,yaml]
3122
----
3223
apiVersion: snapshot.kubevirt.io/v1beta1
3324
kind: VirtualMachineSnapshot
3425
metadata:
35-
name: my-vmsnapshot <1>
26+
name: <snapshot_name>
3627
spec:
3728
source:
3829
apiGroup: kubevirt.io
3930
kind: VirtualMachine
40-
name: my-vm <2>
31+
name: <vm_name>
4132
----
42-
<1> The name of the new `VirtualMachineSnapshot` object.
43-
<2> The name of the source VM.
4433

45-
. Create the `VirtualMachineSnapshot` resource. The snapshot controller creates a `VirtualMachineSnapshotContent` object, binds it to the `VirtualMachineSnapshot` and updates the `status` and `readyToUse` fields
46-
of the `VirtualMachineSnapshot` object.
34+
. Create the `VirtualMachineSnapshot` object:
4735
+
4836
[source,terminal]
4937
----
50-
$ oc create -f <my-vmsnapshot>.yaml
38+
$ oc create -f <snapshot_name>.yaml
5139
----
40+
+
41+
The snapshot controller creates a `VirtualMachineSnapshotContent` object, binds it to the `VirtualMachineSnapshot`, and updates the `status` and `readyToUse` fields of the `VirtualMachineSnapshot` object.
5242

5343
. Optional: If you are taking an online snapshot, you can use the `wait` command and monitor the status of the snapshot:
5444
.. Enter the following command:
5545
+
5646
[source,terminal]
5747
----
58-
$ oc wait my-vm my-vmsnapshot --for condition=Ready
48+
$ oc wait <vm_name> <snapshot_name> --for condition=Ready
5949
----
50+
6051
.. Verify the status of the snapshot:
6152
* `InProgress` - The online snapshot operation is still in progress.
6253
* `Succeeded` - The online snapshot operation completed successfully.
@@ -75,15 +66,14 @@ If you do not specify a unit of time such as `m` or `s`, the default is seconds
7566

7667
.Verification
7768

78-
. Verify that the `VirtualMachineSnapshot` object is created and bound with `VirtualMachineSnapshotContent`. The `readyToUse` flag must be set to `true`.
69+
. Verify that the `VirtualMachineSnapshot` object is created and bound with `VirtualMachineSnapshotContent` and that the `readyToUse` flag is set to `true`:
7970
+
8071
[source,terminal]
8172
----
82-
$ oc describe vmsnapshot <my-vmsnapshot>
73+
$ oc describe vmsnapshot <snapshot_name>
8374
----
8475
+
8576
.Example output
86-
8777
[source,yaml]
8878
----
8979
apiVersion: snapshot.kubevirt.io/v1beta1

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

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,22 @@
44

55
:_content-type: PROCEDURE
66
[id="virt-creating-vm-snapshot-web_{context}"]
7-
= Creating a virtual machine snapshot in the web console
7+
= Creating a snapshot by using the web console
88

9-
You can create a virtual machine (VM) snapshot by using the web console.
9+
You can create a snapshot of a virtual machine (VM) by using the {product-title} web console.
1010

11-
[NOTE]
12-
====
13-
To create snapshots of an online (Running state) VM with the highest integrity, install the QEMU guest agent.
11+
The VM snapshot includes disks that meet the following requirements:
1412

15-
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.
16-
====
17-
18-
The VM snapshot only includes disks that meet the following requirements:
19-
20-
* Must be either a data volume or persistent volume claim
13+
* Either a data volume or a persistent volume claim
2114
* Belong to a storage class that supports Container Storage Interface (CSI) volume snapshots
2215
2316
.Procedure
2417

25-
. Click *Virtualization* -> *VirtualMachines* from the side menu.
26-
27-
. Select a virtual machine to open the *VirtualMachine details* page.
28-
29-
. If the virtual machine is running, click *Actions**Stop* to power it down.
30-
18+
. Navigate to *Virtualization* -> *VirtualMachines* in the web console.
19+
. Select a VM to open the *VirtualMachine details* page.
20+
. If the VM is running, click the options menu {kebab} and select *Stop* to power it down.
3121
. Click the *Snapshots* tab and then click *Take Snapshot*.
32-
33-
. Fill in the *Snapshot Name* and optional *Description* fields.
34-
22+
. Enter the snapshot name.
3523
. Expand *Disks included in this Snapshot* to see the storage volumes to be included in the snapshot.
36-
37-
. If your VM has disks that cannot be included in the snapshot and you still wish to proceed, select the *I am aware of this warning and wish to proceed* checkbox.
38-
24+
. If your VM has disks that cannot be included in the snapshot and you wish to proceed, select *I am aware of this warning and wish to proceed*.
3925
. Click *Save*.

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ You can delete an existing virtual machine (VM) snapshot by deleting the appropr
1414
1515
.Procedure
1616

17-
* Delete the `VirtualMachineSnapshot` object. The snapshot controller deletes the `VirtualMachineSnapshot` along with the associated `VirtualMachineSnapshotContent` object.
17+
* Delete the `VirtualMachineSnapshot` object:
1818
+
1919
[source,terminal]
2020
----
21-
$ oc delete vmsnapshot <my-vmsnapshot>
21+
$ oc delete vmsnapshot <snapshot_name>
2222
----
23+
+
24+
The snapshot controller deletes the `VirtualMachineSnapshot` along with the associated `VirtualMachineSnapshotContent` object.
2325
2426
.Verification
2527

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

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,14 @@
44

55
:_content-type: PROCEDURE
66
[id="virt-deleting-vm-snapshot-web_{context}"]
7-
= Deleting a virtual machine snapshot in the web console
7+
= Deleting a snapshot by using the web console
88

9-
You can delete an existing virtual machine snapshot by using the web console.
9+
You can delete an existing virtual machine (VM) snapshot by using the web console.
1010

1111
.Procedure
1212

13-
. Click *Virtualization* -> *VirtualMachines* from the side menu.
14-
15-
. Select a virtual machine to open the *VirtualMachine details* page.
16-
17-
. Click the *Snapshots* tab. The page displays a list of snapshots associated with the virtual machine.
18-
19-
. Click the Options menu {kebab} of the virtual machine snapshot that you want to delete and select *Delete VirtualMachineSnapshot*.
20-
21-
. In the confirmation pop-up window, click *Delete* to delete the snapshot.
13+
. Navigate to *Virtualization* -> *VirtualMachines* in the web console.
14+
. Select a VM to open the *VirtualMachine details* page.
15+
. Click the *Snapshots* tab to view a list of snapshots associated with the VM.
16+
. Click the options menu {kebab} beside a snapshot and select *Delete VirtualMachineSnapshot*.
17+
. Click *Delete*.

0 commit comments

Comments
 (0)