def _iscsi_discover_target(self, data):
        target_portal = data['target_portal']
        target_iqn = data['target_iqn']
        LOG.debug("Discovering iSCSI target %(target_iqn)s from "
                  "%(target_portal)s.",
                  {'target_iqn': target_iqn, 'target_portal': target_portal})
        device_name, uuid = self._iscsi_get_target(data)
        if device_name:
            LOG.debug("Storage target found. No need to discover")
            return (device_name, uuid)

        # Rescan iSCSI HBA with iscsi target host
        self._iscsi_rescan_hba(target_portal)

        # Find iSCSI Target again
        device_name, uuid = self._iscsi_get_target(data)
        if device_name:
            LOG.debug("Discovered iSCSI target %(target_iqn)s from "
                      "%(target_portal)s.",
                      {'target_iqn': target_iqn,
                       'target_portal': target_portal})
        else:
            LOG.debug("Unable to discovered iSCSI target %(target_iqn)s "
                      "from %(target_portal)s.",
                      {'target_iqn': target_iqn,
                       'target_portal': target_portal})
        return (device_name, uuid)
Get iSCSI target, rescanning the HBA if necessary.
dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/virt/vmwareapi/volumeops.py/VMwareVolumeOps._iscsi_discover_target