Skip to content

Commit e7fdcca

Browse files
author
Audrey Spaulding
committed
yaml file conflict
Added info from Simone one more from Avital
1 parent 5189f59 commit e7fdcca

File tree

5 files changed

+166
-0
lines changed

5 files changed

+166
-0
lines changed

_topic_maps/_topic_map.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3952,6 +3952,8 @@ Topics:
39523952
File: virt-hot-plugging-virtual-disks
39533953
- Name: Expanding VM disks
39543954
File: virt-expanding-vm-disks
3955+
- Name: Configuring shared volumes
3956+
File: virt-configuring-shared-volumes-for-vms
39553957
- Name: Networking
39563958
Dir: vm_networking
39573959
Topics:
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * * virt/virtual_machines/virtual_disks/virt-configuring-shared-volumes-for-vms.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="virt-configuring-disk-sharing-lun_{context}"]
7+
= Configuring disk sharing by using LUN
8+
9+
You can configure a LUN-backed virtual machine disk to be shared among multiple virtual machines by enabling SCSI persistent reservation. Enabling the shared option allows you to use advanced SCSI commands, such as those required for a Windows failover clustering implementation, against the underlying storage. Any disk to be shared must be in block mode.
10+
11+
A disk of type `LUN` exposes the volume as a LUN device to the VM. This allows the VM to execute arbitrary iSCSI command passthrough on the disk.
12+
13+
You reserve a LUN through the SCSI persistent reserve options to protect data on the VM from outside access. To enable the reservation, you configure the feature gate option. You then activate the option on the LUN disk to issue SCSI device-specific input and output controls (IOCTLs) that the VM requires.
14+
15+
.Prerequisites
16+
17+
* The volume access mode must be `ReadWriteMany` (RWX) if the VMs that are sharing disks are running on different nodes.
18+
+
19+
If the VMs that are sharing disks are running on the same node, `ReadWriteOnce` (RWO) volume access mode is sufficient.
20+
* The storage provider must support a Container Storage Interface (CSI) driver that uses the SCSI protocol.
21+
* If you are a cluster administrator and intend to configure disk sharing by using LUN, you must enable the cluster's feature gate on the `HyperConverged` custom resource (CR).
22+
23+
.Procedure
24+
25+
. Edit or create the `VirtualMachine` manifest for your VM to set the required values, as shown in the following example:
26+
+
27+
[source,yaml]
28+
----
29+
apiVersion: kubevirt.io/v1
30+
kind: VirtualMachine
31+
metadata:
32+
name: vm-0
33+
spec:
34+
template:
35+
spec:
36+
domain:
37+
devices:
38+
disks:
39+
- disk:
40+
bus: sata
41+
name: rootdisk
42+
- errorPolicy: report
43+
lun: <1>
44+
bus: scsi
45+
reservation: true <2>
46+
name: na-shared
47+
serial: shared1234
48+
volumes:
49+
- dataVolume:
50+
name: vm-0
51+
name: rootdisk
52+
- name: na-shared
53+
persistentVolumeClaim:
54+
claimName: pvc-na-share
55+
----
56+
<1> Identifies a LUN disk.
57+
<2> Identifies that the persistent reservation is enabled.
58+
59+
. Save the `VirtualMachine` manifest file to apply your changes.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * virt/virtual_machines/virtual_disks/virt-configuring-shared-volumes-for-vms.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="virt-configuring-vm-disk-sharing{context}"]
7+
= Configuring disk sharing by using virtual machine disks
8+
9+
You can configure block volumes so that multiple virtual machines (VMs) can share storage.
10+
11+
The application running on the guest operating system determines the storage option you must configure for the VM. A disk of type `disk` exposes the volume as an ordinary disk to the VM.
12+
13+
.Prerequisites
14+
15+
* The volume access mode must be `ReadWriteMany` (RWX) if the VMs that are sharing disks are running on different nodes.
16+
+
17+
If the VMs that are sharing disks are running on the same node, `ReadWriteOnce` (RWO) volume access mode is sufficient.
18+
19+
* The storage provider must support the required Container Storage Interface (CSI) driver.
20+
21+
.Procedure
22+
23+
. Create the `VirtualMachine` manifest for your VM to set the required values, as shown in the following example:
24+
+
25+
[source,yaml]
26+
----
27+
apiVersion: kubevirt.io/v1
28+
kind: VirtualMachine
29+
metadata:
30+
name: <vm_name>
31+
spec:
32+
template:
33+
# ...
34+
spec:
35+
domain:
36+
devices:
37+
disks:
38+
- disk:
39+
bus: virtio
40+
name: rootdisk
41+
disk1: disk_one <1>
42+
- disk:
43+
bus: virtio
44+
name: cloudinitdisk
45+
disk2: disk_two
46+
shareable: true <2>
47+
interfaces:
48+
- masquerade: {}
49+
name: default
50+
----
51+
<1> Identifies a device as a disk.
52+
<2> Identifies a shared disk.
53+
54+
. Save the `VirtualMachine` manifest file to apply your changes.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * * virt/virtual_machines/virtual_disks/virt-configuring-shared-volumes-for-vms.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="virt-enabling-persistentreservation-feature-gate_{context}"]
7+
= Enabling the PersistentReservation feature gate
8+
9+
You can enable the SCSI `persistentReservation` feature gate and allow a LUN-backed block mode virtual machine (VM) disk to be shared among multiple virtual machines.
10+
11+
The `persistentReservation` feature gate is disabled by default.
12+
13+
.Prerequisites
14+
15+
* Cluster administrator privileges are required.
16+
* The volume access mode `ReadWriteMany` (RWX) is required if the VMs that are sharing disks are running on different nodes. If the VMs that are sharing disks are running on the same node, the `ReadWriteOnce` (RWO) volume access mode is sufficient.
17+
* The storage provider must support a Container Storage Interface (CSI) driver that uses the SCSI protocol.
18+
19+
.Procedure
20+
21+
. Enable the `persistentReservation` feature gate by running the following command:
22+
+
23+
[source,terminal,subs="attributes+"]
24+
----
25+
$ oc patch hyperconverged kubevirt-hyperconverged -n {CNVNamespace} \
26+
--type json -p '[{"op":"replace","path":"/spec/featureGates/persistentReservation", "value": true}]'
27+
----
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
:_content-type: ASSEMBLY
2+
[id="virt-configuring-shared-volumes-for-vms"]
3+
= Configuring shared volumes for virtual machines
4+
include::_attributes/common-attributes.adoc[]
5+
:context: virt-configuring-shared-volumes-for-vms
6+
toc::[]
7+
8+
You can configure shared disks to allow multiple virtual machines (VMs) to share the same underlying storage. A shared disk's volume must be block mode.
9+
10+
You configure disk sharing by exposing the storage as either of these types:
11+
12+
* An ordinary virtual machine disk
13+
* A logical unit number (LUN) device with an iSCSi connection and raw device mapping, as required for Windows Failover Clustering for shared volumes
14+
15+
include::modules/virt-configuring-vm-disk-sharing.adoc[leveloffset=+1]
16+
17+
include::modules/virt-configuring-disk-sharing-lun.adoc[leveloffset=+1]
18+
19+
include::modules/virt-enabling-persistentreservation-feature-gate.adoc[leveloffset=+1]
20+
21+
[role="_additional-resources"]
22+
.Additional resources
23+
* link:https://www.qemu.org/docs/master/interop/pr-helper.html[Persistent reservation helper protocol]
24+
* link:https://learn.microsoft.com/en-us/windows-server/failover-clustering/failover-clustering-overview[Failover Clustering in Windows Server and Azure Stack HCI]

0 commit comments

Comments
 (0)