Ask Your Question
0

Change static ip address of a running instance

asked 2016-07-12 09:01:28 -0600

39otrebla gravatar image

I've created a private network with DHCP disabled, and I've attached 3 instances to it. The problem is that, altough DHCP is disabled, somehow the nova list command gives me:

+-------+------------+--------+------------+-------------+----------------------+
| ID     | Name       | Status | Task State | Power State | Networks            |
+-------+--------+------------+-------------+-----------------------------------+
| ***** | backend01  | ACTIVE | -          | Running     | Ext-Net=*****; Priv-Net=192.168.1.4 |
| ***** | db-master  | ACTIVE | -          | Running     | Ext-Net=*****; Priv-Net=192.168.1.3 |
| ***** | frontend01 | ACTIVE | -          | Running     | Ext-Net=*****; Priv-Net=192.168.1.2 |
| ***** | nova       | ACTIVE | -          | Running     | Ext-Net=*****                       |

Maybe the hosting provider (OVH) has some sort of auto-config?... Anyway, what I now need to change the private IP address of 2 machines. Is it possible?

Thank you.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2016-07-12 11:48:58 -0600

updated 2016-07-12 11:54:08 -0600

on openstack you could use neutron port-create, and using this command you could pass a static ip, for example:

neutron port-create --name your_static_port_name --fixed-ip ip_address=192.168.1.254 --security-group default Priv-Net

after that you can pass the port-id to "nova boot ... --nic port-id=190f4b1b-eecf-483d-b156-3a66f1a4a836 ... " or you can attach the new ethX interface to existing instance by "nova interface-attach"

otherwise you can use "neutron port-update" to assign to an existing port a new preferred IP -> you have to reconfigure your instance by hand with new IP because neutron antispoofing doesn't allow to use different IP than it expect (unless you disable it by a command like: "neutron port-update your_port_name --allowed_address_pairs type=dict list=true mac_address=XX:XX:XX:XX:XX:XX,ip_address=0.0.0.0/0").

HTH Amedeo

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2016-07-12 08:59:52 -0600

Seen: 2,105 times

Last updated: Jul 12 '16