'Create an iSCSI target on the specified port.'

def create_target_to_storage(self, port, connector, hba_ids):

    target_name = (utils.TARGET_PREFIX + connector['ip'])
    args = ['add', 'host_grp', '-port', port, '-host_grp_name', target_name]
    if hba_ids:
        args.extend(['-iscsi_name', (hba_ids + utils.TARGET_IQN_SUFFIX)])
    try:
        result = self.run_raidcom(*args)
    except exception.VSPError:
        result = self.run_raidcom('get', 'host_grp', '-port', port)
        hostgroup_pt = re.compile(('^CL\\w-\\w+    +(?P<gid>\\d+)    +%s    +\\S+    ' % target_name.replace('.', '\\.')), re.M)
        gid = hostgroup_pt.findall(result[1])
        if gid:
            return (target_name, gid[0])
        else:
            raise
    return (target_name, horcm.find_value(result[1], 'gid'))
