ggiamarchi / vagrant-openstack-provider

Use Vagrant to manage OpenStack Cloud instances.
MIT License
247 stars 101 forks source link

Run provisioner cleanup when destroying VMs #272

Closed Sharpie closed 8 years ago

Sharpie commented 8 years ago

Vagrant v1.3.0 introduced the ability for provisioners to define cleanup tasks that get run during VM destruction in order to clean up bits of global state. This patch adds the ProvisionerCleanup task to the OpenStack destroy action.

ggiamarchi commented 8 years ago

@Sharpie I suppose you use the Chef client provisionner ? Up to now it seems to be the only one that implement this feature. Unfortunately i don't have an up and running Chef server to test it on my side. Can you confirm you successfully tested it with the Chef client provisionner ?

Sharpie commented 8 years ago

I use a Puppet provisioner which de-registers a machine that is being destroyed, along with a hostname provisioner that manages /etc/hosts and removes a machine's entries from other nodes when it is destroyed.

I also use multiple providers on a regular basis: VirtualBox, AWS, OpenStack, vSphere. So, having consistent provisioner cleanup behavior between all is important as well.