Ask Your Question
0

The way of assigning ip to vm

asked 2020-04-13 10:50:21 -0500

autovm gravatar image

How OpenStack assign an IP address to the vms? Actually I couldn't see any configuration related in VM XML file or virsh net-dhcp-leases default.

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
0

answered 2020-04-13 20:50:55 -0500

It depends on what you mean by "assign".

When you launch an instance on a network, Neutron assigns it a free IP address it picks from the subnet of that network. If the network has several subnets, the first subnet is used (I believe this is the subnet that was created first). How it determines the precise IP address is not documented and depends on the implementation.

Normally, the instance then uses DHCP to obtain its IP address. Neutron runs a DHCP server per network (dnsmasq by default). If the instance has cloud-init, I believe it can also be configured to obtain the IP address from the metadata service, but my knowledge about this is rather cloudy (no pun intended).

As far as I know, libvirt is not used for IP address allocation and acquisition, or network management in general.

edit flag offensive delete link more

Comments

I would like to use neutron on my platform called autovm, is it possible to use it without install OpenStack? Or could you please give me a module that works independently to config public static IP address on vms. If it based on DHCP could be better, but it should be possible to manage by python.

autovm gravatar imageautovm ( 2020-04-13 22:58:30 -0500 )edit

Neutron has close ties to Keystone and Nova. IMO it would require a lot of work to turn it into an independent solution.

I am not sure what you need. Why not set up a simple DHCP server with dnsmasq or the official ISC DHCP server? Neutron manages dnsmasq with Python. Try using that code.

Bernd Bausch gravatar imageBernd Bausch ( 2020-04-13 23:21:08 -0500 )edit
Bernd Bausch gravatar imageBernd Bausch ( 2020-04-13 23:22:21 -0500 )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: 2020-04-13 10:50:02 -0500

Seen: 29 times

Last updated: Apr 13