Warm Disaster recovery on Google Cloud for applications running on-premises

Get Cooking in Cloud

Priyanka Vergadia
Nov 5 · 5 min read

Introduction

“Get Cooking in Cloud” is a blog and video series to help enterprises and developers build business solutions on Google Cloud. In this second miniseries I am covering Disaster Recovery on Google Cloud. Disasters can be pretty hard to deal with when you have an online presence. In this series of blogs, we will elaborate on how to deal with disasters like earthquakes, power outages, floods, fires etc. If you are interested in the prior mini series covered, checkout this.

Here is the plan for the series.

  1. Disaster Recovery Overview
  2. Cold Disaster recovery on Google Cloud for on-premise applications
  3. Warm Disaster recovery on Google Cloud for on-premise applications (This article)
  4. Hot Disaster recovery on Google Cloud for on-premise applications
  5. Cold Disaster recovery for applications in Google Cloud
  6. Cold Disaster recovery for applications in Google Cloud
  7. Warm Disaster recovery for applications in Google Cloud
  8. Hot Disaster recovery for applications in Google Cloud
  9. Disaster recovery on Google Cloud for Data: Part 1
  10. Disaster recovery on Google Cloud for Data: Part 2

In this article, you will learn to set up a Warm DR pattern for your applications that are deployed on-premises. So, read on!

What you’ll learn

  • Warm DR pattern with an example
  • Steps to be taken before a disaster hits
  • Steps to be taken during a disaster
  • Steps to be taken after a disaster

Prerequisites

  • Basic concepts and constructs of Google Cloud so you can recognize the names of the products.
  • Read the overview article before continuing on.

Check out the video

Let’s learn Warm DR pattern with an example

In the last article we talked about Mane-street Art that runs their applications on-premises and are building a DR infrastructure on Google Cloud. And we saw how they would set up a Cold DR plan.

Mane-street Art’s situation has evolved since then, they now need to set up warm standby DR pattern to keep RTO and RPO values as small as possible without the effort and expense of a fully HA configuration. Which means, to support a disaster, they need some replication and redundancy built-in.

Note: If you are unfamiliar with the terms used here (RTO, RPO, DR Patterns) checkout the previous blog to get an overview.

In any DR pattern you need to understand what steps need to be taken before a disaster hits, what happens when a disaster hits and what needs to happen after the disaster has passed.

Warm DR Pattern — How does it work?

Warm DR, steps to be taken before disaster hits
  • Create a VPC network
  • Configure the connectivity between the on-premises network and the Google Cloud network
  • Replicate the on-premise servers to the Compute Engine instances.
  • Create snapshots of the web and application server instances
  • Then Create a custom image of the database server on Google cloud, with same configuration as on-premise.
  • Then start a database instance in google cloud using that custom image and attach Persistent Disk to this instance for Database and transaction logs.
  • Configure replication of the Database server.
  • Set auto delete flag on the persistent disk to no-auto-delete. We do this so that our Persistent disk will not be inadvertently deleted, since that would be a disaster
  • Configure a scheduled task to create regular snapshots of the Persistent disk of the DB instance on Google cloud
  • Then, test the process of creating instances from snapshots by creating the web and application server
  • Also, Create a script that copies updates to the web application and the application server whenever the corresponding on-premise servers are updated. Write the scripts to create a snapshot of the updated servers.
  • Then configure cloud DNS to point to the internet facing web service on-premise.
Warm DR, Steps to be taken when disaster hits
  • When a disaster hits, all Mane-street art needs to do, is to resize the Database server instance to handle the production load.
  • Use the web and application server snapshots to create new web and app server instances
  • Test that it all works
  • Then, finally, point cloud DNS to their web service on Google Cloud
Warm DR, Steps to be taken after the disaster has passed

When the production environment is running on-premises again and can support production workloads, Mane-street art has to reverse the steps that they followed during failover. Typically it goes something like this:

  • Take a backup of the database running on Google cloud.
  • Copy and apply the backup file to the database in the production environment.
  • Prevent connections to the application in Google Cloud.
  • One way to do this is to prevent connections to the web server by modifying the firewall rules.
  • From this point the application will be unavailable until we finish restoring the production environment.
  • Don’t forget to Copy any transaction log files over to the production environment and apply to the database in the production environment.
  • Test that the application works as expected by simulating user scenarios on the production environment.
  • Configure Cloud DNS to point to the on-premises web service.
  • Delete the web server and application server instances that are running in Google Cloud. Leave the reference servers running.
  • Resize the database server on Google cloud back to the minimum instance size that can accept replicated data from the on-premises production database.
  • Configure replication between the on-premises database server and the database server in Google Cloud by following the instructions for your specific database software.

Conclusion

If you are running your application on premise, and need to keep the RTO and RPO values as small as possible without the expense of a fully HA configuration, then a Warm DR pattern is the way to go. We learned how to approach recovering the environment from failure in a Warm DR scenario. Stay tuned for upcoming articles, where you will learn to set up more DR patterns that make sense for your business.

Next steps

Google Cloud Platform - Community

A collection of technical articles published or curated by Google Cloud Platform Developer Advocates. The views expressed are those of the authors and don't necessarily reflect those of Google.

Priyanka Vergadia

Written by

Developer Advocate @Google, Artist & Traveler!

Google Cloud Platform - Community

A collection of technical articles published or curated by Google Cloud Platform Developer Advocates. The views expressed are those of the authors and don't necessarily reflect those of Google.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade