Neutron 中弃用的策略“create_router:external_gateway_info:enable_snat”未提供替代方案

Neutron 中弃用的策略“create_router:external_gateway_info:enable_snat”未提供替代方案

当我尝试为中子定制我的策略时,遇到了一个问题:

2023-12-12 22:31:47.840 31668 WARNING oslo_policy.policy [None req-b27a6bef-0a7a-4536-b99d-cbfcb79a791c - - - - - -] Policies ['update_router:external_gateway_info:enable_snat', 'create_router:external_gateway_info:enable_snat'] reference a rule that is not defined.

该文件policy.yaml/etc/neutron/

# /etc/neutron/policy.yaml

update_router:external_gateway_info:enable_snat: "rule:admin_or_member"
create_router:external_gateway_info:enable_snat: "rule:admin_or_member"

此内容来自我的搜索结果官方文档

然后,我又搜索了另一份官方文档示例策略文件https://docs.openstack.org/neutron/2023.2/configuration/policy-sample.html), 它说:

# Specify ``enable_snat`` in ``external_gateway_info`` information
# when creating a router
# POST  /routers
# Intended scope(s): project
#"create_router:external_gateway_info:enable_snat": "rule:admin_only"

# DEPRECATED
# "create_router:external_gateway_info:enable_snat":"rule:admin_only"
# has been deprecated since W in favor of
# "create_router:external_gateway_info:enable_snat":"rule:admin_only".
# The router API now supports system scope and default roles.
# Update ``enable_snat`` attribute of ``external_gateway_info``
# information of a router
# PUT  /routers/{id}
# Intended scope(s): project
#"update_router:external_gateway_info:enable_snat": "rule:admin_only"

# DEPRECATED
# "update_router:external_gateway_info:enable_snat":"rule:admin_only"
# has been deprecated since W in favor of
# "update_router:external_gateway_info:enable_snat":"rule:admin_only".
# The router API now supports system scope and default roles.

据称,这项政策已弃用在 2023.2 中(我的 OpenStack 版本是 2023.2(Bobcat 版本))。但它没有告诉我应该使用什么,解决方案似乎提供了另一种选择实际上完全一样一个已被弃用的。


那么如果我想在 Neutron 中定制我的策略该怎么办呢?我想允许成员在任何项目中创建具有 SNAT 功能的路由器。

感谢您的时间和帮助,我将非常感谢您对这个问题的任何建议。


其他信息:

  • OpenStack 版本:2023.2(Bobcat)
  • 操作系统:Rocky Linux 9.3
  • 使用的部署工具:PackStack(用于概念验证和测试目的)[一体化部署]
  • 我重新启动了 neutron-server 服务每次尝试修改策略文件。

相关内容