← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1522232] [NEW] error occurs during attacthing volumes when there is no slots in SCSi controllers

 

Public bug reported:

There can be at most 15 virtual disk attached on an SCSi controller, so
if the limitation is reached, a new controller should be automatically
created.

In nova/virt/vmwareapi/vm_util.py:

def allocate_controller_key_and_unit_number(client_factory, devices,
                                            adapter_type):
    """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

    taken = _find_allocated_slots(devices)

    ret = None
    if adapter_type == 'ide':
        ide_keys = [dev.key for dev in devices if _is_ide_controller(dev)]
        ret = _find_controller_slot(ide_keys, taken, 2)
    elif adapter_type in ['lsiLogic', 'lsiLogicsas', 'busLogic','paraVirtual']:
        scsi_keys = [dev.key for dev in devices if _is_scsi_controller(dev)]
        ret = _find_controller_slot(scsi_keys, taken, 16)
    if ret:
        return ret[0], ret[1], None

    # create new controller with the specified type and return its spec
    controller_key = -101
    controller_spec = create_controller_spec(client_factory, controller_key,
                                             adapter_type)
    return controller_key, 0, controller_spec

Here we can see, if 'ret' is None, a 'create_controller_spec' is generated for the creation of a new controller.
I tested this function, and I check the value of 'vmdk_attach_config_spec.deviceChange'
[(VirtualDeviceConfigSpec){
   dynamicType = None
   dynamicProperty[] = <empty>
   operation = "add"
   fileOperation = "create"
   device =
      (VirtualDisk){
         dynamicType = None
         dynamicProperty[] = <empty>
         key = -100
         deviceInfo =
            (Description){
               dynamicType = None
               dynamicProperty[] = <empty>
               label = None
               summary = None
            }
         backing =
            (VirtualDiskRawDiskMappingVer1BackingInfo){
               dynamicType = None
               dynamicProperty[] = <empty>
               fileName = ""
               datastore =
                  (ManagedObjectReference){
                     value = None
                     _type = ""
                  }
               backingObjectId = None
               lunUuid = None
               deviceName = "/vmfs/devices/disks/t10.IET_____001000010000000000000000000000000000000000000000"
               compatibilityMode = "physicalMode"
               diskMode = "independent_persistent"
               uuid = None
               contentId = None
               changeId = None
               parent =
                  (VirtualDiskRawDiskMappingVer1BackingInfo){
                     dynamicType = None
                     dynamicProperty[] = <empty>
                     fileName = None
                     datastore =
                        (ManagedObjectReference){
                           value = None
                           _type = ""
                        }
                     backingObjectId = None
                     lunUuid = None
                     deviceName = None
                     compatibilityMode = None
                     diskMode = None
                     uuid = None
                     contentId = None
                     changeId = None
                  }
            }
         connectable =
            (VirtualDeviceConnectInfo){
               dynamicType = None
               dynamicProperty[] = <empty>
               startConnected = True
               allowGuestControl = False
               connected = True
               status = None
            }
         slotInfo =
            (VirtualDeviceBusSlotInfo){
               dynamicType = None
               dynamicProperty[] = <empty>
            }
         controllerKey = -101
         unitNumber = 0
         capacityInKB = 0
         capacityInBytes = None
         shares =
            (SharesInfo){
               dynamicType = None
               dynamicProperty[] = <empty>
               shares = None
               level =
                  (SharesLevel){
                     value = None
                  }
            }
         storageIOAllocation =
            (StorageIOAllocationInfo){
               dynamicType = None
               dynamicProperty[] = <empty>
               limit = None
               shares =
                  (SharesInfo){
                     dynamicType = None
                     dynamicProperty[] = <empty>
                     shares = None
                     level =
                        (SharesLevel){
                           value = None
                        }
                  }
               reservation = None
            }
         diskObjectId = None
         vFlashCacheConfigInfo =
            (VirtualDiskVFlashCacheConfigInfo){
               dynamicType = None
               dynamicProperty[] = <empty>
               vFlashModule = None
               reservationInMB = None
               cacheConsistencyType = None
               cacheMode = None
               blockSizeInKB = None
            }
      }
   profile[] = <empty>
 }, (VirtualDeviceConfigSpec){
   dynamicType = None
   dynamicProperty[] = <empty>
   operation = "add"
   fileOperation =
      (VirtualDeviceConfigSpecFileOperation){
         value = None
      }
   device =
      (ParaVirtualSCSIController){
         dynamicType = None
         dynamicProperty[] = <empty>
         key = -101
         deviceInfo =
            (Description){
               dynamicType = None
               dynamicProperty[] = <empty>
               label = None
               summary = None
            }
         backing =
            (VirtualDeviceBackingInfo){
               dynamicType = None
               dynamicProperty[] = <empty>
            }
         connectable =
            (VirtualDeviceConnectInfo){
               dynamicType = None
               dynamicProperty[] = <empty>
               startConnected = None
               allowGuestControl = None
               connected = None
               status = None
            }
         slotInfo =
            (VirtualDeviceBusSlotInfo){
               dynamicType = None
               dynamicProperty[] = <empty>
            }
         controllerKey = None
         unitNumber = None
         busNumber = 0
         device[] = <empty>
         hotAddRemove = None
         sharedBus = "noSharing"
         scsiCtlrUnitNumber = None
      }
   profile[] = <empty>
 }]

It really seems a request for creating a new controller, and then attach
the virtual disk to it.

But I met errors after this.
In an icehouse environment, it is reported as "VMwareDriverException: Cannot modify existing SCSI device"
In a kilo environment, it is reported as "VMwareDriverException: Number of virtual devices exceeds the maximum for a given controller."
(their controller types are different, I don't know if this is the reason of the difference of the error messages)

So, is this a bug?

** Affects: nova
     Importance: Undecided
         Status: New


** Tags: vmware

** Tags added: vmware

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1522232

Title:
  error occurs during attacthing volumes when there is no slots in SCSi
  controllers

Status in OpenStack Compute (nova):
  New

Bug description:
  There can be at most 15 virtual disk attached on an SCSi controller,
  so if the limitation is reached, a new controller should be
  automatically created.

  In nova/virt/vmwareapi/vm_util.py:

  def allocate_controller_key_and_unit_number(client_factory, devices,
                                              adapter_type):
      """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

      taken = _find_allocated_slots(devices)

      ret = None
      if adapter_type == 'ide':
          ide_keys = [dev.key for dev in devices if _is_ide_controller(dev)]
          ret = _find_controller_slot(ide_keys, taken, 2)
      elif adapter_type in ['lsiLogic', 'lsiLogicsas', 'busLogic','paraVirtual']:
          scsi_keys = [dev.key for dev in devices if _is_scsi_controller(dev)]
          ret = _find_controller_slot(scsi_keys, taken, 16)
      if ret:
          return ret[0], ret[1], None

      # create new controller with the specified type and return its spec
      controller_key = -101
      controller_spec = create_controller_spec(client_factory, controller_key,
                                               adapter_type)
      return controller_key, 0, controller_spec

  Here we can see, if 'ret' is None, a 'create_controller_spec' is generated for the creation of a new controller.
  I tested this function, and I check the value of 'vmdk_attach_config_spec.deviceChange'
  [(VirtualDeviceConfigSpec){
     dynamicType = None
     dynamicProperty[] = <empty>
     operation = "add"
     fileOperation = "create"
     device =
        (VirtualDisk){
           dynamicType = None
           dynamicProperty[] = <empty>
           key = -100
           deviceInfo =
              (Description){
                 dynamicType = None
                 dynamicProperty[] = <empty>
                 label = None
                 summary = None
              }
           backing =
              (VirtualDiskRawDiskMappingVer1BackingInfo){
                 dynamicType = None
                 dynamicProperty[] = <empty>
                 fileName = ""
                 datastore =
                    (ManagedObjectReference){
                       value = None
                       _type = ""
                    }
                 backingObjectId = None
                 lunUuid = None
                 deviceName = "/vmfs/devices/disks/t10.IET_____001000010000000000000000000000000000000000000000"
                 compatibilityMode = "physicalMode"
                 diskMode = "independent_persistent"
                 uuid = None
                 contentId = None
                 changeId = None
                 parent =
                    (VirtualDiskRawDiskMappingVer1BackingInfo){
                       dynamicType = None
                       dynamicProperty[] = <empty>
                       fileName = None
                       datastore =
                          (ManagedObjectReference){
                             value = None
                             _type = ""
                          }
                       backingObjectId = None
                       lunUuid = None
                       deviceName = None
                       compatibilityMode = None
                       diskMode = None
                       uuid = None
                       contentId = None
                       changeId = None
                    }
              }
           connectable =
              (VirtualDeviceConnectInfo){
                 dynamicType = None
                 dynamicProperty[] = <empty>
                 startConnected = True
                 allowGuestControl = False
                 connected = True
                 status = None
              }
           slotInfo =
              (VirtualDeviceBusSlotInfo){
                 dynamicType = None
                 dynamicProperty[] = <empty>
              }
           controllerKey = -101
           unitNumber = 0
           capacityInKB = 0
           capacityInBytes = None
           shares =
              (SharesInfo){
                 dynamicType = None
                 dynamicProperty[] = <empty>
                 shares = None
                 level =
                    (SharesLevel){
                       value = None
                    }
              }
           storageIOAllocation =
              (StorageIOAllocationInfo){
                 dynamicType = None
                 dynamicProperty[] = <empty>
                 limit = None
                 shares =
                    (SharesInfo){
                       dynamicType = None
                       dynamicProperty[] = <empty>
                       shares = None
                       level =
                          (SharesLevel){
                             value = None
                          }
                    }
                 reservation = None
              }
           diskObjectId = None
           vFlashCacheConfigInfo =
              (VirtualDiskVFlashCacheConfigInfo){
                 dynamicType = None
                 dynamicProperty[] = <empty>
                 vFlashModule = None
                 reservationInMB = None
                 cacheConsistencyType = None
                 cacheMode = None
                 blockSizeInKB = None
              }
        }
     profile[] = <empty>
   }, (VirtualDeviceConfigSpec){
     dynamicType = None
     dynamicProperty[] = <empty>
     operation = "add"
     fileOperation =
        (VirtualDeviceConfigSpecFileOperation){
           value = None
        }
     device =
        (ParaVirtualSCSIController){
           dynamicType = None
           dynamicProperty[] = <empty>
           key = -101
           deviceInfo =
              (Description){
                 dynamicType = None
                 dynamicProperty[] = <empty>
                 label = None
                 summary = None
              }
           backing =
              (VirtualDeviceBackingInfo){
                 dynamicType = None
                 dynamicProperty[] = <empty>
              }
           connectable =
              (VirtualDeviceConnectInfo){
                 dynamicType = None
                 dynamicProperty[] = <empty>
                 startConnected = None
                 allowGuestControl = None
                 connected = None
                 status = None
              }
           slotInfo =
              (VirtualDeviceBusSlotInfo){
                 dynamicType = None
                 dynamicProperty[] = <empty>
              }
           controllerKey = None
           unitNumber = None
           busNumber = 0
           device[] = <empty>
           hotAddRemove = None
           sharedBus = "noSharing"
           scsiCtlrUnitNumber = None
        }
     profile[] = <empty>
   }]

  It really seems a request for creating a new controller, and then
  attach the virtual disk to it.

  But I met errors after this.
  In an icehouse environment, it is reported as "VMwareDriverException: Cannot modify existing SCSI device"
  In a kilo environment, it is reported as "VMwareDriverException: Number of virtual devices exceeds the maximum for a given controller."
  (their controller types are different, I don't know if this is the reason of the difference of the error messages)

  So, is this a bug?

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1522232/+subscriptions


Follow ups