Failed to mount a shared EVS disk when interconnecting to VMware

Latest reply: Jan 20, 2020 07:58:10 59 1 1 0

Hey there! This is a case about failing to mount a share EVS disk when interconnect to VMware.

Problem Description

Shared EVS disks failed to be mounted due to a computing plug-in Defect in the VM Interconnection scenario, the detail information is as follows:



Problem Analysis

1.     The nova-compute reports an error indicating that four SCSI controllers have been used up.





2.     Confirm that the disk bus model used by VMware is SCSI.     



3.     The core code is analyzed as follows:

def allocate_controller_key_and_unit_number(client_factory, devices,

                                            adapter_type, is_shared=False):

    """This function inspects the current set of hardware devices and returns

    controller_key and unit_number that can be used for attaching a new virtual

    disk to adapter with the given adapter_type.


    if devices.__class__.__name__ == "ArrayOfVirtualDevice":

        devices = devices.VirtualDevice

# Traverse devices,

(1). If the device has controller key and unit number, the dictionary {device.controllerKey: [device.unitNumber]} is generated.

(2). If the device is a SCSI controller

(['VirtualLsiLogicController', 'VirtualLsiLogicSASController', 'VirtualBusLogicController', 'ParaVirtualSCSIController'])

In this case, add the dictionary {device.key: [device.scsiCtlrUnitNumber]} on the basis of (1). #

    taken = vm_util._find_allocated_slots(devices)

    ret = None

    controller_slot = None

    unit_number = None

    if adapter_type == constants.ADAPTER_TYPE_IDE:

        .... ....

    elif adapter_type in [constants.DEFAULT_ADAPTER_TYPE,





# For non-shared volumes and non-shared controllers || Shared volumes and shared controllers, filter out all SCSI controllers, obtain keys, and form a list. #


        scsi_keys = [dev.key for dev in devices if

                     vm_util._is_scsi_controller(dev) and not (

                         is_shared ^ _is_shared_controller(dev))]  

# The shared controller checks whether the device contains the sharedBus attribute and the value is physicalSharing.

Traverse scsi_keys based on the used device information and used SCSI controller key. Each key supports 15 devices (unit). A message is returned as long as an available unit is found. #

        controller_slot = vm_util._find_controller_slot(scsi_keys, taken, 16)

        if controller_slot:controller_slot[0]

            unit_number = controller_slot[1]

        if is_shared:

            scsi_keys = [dev.key for dev in devices if

                         vm_util._is_scsi_controller(dev) and

                         (is_shared & _is_shared_controller(dev))]

            controller_slot = vm_util._find_controller_slot(scsi_keys, taken,


            if controller_slot:

                unit_number = controller_slot[1]

    if ret:

        return ret[0], ret[1], None

    elif controller_slot and unit_number:

        return controller_slot[0], unit_number, None


# If there is still no idle unit based on the existing SCSI controllers and used devices, create no more than four SCSI controllers. #

    controller_key = -101

    bus_number = 0

if adapter_type in constants.SCSI_ADAPTER_TYPES:

   bus_number = _get_bus_number_for_scsi_controller(devices)

 # When creating a shared SCSI controller, set virtual_controller.sharedBus = "physicalSharing".

Non-shared: virtual_controller.sharedBus = "noSharing" #

    controller_spec = create_controller_spec(client_factory, controller_key,

                                             adapter_type, is_shared,



    if is_shared and unit_number:

        return controller_key, unit_number, controller_spec

    return controller_key, 0, controller_spec


4.     Check the information about all devices. The information about the core SCSI controller is as follows:




5.     The VMware VM has only two disks and four SCSI controllers, among which three controllers are shared. Each controller can be attached with 15 disks. Therefore, the VMware is normal. The computing plug-in code needs to be checked.

Add the following log information:

6.     Confirm that the plug-in has found a proper SCSI controller and idle slot, but the error persists

    The value type of unit_number is an integer. The value is 0 according to the log. This problem occurs when the value is determined in the elif.

7.     Check whether the community code is correct.


Root Cause

 The VMware plug-in has an integer variable in the volume attaching process. The if statement is used to determine the low-level problem. In addition, the returned idle slot of the SCSI controller may be 0.

As a result, the plug-in considers that the SCSI controller slots are insufficient and applies for a new SCSI controller.


Add the condition that the number of idle controller slots may be 0 to the judgment statement

elif controller_slot and (unit_number or unit_number == 0)



  • x
  • convention:

Admin Created Jan 20, 2020 07:58:10 Helpful(0) Helpful(0)

Thanks for your share!
  • x
  • convention:



You need to log in to reply to the post Login | Register

Notice Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " Privacy."
If the attachment button is not available, update the Adobe Flash Player to the latest version!
Login and enjoy all the member benefits

Login and enjoy all the member benefits