开发者

Can I create an AMI that includes multiple ebs volumes (i.e. both sda and sdb)

开发者 https://www.devze.com 2023-03-26 06:06 出处:网络
I have an ebs-backed instance running on EC2. I\'m using it to do some computationally intensive text processing on around 16Gb of data which is stored on sdb (i.e. the 开发者_Python百科larger ebs vol

I have an ebs-backed instance running on EC2. I'm using it to do some computationally intensive text processing on around 16Gb of data which is stored on sdb (i.e. the 开发者_Python百科larger ebs volume associated with the instance).

I'd like to parallelized the processing by creating replicas of this instance, each with its own copy of the data. I can create an AMI from the instance but I need the image to include BOTH sda (the root ebs volume) AND ALSO sdb, which is the volume where all the data is. How can I make a replica of the whole package?

Creating an image in the AWS Management Console just copies sda (i.e. the root volume, which is too small to hold my data).

Is this even possible?

(PS: I don't even see the sdb volume in the AWS Management Console Elastic Block Store->Volumes panel)

Thanks!


I once needed this sort of setting where I had to setup a MySQL on a EBS backed machine with data store in a separate EBS Volume. The AMI had to be such that every time you instanciate it, it should have the data volume (with static data in it) attached. This is how I did:

  1. Created an EBS backed instance from any existing image
  2. Attached a EBS volume, performed mkfs, mounted on /database
  3. Copied data to the volume, e.g. under /database/mysql
  4. Created image of this setup from AMI web console.

Now, every time I launch this image, I see the volume with all the data is there. I just mount it on /database and things get going.

I am not sure, if this is helpful to you but your problem seemed to close to this.


Update after @NAD's comment

Yeah, AMI creation process excludes stuffs that are under

   /sys
   /proc
   /dev
   /media
   /mnt

So, the trick is to not have stuffs that you want to bundle up with your AMI under these directories.

Also, if you have volume that you want to auto-mount at boot, register it in fstab

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号