Is it possible to start Ylastic AMI migration with a script and/or scheduled task?

aty's Avatar

aty

01 Feb, 2012 07:07 PM

Regular AMI migration from region to region is key to our disaster recovery. Right now it can only be done one AMI at a time, and there doesn't seem to be a way to script it or schedule it. Is there an ylastic API we could tap into to script AMI migrations, or any plan to add AMI migrations to scheduled tasks?

Thanks.

  1. Support Staff 1 Posted by Ylastic on 01 Feb, 2012 08:07 PM

    Ylastic's Avatar

    We are working on adding a scheduled task for this. I am assuming that you mean the migration of a EBS instance to another region on a schedule. An AMI would become stale pretty quick. If you point us to a running instance, we can have a task to migrate it to an AMI on a schedule. Am I misunderstanding your q?

    thanks

  2. 2 Posted by aty on 02 Feb, 2012 03:41 PM

    aty's Avatar

    It is for EBS-backed instances, but I am talking about the AMI. We refresh all our AMIs either once every 2 weeks or whenever there’s a significant change on a server.

    We’re mostly a Windows Server environment. We can’t use create AMI with “noreboot” because we need to guarantee the AMI is consistent and we need to detach the data volumes first.

    In order to create an AMI for an instance we do the following:

    1. Stop the instance
    2. Detach the non-system volumes (large data volumes which we don’t included in the AMI)
    3. Create the AMI
    4. Reattach the non-system volumes
    5. Restart the instance

    Step 1-5 are all scripted and we do this for all our servers. Then we migrate all the AMI to another region. This way we have a fresh copy of all our AMI ready to be launched should the main region go down. All the data and data volumes are replicated in real time across regions via other means.

  3. Support Staff 3 Posted by Ylastic on 02 Feb, 2012 11:05 PM

    Ylastic's Avatar

    Found the issue with Tender. For some reason they classified your email as spam, and that is why you were not seeing the replies. Is this your most recent post?

  4. 4 Posted by aty on 02 Feb, 2012 11:12 PM

    aty's Avatar

    Yes it is. Thanks. It looks like Tender didn't like the yahoo email address I used for my ylastic support profile. I used a different email address and it looks like I can post now.

  5. 5 Posted by aty on 03 Feb, 2012 03:24 AM

    aty's Avatar

    Ideally I'd like to leverage your api to initiate the migration of multiple AMIs with a single scheduled task. The task would use a file as input, with one migration request per line, like this:

    ami_id source_region target_region new_ami_name new_ami_description os newami_kernel newami_ramdisk

    for example:

    ami-123456 us-west-1a us-east-1a mynewami "my new description" w2k8r264

  6. Support Staff 6 Posted by Ylastic on 03 Feb, 2012 04:04 AM

    Ylastic's Avatar

    This is an interesting idea. So essentially you would provide a list of migrations to do. But once the task has run at least once, you would need to edit the task again to add new amis to it as the ones in the list have already been migrated?

  7. 7 Posted by aty on 03 Feb, 2012 06:16 AM

    aty's Avatar

    Yes. I would schedule the task using "at" instead of "every" or "cron". Then whenever I have a new batch of migrations to run, I would just update the list of AMIs and change the "at" date and time. I would probably generate the new list of AMI and parameters semi-automatically so it would not be difficult.

    Right now I have about 20-30 AMIs to migrate in each batch. Being able to do this would be a huge time saver compared to starting each migration "by hand" using the web gui, picking the region, the os, etc.

  8. 8 Posted by aty on 03 Feb, 2012 06:36 AM

    aty's Avatar

    Strange. I don't recall making this discussion private.

  9. Support Staff 9 Posted by Ylastic on 03 Feb, 2012 01:31 PM

    Ylastic's Avatar

    Ok. We will add this to our list so we can think this through.

    thanks!

  10. 10 Posted by aty on 03 Feb, 2012 06:57 PM

    aty's Avatar

    Thanks.

  11. Ylastic closed this discussion on 08 Aug, 2014 12:02 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac