Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pre-allocate all addresses before machines are provisioned #5

Open
adrienthebo opened this issue Jan 16, 2014 · 1 comment
Open

Pre-allocate all addresses before machines are provisioned #5

adrienthebo opened this issue Jan 16, 2014 · 1 comment

Comments

@adrienthebo
Copy link
Member

auto_network allocates IP addresses to machines as they are booted, which interacts poorly with vagrant-hosts. When machines are created and provisioned vagrant-hosts populates the hosts file with all present IP addresses, so machines that are booted later are not added to the hosts file. This means that people either have to provision all machines after the initial creation runs, or defer provisioning till after all machines are created.

@Sharpie
Copy link
Member

Sharpie commented May 11, 2014

A tractable approach to this problem may be to allocate an IP as soon as an auto-networked machine appears in the Vagrant config rather than allocating on up/destroy. The downside is that the IP pools will begin to accumulate garbage allocations --- so some sort of garbage collection will be necessary. Perhaps a time to live (hey! we just re-wrote DHCP!).

Vagrant 1.6 may enable a different approach since it globally tracks created machines. Under 1.6 and newer, we could allow the pool to fill up and do a one-time rescue of the PoolExhausted exception. When rescued, garbage collect any IP allocation for machines that do not exist in the global Vagrant index and are not defined in the current Vagrantfile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants