harvester / harvester

Open source hyperconverged infrastructure (HCI) software
https://harvesterhci.io/
Apache License 2.0
3.9k stars 328 forks source link

[BUG] terraform destroy -auto-approve doesn't always clear all volumes #5489

Open irishgordo opened 8 months ago

irishgordo commented 8 months ago

Describe the bug sometimes a disk isn't erased with terraform destroy -auto-approve when one or more are associate with a vm

To Reproduce Steps to reproduce the behavior:

  1. build up some terraform with a vm and disks
  2. apply
  3. destroy with the -auto-approve

Expected behavior disks to be cleaned up and terraform to not error out

Environment

Workaround

brandboat commented 6 months ago

I encountered this before (https://github.com/harvester/harvester/issues/5573), there is an option called auto_delete, add this to the disk config and the volumes should be erased after execute terraform destroy -auto-approve

disk {
  name = "test-disk"
  size = "10Gi"
  image = "ubuntu"
  auto_delete = true
}