分享

neutron port-update某个多值的选项时报错

高迪 2018-5-30 15:23:47 发表于 异常错误 [显示全部楼层] 回帖奖励 阅读模式 关闭右栏 3 10007
本帖最后由 高迪 于 2018-5-30 15:30 编辑

neutron port-show f0698a82-0800-4e3a-a426-b06c9f929eb2

+-----------------------+----------------------------------------------------------------------------------------+
| Field                 | Value                                                                                                            |
+-----------------------+----------------------------------------------------------------------------------------+
| admin_state_up        | True                                                                                                    |
| allowed_address_pairs |                                                                                                          |
| binding:host_id       | openstack-04                                                                                        |
| binding:profile       | {"network": 1}                                                                                        |
| binding:vif_details   | {"port_filter": true, "ovs_hybrid_plug": true}                                         |
| binding:vif_type      | ovs                                                                                                       |
| binding:vnic_type     | normal                                                                                                |
| device_id             | cec5b286-e1ef-4078-a843-45358552b1f8                                                 |
| device_owner          | compute:nova                                                                                      |
| extra_dhcp_opts       |                                                                                                           |
| fixed_ips             | {"subnet_id": "6859d408-1e17-4d10-92ee-285476793acf", "ip_address": "192.168.150.105"} |
| id                    | f0698a82-0800-4e3a-a426-b06c9f929eb2                                                   |
| mac_address           | fa:16:3e:54:17:52                                                                              |
| name                  |                                                                                                                 |
| network_id            | 32d328b6-457e-4d0b-89df-e36aabb684b8                                           |
| security_groups       | 1bd456c7-ed53-41c1-bc83-f00a0abed62f                                           |
| status                | ACTIVE                                                                                                        |
| tenant_id             | 768f1266e2424503b2523bdfa9af76c4                                                       |
+-----------------------+----------------------------------------------------------------------------------------+

需要对 fixed_ips选项更新一下ip地址

#neutron port-update --fixed-ip={"subnet_id": "6859d408-1e17-4d10-92ee-285476793acf", "ip_address": "192.168.150.102"}  774e62d4-a8c1-42c9-b1e1-a0a755235895
执行时报错
Bad Request (HTTP 400) (Request-ID: req-141eb688-a5f8-4069-8007-06f10f7ca658)


如果把逗号改成空格,就报下面这个错误
Duplicated options --fixed_ips=subnet_id:6859d408-1e17-4d10-92ee-285476793acf --fixed_ips=ip_address:192.168.150.102


换了很多种执行方式都是报错,因为是2个键值,用逗号隔开了,提交时就会报错,对于这种有2个值的,需要用什么样的格式才能正确提交?




已有(3)人评论

跳转到指定楼层
howtodown 发表于 2018-5-30 16:11:19
neutron port-update
--fixed-ip subnet_id=dc5fa6b0-de0c-470b-b268-8951b8e86ecd,ip_address=192.170.156.164
--fixed-ip subnet_id=dc5fa6b0-de0c-470b-b268-8951b8e86ecd,ip_address=192.170.156.165 b422baa3-e71b-49b9-aecf-d4c0aece11ed
Updated port: b422baa3-e71b-49b9-aecf-d4c0aece11ed

这种方式试试

回复

使用道具 举报

高迪 发表于 2018-5-31 09:48:37
howtodown 发表于 2018-5-30 16:11
neutron port-update
--fixed-ip subnet_id=dc5fa6b0-de0c-470b-b268-8951b8e86ecd,ip_address=192.170.1 ...

试过了,还是报错。
回复

使用道具 举报

desehawk 发表于 2018-5-31 15:17:45
高迪 发表于 2018-5-31 09:48
试过了,还是报错。

这种格式试试
neutron port-update [vm port id] --allowed-address-pairs type=dict list=true ip_address=[ip address]

参考这篇
http://www.99cloud.net/html/2016/jiuzhouyuanchuang_1123/256.html

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条