mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-07 00:48:01 +01:00
54 lines
1.6 KiB
Plaintext
54 lines
1.6 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// * virt/virtual_machines/virtual_disks/virt-configuring-shared-volumes-for-vms.adoc
|
|
|
|
:_content-type: PROCEDURE
|
|
[id="virt-configuring-vm-disk-sharing{context}"]
|
|
= Configuring disk sharing by using virtual machine disks
|
|
|
|
You can configure block volumes so that multiple virtual machines (VMs) can share storage.
|
|
|
|
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.
|
|
|
|
.Prerequisites
|
|
|
|
* The volume access mode must be `ReadWriteMany` (RWX) 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, `ReadWriteOnce` (RWO) volume access mode is sufficient.
|
|
|
|
* The storage provider must support the required Container Storage Interface (CSI) driver.
|
|
|
|
.Procedure
|
|
|
|
. Create the `VirtualMachine` manifest for your VM to set the required values, as shown in the following example:
|
|
+
|
|
[source,yaml]
|
|
----
|
|
apiVersion: kubevirt.io/v1
|
|
kind: VirtualMachine
|
|
metadata:
|
|
name: <vm_name>
|
|
spec:
|
|
template:
|
|
# ...
|
|
spec:
|
|
domain:
|
|
devices:
|
|
disks:
|
|
- disk:
|
|
bus: virtio
|
|
name: rootdisk
|
|
disk1: disk_one <1>
|
|
- disk:
|
|
bus: virtio
|
|
name: cloudinitdisk
|
|
disk2: disk_two
|
|
shareable: true <2>
|
|
interfaces:
|
|
- masquerade: {}
|
|
name: default
|
|
----
|
|
<1> Identifies a device as a disk.
|
|
<2> Identifies a shared disk.
|
|
|
|
. Save the `VirtualMachine` manifest file to apply your changes. |