openstack api报错ClientResponseException,status=403, status-code=FORBIDDEN

项目场景:

使用共享VLAN网络建的port,非vlan所属者用户调用openstack4j api更新port信息,报错403
在这里插入图片描述


问题描述

调用openstack4j api更新port信息,报错403,报错信息如下:

ClientResponseException{message=(((((rule:update_port and (rule:update_port:fixed_ips and (rule:update_port:fixed_ips:ip_address and rule:update_port:fixed_ips:subnet_id))) and rule:update_port:device_owner) and rule:update_port:allowed_address_pairs) and rule:update_port:binding:vnic_type) and rule:update_port:port_security_enabled) is disallowed by policy, status=403, status-code=FORBIDDEN}

报错截图如下:
在这里插入图片描述


原因分析:

查看neutron日志:提示使用该用户的client不能操作该资源
在这里插入图片描述
该场景为:共享VLAN名称为vlan3303,project_id属于租户A
租户B使用vlan3303创建了port,并将该port分配了租户B,port更新安全组信息时,报错403
在这里插入图片描述


解决方案:

更新port传的参数信息:
NeutronPort{name=vlan-eni-test, adminStateUp=true, deviceId=, deviceOwner=, fixedIps=[NeutronIP{ipAddress=192.168.2.144, subnetId=088666d5-1e5c-46bb-b591-8c9952d5253e}], securityGroups=[08dc26a4-6d40-4eea-afcf-c4366490673d, 1f5731e1-80eb-4bd5-b289-9dfb9404e961], allowed_address_pairs=[], port_security_enabled =true, binding:vnic_type=normal}

通过代码调试,非VLAN所属者需要使用admin client 更新port信息。

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值