VMware Cloud Community
shane_presley
Enthusiast
Enthusiast
Jump to solution

Snapshots of servers with databases -- how stable is it?

If you take a hot snapshot of a VM that has a database running in it, how stable will the snapshot be?

For example, we use a RedHat guest with Apache and MySQL installed on it. Lets say we take a snapshot, and then need to revert to that snapshot. Wouldn't MySQL have corrupt databases, since we didn't put the database into hot backup mode when the snapshot was made?

Or is there more "magic" to snapshots that I'm missing?

Tags (3)
Reply
0 Kudos
1 Solution

Accepted Solutions
ctfoster
Expert
Expert
Jump to solution

When a snapshot occurs the OS is forced to flush any writes still held in memory to disc before the snap is made. This sounds good (and it is) but its not a subsitute for a graceful shutdown. As a consequence any snap is only 'crash consistant' and does not guarantee the integrity of the image.

More importantly, even with the buffers flushed, the action has no idea whether an application such as Exchange or MySQL or any other transaction based application such as AD is in a consistant state when the snap is made. You take pot luck on this. Chances are most application will be able to rollback to a consistant point as they recover after a reboot... but there is always a risk. There is an option to run a pre-freeze script on the host to force the apps into a consistant state before the snap occurs, but this may result on a loss of service to the users.

View solution in original post

Reply
0 Kudos
2 Replies
philvirt
Hot Shot
Hot Shot
Jump to solution

You have to verify that mySQL doesn't need to be put in an altered database mode in order to prevent database corruption. If not, then you should be OK.

Regards,

Fil

Thanks, phIL
ctfoster
Expert
Expert
Jump to solution

When a snapshot occurs the OS is forced to flush any writes still held in memory to disc before the snap is made. This sounds good (and it is) but its not a subsitute for a graceful shutdown. As a consequence any snap is only 'crash consistant' and does not guarantee the integrity of the image.

More importantly, even with the buffers flushed, the action has no idea whether an application such as Exchange or MySQL or any other transaction based application such as AD is in a consistant state when the snap is made. You take pot luck on this. Chances are most application will be able to rollback to a consistant point as they recover after a reboot... but there is always a risk. There is an option to run a pre-freeze script on the host to force the apps into a consistant state before the snap occurs, but this may result on a loss of service to the users.

Reply
0 Kudos