Arctera

Paths cannot be enabled inside a KVM guest if the devices have been previously removed and re-attached from the host

LUNs are exported to the KVM guest via virtio-scsi interface. When some physical link between the host and the SAN array fails for a certain time (45-60 seconds by default), the HBA driver in the host will remove the timed-out devices. When the link is restored, these devices will be re-attached to the host; however, the access from inside the KVM guest to these devices cannot be automatically restored too without rebooting the system or manually re-attaching the devices. For DMP, these subpaths will remain in DISABLED state.

This is a known limitation of KVM.

Workaround:

From the KVM host, tune the dev_loss_tmo parameter of the Fibre Channel ports to a very large value, and set the fast_io_fail_tmo parameter to 15.

To restore access to the timed-out devices

  1. Add the following lines into /dev/udev/rules.d/40-kvm-device file:
   KERNEL=="rport-*", SUBSYSTEM=="fc_remote_ports", ACTION=="add", \
     RUN+="/bin/sh -c 'grep -q off \
     /sys/class/fc_remote_ports/%k/fast_io_fail_tmo;if [ $? -eq 0 ]; \
     then echo 15 > /sys/class/fc_remote_ports/%k/fast_io_fail_tmo 2> \
     /dev/null;fi;'"
   KERNEL=="rport-*", SUBSYSTEM=="fc_remote_ports", ACTION=="add", \
     RUN+="/bin/sh -c 'echo 8000000 > \
     /sys/class/fc_remote_ports/%k/dev_loss_tmo 2> /dev/null'"
   <!--NeedCopy-->
  1. Create the /etc/modprobe.d/qla2xxx.conf file with the following content:
   options qla2xxx qlport_down_retry=8000000
   <!--NeedCopy-->
  1. Create the /etc/modprobe.d/scsi_transport_fc.conf with the following content:
   options scsi_transport_fc dev_loss_tmo=8000000
   <!--NeedCopy-->
  1. Rebuild the initrd file and reboot.
Paths cannot be enabled inside a KVM guest if the devices have been previously removed and re-attached from the host

In this article