devopsgroup-io / vagrant-hostmanager

:pencil: A Vagrant plugin that manages hosts files within a multi-machine environment.
Mozilla Public License 2.0
1.46k stars 146 forks source link

hostmanager runs when destroying host #222

Open utdrmac opened 7 years ago

utdrmac commented 7 years ago

Why does the hostmanager attempt to update the hosts file when destroying the instance?

[drmac@othala vagrant-percona]$ vagrant destroy -f
==> consul3: Terminating the instance...
==> consul3: Updating /etc/hosts file on active guest machines...
The provider for this Vagrant-managed machine is reporting that it
is not yet ready for SSH. Depending on your provider this can carry
different meanings. Make sure your machine is created and running and
try again. Additionally, check the output of `vagrant status` to verify
that the machine is in the state that you expect. If you continue to
get this error message, please view the documentation for the provider
you're using.
utdrmac commented 7 years ago

More of this on local virtualbox. Doesn't seem to cause as much of an issue compared to AWS.

[drmac@othala vagrant-percona]$ vagrant destroy -f
==> client1: Forcing shutdown of VM...
==> client1: Destroying VM and associated drives...
==> client1: Updating /etc/hosts file on active guest machines...
==> consul3: Forcing shutdown of VM...
==> consul3: Destroying VM and associated drives...
==> consul3: Updating /etc/hosts file on active guest machines...
==> consul2: Forcing shutdown of VM...
==> consul2: Destroying VM and associated drives...
==> consul2: Updating /etc/hosts file on active guest machines...
==> consul1: Forcing shutdown of VM...
==> consul1: Destroying VM and associated drives...
==> consul1: Updating /etc/hosts file on active guest machines...
caveman-dick commented 7 years ago

This is causing me an issue too. I'm using windows images that have the vagrant user account with password expiry enabled. Once the password expires winrm fails and crashes out the destroy command when trying to update the hosts file on the remaining boxes.

IMO If there is no filter on the destroy command it should skip over any hostmanager tasks.