vagrant-azure
vagrant-azure copied to clipboard
On failed deployment, vagrant destroy doesn't cleanup
If you use an arm template to deploy a VM, and it fails to deploy, running vagrant destroy
does nothing as it thinks the box isn't up.
Any thoughts on the best way to handle?
My first inclination is to delete the deployment on when we receive the error in provisioning, but that might be painful since you will have no way to dig into details, perhaps in the portal, since the deployment has been deleted.
On the other hand, I don't want to write a box until we reach success.
Perhaps, we should catch the error, write the box and place the provisioning state in the box. That way, we'd know to rerun Azure provisioning in the case the box is in a failed state.
What do you think should happen?
I'm kind of happy with the up/provisioning side of it. If it fails, you can just run vagrant up
again, and it works re-runs with the new template (which is what lead me to #165).
Its more the destroy
side of things that I'm concerned about. If it fails, you need to manually go and delete the resource group as vagrant has no idea about it.
I don't know enough about the vagrant lifecycle to have an informed decision about it unfortunately.