IP from provider network not assigned to vm

asked 2020-04-14 05:42:19 -0500

Rony gravatar image

I want create little installation of openstack for study in my home net IP 192.168.100.0/24.
100.1 is router with dhcp server for local net with pool range 100.10 - 100.49 .
Range from 100.50 to 100.99 are static for magagement IP of openstack hardware instances.
100.100 - 100.149 is range of fixed IP for other machines.
100.150 -100.199 is set as allocation poll for openstack virtual machnine.

I have 3 openstack hardware 100.50 is controller mgmt-ip, 100.51 is compute-node1 mgmt-ip, 100.52 is cinder mgmt-ip, but cinder is unconfigured while I'm just getting to know the basics of openstack. Controller has installed keystone, neutron-server, nova-server, rabbit, according to the installation manual procedures from http://docs.openstack.org.
I create provider network with "openstack network create --share --external --provider-physical-network provider --provider-network-type flat provider" . It's end's OK.
Next, I create subnet on this provider network with
"openstack subnet create --network provider --allocation-pool start=192.168.100.150,end=192.168.100.199 --dns-nameserver 208.67.222.222 --gateway 192.168.100.1 --subnet-range 192.168.100.0/24 --no-dhcp provider" . It's end's OK.
--no-dhcp option is set, so that address allocation does not interfere with real IP dhcp server on IP 192.68.100.1. Finally, I create an instance with
openstack server create --flavor m1.nano --image cirros --nic net-id=45ae4cae-ed4e-411e-a958-9369842ea735 --security-group default --key-name mykey vm1

openstack server list
+--------------------------------------+------+--------+--------------------------+--------+---------+
| ID                                   | Name | Status | Networks                 | Image  | Flavor  |
+--------------------------------------+------+--------+--------------------------+--------+---------+
| af406c42-d1b2-4cfa-ae82-3e21663b8076 | vm1  | ACTIVE | provider=192.168.100.181 | cirros | m1.nano |
+--------------------------------------+------+--------+--------------------------+--------+---------+

Server has assigned IP address , but is but is unavailable on net. If I logon to compute node and connect to virtual instance over virsh console, instance not have assigned IP address. And I dont know why? openstack server create command visibly assigns an IP address from allocation pool to instance, but don't write in to image. If I add it to instance manualy from instance, all works fine. After if I create server with
openstack server create --flavor m1.nano --image cirros --nic net-id=45ae4cae-ed4e-411e-a958-9369842ea735,v4-fixed-ip=192.168.100.155 --security-group default --key-name mykey vm2
then vm build crash.

openstack server list
+--------------------------------------+------+--------+--------------------------+--------+---------+
| ID                                   | Name | Status | Networks                 | Image  | Flavor  |
+--------------------------------------+------+--------+--------------------------+--------+---------+
| e16c3888-b635-4577-80cb-197409eff366 | vm2  | ERROR  |                          | cirros | m1.nano |
| af406c42-d1b2-4cfa-ae82-3e21663b8076 | vm1  | ACTIVE | provider=192.168.100.181 | cirros | m1.nano |
+--------------------------------------+------+--------+--------------------------+--------+---------+

Where do I make a mistake? I don't want to study and test the self-service-network yet until I go through this minimal installation. Environment - ubuntu 18.04 openstack train an it components.

edit retag flag offensive close merge delete

Comments

In a provider network neutron isn't able to inject any metadata to the vm. Try using config-drive, this is a virtual drive that contains required data (including network) and is mounted at instance creation. Although I'm not sure if the cirros image can deal with that. Maybe try a different image.

eblock gravatar imageeblock ( 2020-04-15 02:22:52 -0500 )edit

Well thank you. I haven't gotten that far before. But I'm currently studying config-drive.

Rony gravatar imageRony ( 2020-04-20 11:24:18 -0500 )edit