def create(self, context, pool):
        """
        Create a loadbalancer_pool object.
        """
        p = pool['pool']
        tenant_id = self._get_tenant_id_for_create(context, p)
        project = self._project_read(project_id=tenant_id)

        if p['listener_id']:
            try:
                ll = self._api.loadbalancer_listener_read(id=p['listener_id'])
            except NoIdError:
                raise loadbalancerv2.EntityNotFound(name='Listener',
                                                    id=p['listener_id'])
            project_id = ll.parent_uuid
            if str(uuid.UUID(tenant_id)) != project_id:
                raise NotAuthorized()
        else:
            ll = None

        pool_uuid = uuidutils.generate_uuid()
        name = self._get_resource_name('loadbalancer-pool', project,
                                       p['name'], pool_uuid)
        props = self.make_properties(p)
        id_perms = IdPermsType(enable=True,
                               description=p['description'])
        pool = LoadbalancerPool(name, project, uuid=pool_uuid,
                                loadbalancer_pool_properties=props,
                                id_perms=id_perms, display_name=p['name'])

        if ll:
            pool_exists = ll.get_loadbalancer_pool_back_refs()
            if pool_exists is not None:
                raise loadbalancerv2.OnePoolPerListener(
                    listener_id=p['listener_id'],
                    pool_id=pool_exists[0]['uuid'])
            pool.set_loadbalancer_listener(ll)

        # Custom attributes
        if p['custom_attributes'] != ATTR_NOT_SPECIFIED:
            custom_attributes = KeyValuePairs()
            self.create_update_custom_attributes(p['custom_attributes'],
                                                 custom_attributes)
            pool.set_loadbalancer_pool_custom_attributes(custom_attributes)

        self._api.loadbalancer_pool_create(pool)
        return self.make_dict(pool)