9.16.3. Configure shared volumes for virtual machines


Enable high-availability scenarios like Windows Failover Clustering by configuring shared disks to allow multiple virtual machines to access the same storage volume. A shared disk’s volume must be block mode.

You configure disk sharing by exposing the storage as either of these types:

  • An ordinary VM disk
  • A logical unit number (LUN) disk with an SCSI connection and raw device mapping, as required for Windows Failover Clustering for shared volumes

In addition to configuring disk sharing, you can also set an error policy for each ordinary VM disk or LUN disk. The error policy controls how the hypervisor behaves when an input/output error occurs on a disk Read or Write.

9.16.3.1. 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.

You can set an error policy for each disk. The error policy controls how the hypervisor behaves when an input/output error occurs while a disk is being written to or read. The default behavior stops the VM and generates a Kubernetes event.

You can accept the default behavior, or you can set the error policy to one of the following options:

  • report, which reports the error in the guest.
  • ignore, which ignores the error. The Read or Write failure is undetected.
  • enospace, which produces an error indicating that there is not enough disk space.

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

  1. Create the VirtualMachine manifest for your VM to set the required values, as shown in the following example:

    apiVersion: kubevirt.io/v1
    kind: VirtualMachine
    metadata:
      name: <vm_name>
    spec:
      template:
    # ...
        spec:
          domain:
            devices:
              disks:
              - disk:
                  bus: virtio
                name: rootdisk
                errorPolicy: report
              - disk:
                  bus: virtio
                name: cluster
                shareable: true
              interfaces:
              - masquerade: {}
                name: default
    • spec.template.spec.domain.devices.disks.errorPolicy defines how the hypervisor should behave when an IO error occurs.
    • spec.template.spec.domain.devices.disks.shareable defines whether multiple virtual machines (VMs) can use the same underlying disk.
  2. Save the VirtualMachine manifest file to apply your changes.
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 문서 정보

Legal Notice

Theme

© 2026 Red Hat
맨 위로 이동