修改虚机IP
同网段的话,直接修改,不同网段的话,使用以下方法:
步骤一:nova list --all-tenant 找到相应虚拟机
+--------------------------------------+----------+--------+------------+-------------+-------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+----------+--------+------------+-------------+-------------------+
| 1d527626-8a6d-4ef1-9fa1-dcad94c894a9 | miguoa-1 | ACTIVE | - | Running | IT-APP=10.42.3.86 |
| d00a255e-ce3e-4be7-8b4f-d4f28b6f3aba | symoa-1 | ACTIVE | - | Running | IT-APP=10.42.3.85 |
步骤二:找到虚拟机相应的网络portID
neutron port-list | grep 10.42.3.85
找到相应的port ID:
| 02e14ecd-8caa-4343-b23c-21a5f96c8b1d 10.42.3.85"} |
步骤三:neutron net-list 找到新网络的网络ID(例如:f19a9c74-81af-4ab0-a85c-d07b8e42d68e)
步骤四:增加新网络
nova interface-attach --net-id f19a9c74-81af-4ab0-a85c-d07b8e42d68e 6bcc729c-80b3-4264-88ff-0498d96d9c47
步骤五:删除老网络的Port ID
nova interface-detach 6bcc729c-80b3-4264-88ff-0498d96d9c47 cddd2c6a-753b-4ace-bff0-dace575cc5b9
步骤六:重启虚拟机
nova stop 6bcc729c-80b3-4264-88ff-0498d96d9c47
nova start 6bcc729c-80b3-4264-88ff-0498d96d9c47