Creating AMIs using Aminator, just plain AMI without applying any puppet/chef/ansible module

204 views
Skip to first unread message

Ravi Hemnani

unread,
Dec 22, 2014, 8:12:03 AM12/22/14
to amin...@googlegroups.com
Hey,

So my question here is, I have an base-ami (ami-xxxxxxxx) of a production server. The data on the production server updates everyday and I want to create a fresh AMI out of it and delete the old AMI. Can this be done by Aminator ?

So I dont want to apply any puppet module. Just create a fresh AMI out of the production server using Aminator.

I know we can normally do it by creating the snapshot of the block device of the production server and creating an AMI out of it but for that i would have to reboot the production server for all he data to come accurately. Will Aminator help in this case?


Regards,

Ravi. 

Brian Moyles

unread,
Dec 22, 2014, 12:51:21 PM12/22/14
to Ravi Hemnani, amin...@googlegroups.com
That's not really what Aminator was intended to do. Rather than create a snapshot, you could use the ec2-create-image (aws ec2 create-image from awscli) command to create an AMI directly from a running instance. 
If you choose the snapshot route, depending on the OS, you could possibly quiesce the filesystem prior to snapshot and unfreeze it once the snapshot command returns. Linux has the 'fsfreeze' command for doing that sort of thing (on ext3/4, xfs, reiser, and jfs), and you can use something like dmsetup to freeze/unfreeze a LVM volume if that's in play...
That'll ensure the snapshot you've got is consistent and you can safely turn it into an AMI at a later date w/ ec2-register-image.


--
You received this message because you are subscribed to the Google Groups "Aminator" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aminator+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Peter Sankauskas

unread,
Dec 23, 2014, 12:26:27 PM12/23/14
to amin...@googlegroups.com, raviii...@gmail.com
Right.

For performing just the snapshot part, and keeping those on rotation (i.e. keep only the last 7 of them), you can take a look at Backup Monkey:


Modifying it to register the AMI should be just a few lines of code.

--
Peter Sankauskas

Ravi Hemnani

unread,
Dec 26, 2014, 5:05:59 AM12/26/14
to Peter Sankauskas, amin...@googlegroups.com
Thank you for the suggestion. 

Did the same thing, wrote a script to create AMIs daily. Simple and better that way.
Reply all
Reply to author
Forward
0 new messages