hashicorp / packer-plugin-googlecompute

Packer plugin for Google Compute Builder
https://www.packer.io/docs/builders/googlecompute
Mozilla Public License 2.0
23 stars 51 forks source link

builder: leverage AutoDelete for persistent disks #167

Closed lbajolet-hashicorp closed 1 year ago

lbajolet-hashicorp commented 1 year ago

In previous versions of the plugin, we'd remove disks manually, one by one, after the instance was torn-down.

However, there's an AutoDelete boolean that we can set for disks at instance creation time, which takes care of deleting those for us.

This commit sets this boolean to the appropriate value so they're automatically deleted, and we keep on checking/deleting manually some of those disks after that should one fail to be deleted during this step.

This should mitigate issues with the cleanup phase for this step, and ensure disks are indeed removed.

Closes #158