I’m creating a couple of disks via vsphere_virutal_disk resource. I am then attaching them to a vsphere_virtual_machine resource in the disk block.
When destroying the VM, the attached disks also get destroyed. I tried to add keep_on_remove to each disk but I would get an error on apply that the value was implicit when attach was set.
When looking back at the destroy output I see:
...
- keep_on_remove = false -> null
...
Am I misunderstanding the use and purpose of this attribute? Is this expected behavior? If so, then how would you keep the created disks when destroying the VM?
I would guess that what the documentation is trying to suggest, is that an attached disk isn’t considered part of the VM anyway, so it wouldn’t be removed on VM removal anyway.
But I’ve never actually used vSphere so I don’t know if that’s actually how it works.