'Creates an export for a logical volume.'

def create_export(self, context, volume, volume_path):

    (iscsi_target, lun) = self._get_target_and_lun(context, volume)
    iscsi_name = self._get_iscsi_name(volume)
    if (self.chap_username and self.chap_password):
        chap_auth = (self.chap_username, self.chap_password)
    else:
        chap_auth = self._get_target_chap_auth(context, volume)
        if (not chap_auth):
            chap_auth = (vutils.generate_username(), vutils.generate_password())
    tid = self.create_iscsi_target(iscsi_name, volume['id'], iscsi_target, lun, volume_path, chap_auth)
    data = {}
    data['location'] = self._iscsi_location(self.configuration.iscsi_ip_address, tid, iscsi_name, lun)
    LOG.debug('Set    provider_location    to:    %s', data['location'])
    data['auth'] = self._iscsi_authentication('CHAP', *chap_auth)
    return data
