Create an instance with a specific ip

asked 2019-01-18 04:43:47 -0600

najeh gravatar image

I would like to create an instance with a specific ip so i used the below command, but the creation is failed:

root@controller:~# nova boot --nic net-id=6c053128-c423-4451-9ea5-147c0b521e35,v4-fixed-ip=192.168.1.50 --key-name mykey --image ubuntu --flavor m1.small pro

Fail message: {u'message': u'Exceeded maximum number of retries. Exhausted all hosts available for retrying build failures for instance b7879e73-cfd7-4244-81f7-e4179d9b8249.', u'code': 500, u'created': u'2019-01-18T10:31:22Z'} | | flavor | m1.small (2)

I tried also the creation of a new port with a specific fixed_ip but it failed also:

root@controller:~# neutron port-create --fixed-ip subnet_id=1e162cea-bb55-4c1b-8275-9d8797ed90df,ip_address=192.168.1.50 --name flat-port-subnet1 6c053128-c423-4451-9ea5-147c0b521e35

(rule:create_port and rule:create_port:fixed_ips) is disallowed by policy Neutron server returns request_ids: ['req-37fee48b-ec49-4529-87e5-99a626434a8c']

Any suggestion please ?

edit retag flag offensive close merge delete

Comments

1

It seems like any attempt to launch an instance (even without specific IP) would fail (" Exhausted all hosts available for retrying build failures"). Can you confirm that by launching a new instance without specific ip? You should check the nova-compute.log (enable debug) for more information.

eblock gravatar imageeblock ( 2019-01-18 05:09:56 -0600 )edit
1

The general failure message would probably be "Not enough available hosts", because the scheduler_filter can't find a suitable hypervisor. Probably not enough, RAM, VCPUs, disk space etc. The port creation probably fails because the user who tries that has no admin rights in that project...

eblock gravatar imageeblock ( 2019-01-18 05:13:32 -0600 )edit
1

... or is not the network owner. Here is the excerpt from my policy.cfg:

control:~ # grep "create_port:fixed_ips" /etc/neutron/policy.json 
    "create_port:fixed_ips": "rule:context_is_advsvc or rule:admin_or_network_owner",
eblock gravatar imageeblock ( 2019-01-18 05:14:09 -0600 )edit

the instance is launched with a specific ip with just admin credentials from CLI.But using python sdk i couldn't launch the instance?

server = conn.compute.create_server( ...., network= [{"uuid":"6c053128-c423-4451-9ea5-147c0b521e35", "fixed_ip": "192.168.1.50"}]) any suggestion?

najeh gravatar imagenajeh ( 2019-01-18 06:30:52 -0600 )edit
1

Yes, like I already suggested you should try to launch an instance without a specific IP, just let the DHCP apply one and see if that instance will be booted at all. I assume that it won't.

eblock gravatar imageeblock ( 2019-01-18 06:58:53 -0600 )edit