Ask Your Question
0

How to create an instance with a specific ip?

asked 2018-09-15 14:49:44 -0600

anonymous user

Anonymous

Hello I searched in https://docs.openstack.org/python-openstackclient/pike/cli/command-objects/server.html#server-create (https://docs.openstack.org/python-ope...) . But I can not find the option for the instance to create it with a non-random ip. For example I want to create the instance in the network 10.10.10.0/24 with the ip 10.10.10.100. This is the command I use:

openstack server create --flavor m1.tiny --image cirros --nic net-id=LAB1 --security-group default cirros1

I'm sorry about the stupid question

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
1

answered 2018-09-15 18:24:38 -0600

codylab gravatar image

updated 2018-09-15 18:29:09 -0600

openstack server create --nic net-id=<net-uuid>,v4-fixed-ip=10.10.10.100 with other arguments.

edit flag offensive delete link more
0

answered 2018-09-18 08:12:23 -0600

Mohit gravatar image

You can create a port with specific ip address on neutron , using command neutron port-create --fixed-ip and boot the vm specifying port-id= so that the instance is binded to the neutron port

edit flag offensive delete link more

Comments

That also works for assigning a fixed IP to VM. The only caveat for this approach is to remember to delete the port after removing the instance, to avoid from leaving an orphaned port with a binded IP behind.

codylab gravatar imagecodylab ( 2018-09-18 09:44:10 -0600 )edit

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: 2018-09-15 14:49:44 -0600

Seen: 80 times

Last updated: Sep 18