Example #1
0
 def discover_st(self, data):
     """Discover iSCSI targets."""
     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 = volume_util.find_st(self._session, data,
                                             self._cluster)
     if device_name:
         LOG.debug(_("Storage target found. No need to discover"))
         return (device_name, uuid)
     # Rescan iSCSI HBA
     volume_util.rescan_iscsi_hba(self._session, self._cluster)
     # Find iSCSI Target again
     device_name, uuid = volume_util.find_st(self._session, data,
                                             self._cluster)
     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)
Example #2
0
 def discover_st(self, data):
     """Discover iSCSI targets."""
     target_portal = data['target_portal']
     target_iqn = data['target_iqn']
     LOG.debug(
         _("Discovering iSCSI target %(target_iqn)s from "
           "%(target_portal)s.") % locals())
     device_name, uuid = volume_util.find_st(self._session, data,
                                             self._cluster)
     if device_name:
         LOG.debug(_("Storage target found. No need to discover"))
         return (device_name, uuid)
     # Rescan iSCSI HBA
     volume_util.rescan_iscsi_hba(self._session, self._cluster)
     # Find iSCSI Target again
     device_name, uuid = volume_util.find_st(self._session, data,
                                             self._cluster)
     if device_name:
         LOG.debug(
             _("Discovered iSCSI target %(target_iqn)s from "
               "%(target_portal)s.") % locals())
     else:
         LOG.debug(
             _("Unable to discovered iSCSI target %(target_iqn)s "
               "from %(target_portal)s.") % locals())
     return (device_name, uuid)