GCP Cloud Endure is a new free tool from Google that provides continuous scanning and replication to GCloud Compute Engine virtual machines. The tool uses the same technology as the Google Compute Engine (GCE) auto-scaling feature, but it can be used with instances outside of GCE.

It can also be used for non-auto-scaling instances. You can download it from here: gcloud beta endure start –help You can read more about it here: GCP Cloud Endure There is also a short video with more information in this post: GCP Cloud Endure Video Tutorial – Replication of Virtual Machines in Google Cloud Platform Compute Engine

Step 1 – Enable Endure for your virtual machine Before you go ahead and run the command to start the Endure tool, you need to make sure that you have enabled replication for your instance. The only thing that needs to be done is to set a couple of parameters in a GCloud metadata file. # Create or edit a metadata file for this VM, and set # an “endure” property with “replication”: true. gcloud compute instances add-metadata [INSTANCE_NAME] \ –metadata endure=replication:true # Or use the gcloud compute instance create command: # gcloud compute instances create [INSTANCE_NAME] \ –metadata endure=replication:true –zone=[ZONE] \ [–metadata-from-file file=[PATH_TO_FILE]] # Then, enable replication on this instance: gcloud compute instances set-metadata [INSTANCE_NAME] –metadata ‘endure’ = ‘replication’:true 1 #

Create or edit a metadata file for this VM, and set # an “endure” property with “replication”: true. gcloud compute instances add – metadata [ INSTANCE_NAME ] \ — metadata endure = replication : true #

Or use the gcloud compute instance create command: # gcloud compute instances create [INSTANCE_NAME] \ — metadata endure = replication : true — zone = [ ZONE ] \ [ — metadata – from – file file = [ PATH_TO _ FILE ] ] #

Then, enable replication on this instance: gcloud compute instances set – metadata [ INSTANCE_NAME ] — metadata ‘endure’ = ‘replication’:true You can read more about it here: GCP Endure prerequisites

Step 2 – Start the scan and replication in Google Compute Platform with Endure tool With the instance metadata set up, you can then run the following command to start the scan: gcloud beta endure start –project=[PROJECT_ID] \ –zone=[ZONE] \ –metadata-from-file=metadata.json –instance-id=[INSTANCE_ID] 1 2 3 4 gcloud beta endure start — project = [ PROJECT_ID ] \ — zone = [ ZONE ] \ — metadata – from – file = metadata . json — instance – id = [ INSTANCE_ID ] This will run an initial replica on the instance. If you want to replicate only a subset of disks and don’t want to replicate all disks, add an option for that as well: e.g.: “–metadata-from-file=metadata.json –replicas=1” to replicate only disk 1 and “–metadata-from-file=metadata.json –replicas=2:3” to replicate disks 2, 3 while skipping disk 4.

The output of this command should be something like this (depending on which disk it replicates): And now you can go ahead and create your snapshot or replication target.

Step 3 – Create a snapshot of the virtual machine in Google Compute Platform with Endure tool If you are going to use snapshots for disaster recovery, you will need a snapshot of your instance before the initial replica is created. If you are using replication for DR, then you will not need this step. You can skip to step 4. You can create a new snapshot by running this command: gcloud compute snapshots create [SNAPSHOT_NAME] \ –snapshot-name=[SNAPSHOT_NAME] \ –zone=[ZONE] \ –snapshot-template=[TEMPLATE_NAME] 1 2 3 4 5 gcloud compute snapshots create [ SNAPSHOT_NAME ] \ — snapshot – name = [ SNAPSHOT_NAME ] \ — zone = [ ZONE ] \ — snapshot – template = [ TEMPLATE _ NAME ]

You can read more about it here: GCP Endure prerequisites.

Step 4 – Create a replication target in Google Compute Platform with Endure tool After you have created a snapshot, you can now use it as a replication target. Make sure that your virtual machine has been shut down. Run the following command to start replicating: gcloud beta endure start –project=[PROJECT_ID] \ –zone=[ZONE] \ –snapshot-[SNAPSHOT_NAME] 1 2 3 4 gcloud beta endure start — project = [ PROJECT_ID ] \ — zone = [ ZONE ] \ — snapshot – [ SNAPSHOT _ NAME ] The output will look something like this: You can read more about it here: GCP Endure prerequisites.

Step 5 – Check the replication in Google Compute Platform with Endure tool If you want to check what has been replicated, you can use the following command: gcloud beta endure list 1 2 gcloud beta endure list The output will look something like this: You can read more about it here: GCP Endure prerequisites.

Conclusion: Google Compute Platform is a great tool, and the new GCP Endure tool is a great addition to it. If you are looking for DR or backup solutions in Google Cloud Platform, I would definitely recommend checking this one out.


Marco Lopes

Excessive Crafter of Things

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *