Remove disk of EC2 host upon deletion

We're using Foreman 1.9 with Amazon EC2 compute resource. When we delete a
host from Foreman it properly terminates it in EC2 but leaves its disk
behind, so we need to periodically log into AWS and clean up the old disks.
Is there a way when Foreman creates a new host to tell it to "delete volume
on termination" if it's in EC2? I looked around but didn't find anything.

Thanks,
Tenyo

1 Like

I got around this by creating my AMI image with DeleteOnTermination=True,
so any instances created from it now have their disk automatically removed.
No changes required on the Foreman side.

··· On Wednesday, February 3, 2016 at 9:10:00 AM UTC-5, Tenyo Grozev wrote: > > We're using Foreman 1.9 with Amazon EC2 compute resource. When we delete a > host from Foreman it properly terminates it in EC2 but leaves its disk > behind, so we need to periodically log into AWS and clean up the old disks. > Is there a way when Foreman creates a new host to tell it to "delete > volume on termination" if it's in EC2? I looked around but didn't find > anything. > > Thanks, > Tenyo >
1 Like