Red Hat Training

A Red Hat training course is available for Red Hat Enterprise Linux

12.8.3. Configuring the Virtual Machine to Use a vHBA LUN

After a storage pool is created for a vHBA, add the vHBA LUN to the virtual machine configuration.
  1. Find available LUNs

    First, use the virsh vol-list command in order to generate a list of available LUNs on the vHBA. For example:
    # virsh vol-list vhbapool_host3
     Name                 Path
    ------------------------------------------------------------------------------
     unit:0:4:0           /dev/disk/by-path/pci-0000:10:00.0-fc-0x5006016844602198-lun-0
     unit:0:5:0           /dev/disk/by-path/pci-0000:10:00.0-fc-0x5006016044602198-lun-0
    The list of LUN names displayed will be available for use as disk volumes in virtual machine configurations.
  2. Add the vHBA LUN to the virtual machine

    Add the vHBA LUN to the virtual machine by specifying in the virtual machine's XML:
    • the device type as lun or disk in the <disk> parameter, and
    • the source device in the <source> parameter. Note this can be entered as /dev/sdaN, or as a symbolic link generated by udev in /dev/disk/by-path|by-id|by-uuid|by-label, which can be found by running the virsh vol-list pool command.
    For example:
       <disk type='block' device='lun'>
         <driver name='qemu' type='raw'/>
         <source dev='/dev/disk/by-path/pci-0000\:04\:00.1-fc-0x203400a0b85ad1d7-lun-0'/>
         <target dev='sda' bus='scsi'/>
       </disk>