Direct LUN I/O errors with SCSI Pass-through enabled

Hi, in our environment (Version 4.4.10.7) we use fibre channel LUNs, which we attach directly to the VMs (as Direct LUN) with VirtIO-SCSI and SCSI pass-through enabled. The virtual machines run an application that requires 4096 as physical_block_size and 512 as logical_block_size. For this reason, we had to enable SCSI pass-through. Only with SCSI pass-through the correct physical_block_size is passed through to the VM. Now we have the following problem on just about every VM: Error messages of the following form occur in the VMs (in /var/log/messages): kernel: blk_update_request: I/O error, dev sdd, sector 352194592 op 0x1:(WRITE) flags 0xc800 phys_seg 16 prio class 0 This error message coincides with a crash of the application. The error message seems to belong to SCSI. We are currently trying to find an alternative to SCSI pass-through. We want to use VirtIO and somehow pass the physical_block_size. Since the XML files of the VMs are transient, we cannot make any changes there. Does anyone have an idea what the error could be or how to pass the correct physical_block_size? Could VDSM hooks help with this? Thank you and regards Miguel

Try using VDSM hooks https://access.redhat.com/documentation/en-us/red_hat_virtualization/4.4/htm... I am using vdsm-hook-diskunmap as model. dnf install vdsm-hook-diskunmap cp /usr/libexec/vdsm/hooks/before_vm_start/50_diskunmap /usr/libexec/vdsm/hooks/before_vm_start/99_max_sectors After editing the file, the result is bellow # on host egrep -v \^$ /usr/libexec/vdsm/hooks/before_vm_start/99_max_sectors #!/usr/bin/python3 from __future__ import absolute_import from __future__ import print_function ''' Hook to set max_sectors on SCSI controller, virtio-scsi model Syntax: max_sectors=(256|128|64) Example: max_sectors=256 ''' import os import sys import traceback from xml.dom import minidom import hooking def addmax_sectors(domxml): max_sectorsConfig = os.environ['max_sectors'] for controller in domxml.getElementsByTagName('controller'): model = controller.getAttribute('model') if (model == 'virtio-scsi'): driver = controller.getElementsByTagName('driver')[0] driver.setAttribute('max_sectors', max_sectorsConfig) def main(): if 'max_sectors' in os.environ: max_sectorsConfig = os.environ['max_sectors'] domxml = hooking.read_domxml() if (max_sectorsConfig == '256' or max_sectorsConfig == '128' or max_sectorsConfig == '64'): addmax_sectors(domxml) hooking.write_domxml(domxml) def test(): text = '''<controller type='scsi' index='0' model='virtio-scsi'> <driver queues='2' iothread='1'/> <alias name='ua-c410327a-e4af-482a-966b-12cff96fea06'/> <address type='pci' domain='0x0000' bus='0x06' slot='0x00' function='0x0'/> </controller>''' xmldom = minidom.parseString(text) controller = xmldom.getElementsByTagName('controller')[0] print("\nController device definition before execution: \n%s" % controller.toxml(encoding='UTF-8')) addmax_sectors(xmldom) print("\nController device after setting max_sectors attribute: \n%s" % controller.toxml(encoding='UTF-8')) if __name__ == '__main__': try: if '--test' in sys.argv: test() else: main() except: hooking.exit_hook(' max_sectors hook: [unexpected error]: %s\n' % traceback.format_exc()) # on oVirt hosted engine # list current VM custom properties engine-config -l # add VM custom properties engine-config -s UserDefinedVMProperties='max_sectors=^(256|128|64)$' --cver=4.6 # check VM custom properties engine-config -g UserDefinedVMProperties systemctl restart ovirt-engine.service For me it's working with max_sectors 256
participants (2)
-
Dumitru E
-
mgs@ordix.de