2
votes

I am having a scenario where EC2 mount two EBS Volumes and one of them is root. My ELB is setup to size=1 instance actively running. I want to have second EBS volume snapshot to be attached to new EC2 spin-off using AMI. How to do it using CloudWatch Event and Lambda?

EC2 API for volume mount do not specify windows mounts. Any Idea how to support EC2 Windows mounts using Lambda Function or any other scripting technique?

EDITED - Here is what is expected - I have secondary EBS volume mounted to EC2 Windows. I have taken AMI of this machine and associated with Auto Scaling Group and Launch Configuration. In case of DR, ASG spins off new EC2 instance using defined AMI. It is desired that this new spin off machine to use same secondary EBS volume from snapshot.

2
What do you mean by "EC2 API for volume mount do not specify windows mounts"?John Rotenstein
What do you mean by "new spin off machine to use same secondary EBS volume from snapshot"? Are you saying that you would like new Amazon EC2 instances launched by Auto Scaling to have two volumes when they are created? AMIs can contain multiple volumes — how many volumes are in your AMI?John Rotenstein
EC2 has two volumes, one root and another X:. In case of DR, live EC2 goes out of service and ASG starts new based on AMI, now we have volume X: need to be mounted to new EC2 instance.A. J. Shukla
What is on the secondary volume? Is it just data? Does it get updated or is it effectively read-only? Does data need to be shared between instances (including updates), or is it just for reference?John Rotenstein

2 Answers

1
votes

Just mount the volume as normal. It is supported for both Linux and Windows.

If you are worried about the Linux-like device name, see Device Naming on Windows Instances - Amazon Elastic Compute Cloud:

Recommended for EBS Volumes: xvd[f-z]

0
votes

An Amazon Machine Image (AMI) can contain multiple volumes.

I suggest you:

  • Launch an Amazon EC2 instance with both desired volumes (Root + Volume X:)
  • Create a new AMI from that instance, specifying both volumes
  • Create a new Auto Scaling launch configuration using that new AMI
  • Edit the Auto Scaling group to use the new Launch Configuration