'Rescan the iSCSI HBA to discover iSCSI targets.'

def _iscsi_rescan_hba(self, target_portal):

    host_mor = vm_util.get_host_ref(self._session, self._cluster)
    storage_system_mor = self._session._call_method(vutil, 'get_object_property', host_mor, 'configManager.storageSystem')
    hbas_ret = self._session._call_method(vutil, 'get_object_property', storage_system_mor, 'storageDeviceInfo.hostBusAdapter')
    if (hbas_ret is None):
        return
    host_hbas = hbas_ret.HostHostBusAdapter
    if (not host_hbas):
        return
    for hba in host_hbas:
        if (hba.__class__.__name__ == 'HostInternetScsiHba'):
            hba_device = hba.device
            if target_portal:
                send_targets = getattr(hba, 'configuredSendTarget', [])
                send_tgt_portals = [('%s:%s' % (s.address, s.port)) for s in send_targets]
                if (target_portal not in send_tgt_portals):
                    self._iscsi_add_send_target_host(storage_system_mor, hba_device, target_portal)
            break
    else:
        return
    LOG.debug('Rescanning    HBA    %s', hba_device)
    self._session._call_method(self._session.vim, 'RescanHba', storage_system_mor, hbaDevice=hba_device)
    LOG.debug('Rescanned    HBA    %s    ', hba_device)
