2

I have an ECS cluster running one docker container which I want to run for only several hours per day. When the instance does not need to be used I want it to be stopped but I found that I can't stop an instance in ASG because it will get terminated automatically. So when I set the desired count of ASG to 0 my instance is getting terminated and all volumes that were attached to that instance also gets wiped so I lose my data.

I've set the BlockDeviceMappings of my cloud formation template to persist those volumes

BlockDeviceMappings: - DeviceName: '/dev/xvda' Ebs: DeleteOnTermination: false - DeviceName: '/dev/xvdcz' Ebs: DeleteOnTermination: false

When instance is terminated I would like to reattach those existing EBS but instead two new separate volumes are created. How could I make it that It reattach to the already existing EBS volumes instead of making new ones of each new ec2 instance creation.

Mugetsu
  • 1,739
  • 2
  • 20
  • 41
  • Why are you using ASG for single instance?, you can use single standalone server and you can schedule time period when to stop&start container and instance as well. – Ashok Reddy Aug 22 '18 at 09:15

0 Answers0