mitchellh/vagrant — Issue #739: vagrant destroy should work in reverse order
Author: jterhune
Created: 2012-02-14 15:02:24+00:00
State: open

We have a Vagrantfile that defines two boxes: a chef server and an app server that is provisioned using chef client. I've added a cleanup method in the Vagrantfile to automatically delete the nodes and clients from the chef server when the box comes down (see issue #336 and http://frank.be/articles/2011/12/16/vagrant-and-chef-auto-deregister-on-vm-destroy/ ).

The client is dependent on the server, so within the Vagrantfile we defined the server before the client. This works great when we do 'vagrant up' to bring up both boxes, but unfortunately 'vagrant destroy' works in the same order. So, the server is destroyed, and then the client's requests timeout when it tries to unregister itself. It works as intended when we destroy the client box individually.

It seems like vagrant destroy should destroy boxes in the reverse order that the Vagrantfile defines them.