'Create a 3PAR host.
Create a 3PAR host, if there is already a host on the 3par using
the same iqn but with a different hostname, return the hostname
used by 3PAR.'

def _create_3par_iscsi_host(self, common, hostname, iscsi_iqn, domain, persona_id):

    host_found = None
    hosts = common.client.queryHost(iqns=iscsi_iqn)
    if (hosts and hosts['members'] and ('name' in hosts['members'][0])):
        host_found = hosts['members'][0]['name']
    if (host_found is not None):
        return host_found
    else:
        persona_id = int(persona_id)
        try:
            common.client.createHost(hostname, iscsiNames=iscsi_iqn, optional={'domain': domain, 'persona': persona_id})
        except hpeexceptions.HTTPConflict as path_conflict:
            msg = 'Create    iSCSI    host    caught    HTTP    conflict    code:    %s'
            with save_and_reraise_exception(reraise=False) as ctxt:
                if (path_conflict.get_code() is EXISTENT_PATH):
                    hosts = common.client.queryHost(iqns=iscsi_iqn)
                    if (hosts and hosts['members'] and ('name' in hosts['members'][0])):
                        hostname = hosts['members'][0]['name']
                    else:
                        ctxt.reraise = True
                        LOG.exception(msg, path_conflict.get_code())
                else:
                    ctxt.reraise = True
                    LOG.exception(msg, path_conflict.get_code())
        return hostname
