OpenStack G版内部虚拟机指定IP地址的方法.

默认的情况下内部虚拟机是DHCP的。如果想指定IP可以按下面的方法操作.
quantum port-list | grep 修改前的IP
从列出的结果里取得HOSTID 例如、400892bb1-8802-48ed-b356-e71356901982
quantum port-update HOSTID –fixed-ips type=dict list=true ip_address=修改后的IP
例 quantum port-update 400892bb1-8802-48ed-b356-e71356901982 –fixed-ips type=dict list=true ip_address=192.168.107.118

更改虚拟机542fc3ba-6d30-436b-bc24-e2b69b896461的状态 为active
nova reset-state –active 542fc3ba-6d30-436b-bc24-e2b69b896461

李海涛

关于李海涛

李海涛 lihaitao 山水 lihato 开源软件研究与服务
此条目发表在OpenStack开源云分类目录。将固定链接加入收藏夹。

OpenStack G版内部虚拟机指定IP地址的方法.》有 1 条评论

  1. 陈新龙说:

    OpenStack Juno版虚拟机指定IP用以下命令:
    列子:
    # neutron port-list
    +————————————–+——+——————-+—————————————————————————————+
    | id | name | mac_address | fixed_ips |
    +————————————–+——+——————-+—————————————————————————————+
    | 073e65f6-76d5-4a00-9132-01fa364a7b44 | | fa:16:3e:20:73:a0 | {“subnet_id”: “54656902-1c9f-4815-9d2d-e23bd2ca7cf0”, “ip_address”: “192.168.122.2”} |
    | 26e17311-b1ed-4588-a446-6152c96cff33 | | fa:16:3e:20:13:bc | {“subnet_id”: “54656902-1c9f-4815-9d2d-e23bd2ca7cf0”, “ip_address”: “192.168.122.3”} |
    | 5e5e9e0c-df2c-4a53-a2db-cd7b11ecd561 | | fa:16:3e:9b:43:ec | {“subnet_id”: “a24b1c6d-bd5f-46e5-8a16-f8b237455205”, “ip_address”: “172.28.108.200”} |
    | c6ec0a4d-bda4-4363-a718-d582469679bc | | fa:16:3e:1b:62:69 | {“subnet_id”: “a24b1c6d-bd5f-46e5-8a16-f8b237455205”, “ip_address”: “172.28.108.201”} |
    | f26645a6-aefb-4a35-a830-f2ebe0d988e3 | | fa:16:3e:02:d6:40 | {“subnet_id”: “54656902-1c9f-4815-9d2d-e23bd2ca7cf0”, “ip_address”: “192.168.122.1”} |
    +————————————–+——+——————-+—————————————————————————————+
    # neutron port-list |grep ‘192.168.122.2’
    | 073e65f6-76d5-4a00-9132-01fa364a7b44 | | fa:16:3e:20:73:a0 | {“subnet_id”: “54656902-1c9f-4815-9d2d-e23bd2ca7cf0”, “ip_address”: “192.168.122.2”} |

    # neutron port-update 073e65f6-76d5-4a00-9132-01fa364a7b44 –fixed-ips type=dict list=true ip_address=192.168.122.21
    Updated port: 073e65f6-76d5-4a00-9132-01fa364a7b44

评论功能已关闭。