// Module included in the following assemblies:
//
// * virt/virtual_machines/virtual_disks/virt-configuring-shared-volumes-for-vms.adoc

:_mod-docs-content-type: PROCEDURE
[id="virt-configuring-disk-sharing-lun-cli_{context}"]
= Configuring disk sharing by using LUN and the CLI

[role="_abstract"]
You can use the command line to configure disk sharing by using LUN.

.Procedure

. Edit or 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-0
spec:
  template:
    spec:
      domain:
        devices:
          disks:
          - disk:
              bus: sata
            name: rootdisk
          - errorPolicy: report
            lun:
              bus: scsi
              reservation: true
            name: na-shared
            serial: shared1234
      volumes:
      - dataVolume:
          name: vm-0
        name: rootdisk
      - name: na-shared
        persistentVolumeClaim:
          claimName: pvc-na-share
----
+
* `spec.template.spec.domain.devices.disks.errorPolicy` defines how the hypervisor should behave when an IO error occurs.
* `spec.template.spec.domain.devices.disks.lun` defines a volume exposed as a LUN device.
* `spec.template.spec.domain.devices.disks.lun.reservation` defines whether the persistent reservation is enabled.

. Save the `VirtualMachine` manifest file to apply your changes.
