views:

58

answers:

2

I've asked this question before, but I am still confused. What's the correct and quickest way to take a snapshot (I only use EBS-backed Unix and Windows machines, so that's all my interest right now). Some ideas:

  • Just take the snapshot... This seems to sometimes cause system corruption.
  • Stop the machine, take the snapshot and then start the machine. I guess this also means I need to wait for each individual task to complete, making scirpting a bit of a challenge?
  • Take a snapshot with the 'reboot machine' flag set. There is very little in the documentation to specify why a reboot is needed...

Hope you EC2 experts can help me.

+1  A: 

If a bit of data loss is acceptable, just take the snapshot while the instance is running. If it's not acceptable, write some script magic to ensure everything your application is working on is saved to disk, take the snapshot, then let your app resume work.

For what I do, I find it best to keep a separate EBS volume with my application and its data on it, and when I need a snapshot, I just stop the app for a moment, snapshot, and fire it back up. That way you don't have to worry about what the OS is doing during the snapshot, and it also comes with the added bonuses of being able to quickly move your app and its data to more powerful hardware, and having much smaller snapshots.

James
A: 

Taking a snapshot often requires scheduled downtime.

Procedure:

  1. I'd unmount the drive.
  2. Start the snapshot and wait until it's done.
  3. And then re-mount it.

Afaik, the only viable way for a consistent snapshot.

If you could share more about what kind of data is on the snapshot (e.g. a database?), then I could probably extend my answer.

I cannot comment on Windows-based instances since I'm not at all familiar with it but in order to avoid redundancy, check out this blog entry explains as it explains a lot:

In a nutshell, they use the xfs file system and when they freeze it to create the snapshot, they allow updates to the filesystem to pass. According to the comments, it seems to work for most people.

Till
I have a Win2k8 and a Fedora app. Both use a local SQL DB. The systems are completely stand-alone, meaning that all components are sitting right on the same EBS volume that Amazon issued to me for the actual OS. There are also a small number of files generated every so often. These are not serious production-type of boxes, but more of a playground environment. So I am happy to accept some data loss/issues as long as snapshot image can be turned on and coninue more or less where I finished. I am just not clear on where I get problems from simply by taking a snapshot?
Snapshot
I am more familiar with Windows, so let me pitch my understanding of that environment... When I start-up my Windows snapshot then it continues to work fine. However, I get the Windows error that "the system was shutdown unexpectedly" with a request to state a reason. It's annoying, but the system acts no different then if someone just rebooted the box. The SQL DB is more or less in the same state, the files that were last closed are all there etc. etc.
Snapshot
Wait, is this instance storage? Or is this an EBS based istance
Till
This is all EBS based. I don't use the instance-store for any project.
Snapshot
I extended my answer with a link.
Till