码迷,mamicode.com
首页 > 其他好文 > 详细

openstack虚拟机修改IP地址

时间:2014-08-21 19:40:45      阅读:286      评论:0      收藏:0      [点我收藏+]

标签:openstack常见问题

1)、查找虚拟机的网络端口

mysql> use neutron;

mysql> select * from ports where device_id="3ab73261-82ce-4b9a-9a1c-519624e19dc2";

+----------------------------------+--------------------------------------+------+--------------------------------------+-------------------+----------------+--------+--------------------------------------+--------------+

| tenant_id                        | id                                   | name | network_id                           | mac_address       | admin_state_up | status | device_id                            | device_owner |

+----------------------------------+--------------------------------------+------+--------------------------------------+-------------------+----------------+--------+--------------------------------------+--------------+

| 5855410282d54e0cac49f05b40282500 | eccd3444-bb81-4d3b-ae13-58040847da4a |      | ed547aa7-af32-495a-8173-5a04be9c37c1 | fa:16:3e:a8:bd:e4 |              1 | DOWN   | 3ab73261-82ce-4b9a-9a1c-519624e19dc2 | compute:nova |

+----------------------------------+--------------------------------------+------+--------------------------------------+-------------------+----------------+--------+--------------------------------------+--------------+

1 row in set (0.01 sec)


mysql> 

2)、查找虚拟机网络端口的IP地址

mysql> select * from ipallocations  where port_id="eccd3444-bb81-4d3b-ae13-58040847da4a";

+--------------------------------------+--------------+--------------------------------------+--------------------------------------+

| port_id                              | ip_address   | subnet_id                            | network_id                           |

+--------------------------------------+--------------+--------------------------------------+--------------------------------------+

| eccd3444-bb81-4d3b-ae13-58040847da4a | 10.40.211.28 | e6e73775-ddbc-461a-92ff-b13202c23540 | ed547aa7-af32-495a-8173-5a04be9c37c1 |

+--------------------------------------+--------------+--------------------------------------+--------------------------------------+

1 row in set (0.00 sec)


3)、修改虚拟机的端口的IP地址


mysql> update ipallocations set ip_address="10.40.211.29" where port_id="eccd3444-bb81-4d3b-ae13-58040847da4a";

Query OK, 1 row affected (0.00 sec)

Rows matched: 1  Changed: 1  Warnings: 0


mysql> select * from ipallocations  where port_id="eccd3444-bb81-4d3b-ae13-58040847da4a";

+--------------------------------------+--------------+--------------------------------------+--------------------------------------+

| port_id                              | ip_address   | subnet_id                            | network_id                           |

+--------------------------------------+--------------+--------------------------------------+--------------------------------------+

| eccd3444-bb81-4d3b-ae13-58040847da4a | 10.40.211.29 | e6e73775-ddbc-461a-92ff-b13202c23540 | ed547aa7-af32-495a-8173-5a04be9c37c1 |

+--------------------------------------+--------------+--------------------------------------+--------------------------------------+

1 row in set (0.01 sec)


本文出自 “zhanguo1110” 博客,请务必保留此出处http://zhanguo1110.blog.51cto.com/5750817/1543155

openstack虚拟机修改IP地址,布布扣,bubuko.com

openstack虚拟机修改IP地址

标签:openstack常见问题

原文地址:http://zhanguo1110.blog.51cto.com/5750817/1543155

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!