def get_host_iqn(session, cluster=None):
 host_mor = vm_util.get_host_ref(session, cluster)
 hbas_ret = session._call_method(vim_util, 'get_dynamic_property', host_mor, 'HostSystem', 'config.storageDevice.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'):
   return hba.iScsiName

def get_host_iqn ( session , cluster = None ) : host_mor = vm_util . get_host_ref ( session , cluster ) hbas_ret = session . _call_method ( vim_util , 'get_dynamic_property' , host_mor , 'HostSystem' , 'config.storageDevice.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' ) : return hba . iScsiName
return the host iscsi iqn .