'Prepares the target data for Nova.
:param storage_group: object of `storops` storage group.
:param host: `common.Host` object with initiator information.
:param volume: `common.Volume` object with volume information.
:param hlu: the HLU number assigned to volume.'

def prepare_target_data(self, storage_group, host, volume, hlu):

    target_io_ports = utils.sift_port_white_list(self.allowed_ports, storage_group.get_ports(host.initiators[0]))
    if (not target_io_ports):
        msg = (_('Failed    to    find    available    iSCSI    targets    for    %s.') % storage_group.name)
        raise exception.VolumeBackendAPIException(data=msg)
    if (self.iscsi_initiator_map and (host.name in self.iscsi_initiator_map)):
        iscsi_initiator_ips = list(self.iscsi_initiator_map[host.name])
        target_io_ports = self.arrange_io_ports(target_io_ports, iscsi_initiator_ips)
    iscsi_target_data = common.ISCSITargetData(volume.id, False)
    iqns = [port.wwn for port in target_io_ports]
    portals = [('%s:3260' % port.ip_address) for port in target_io_ports]
    iscsi_target_data = common.ISCSITargetData(volume.id, True, iqn=iqns[0], iqns=iqns, portal=portals[0], portals=portals, lun=hlu, luns=([hlu] * len(target_io_ports)))
    LOG.debug('Prepared    iSCSI    targets    for    %(host)s:    %(target_data)s.', {'host': host.name, 'target_data': iscsi_target_data})
    return iscsi_target_data.to_dict()
