These unfortunately get left behind sometimes if a PR is force-pushed to or build tasks canceled (for whatever reason). There's no easy way (I know of) to deal with this gracefully within Cirrus-CI (i.e. w/in a script). Suggest:
- Orphan VMs job already identifies VMs running for 3+ days.
- From the list of VMs, if any are named "packer-*" remember the name, then delete them.
- Enter a polling loop, confirming each "packer-" VM is gone (important).
- Loop over GCE persistent disks beginning with the name "packer-" (recorded in step 2). Delete them (note: this will fail if the VM still exists).
Ref: https://github.com/containers/automation_images/blob/main/orphanvms/_gce