Google Cloud snapshots

Google Cloud Nightscout » Snapshots

You can create a snapshot of the virtual machine disk (not free). Then, if you experiment and run into trouble, you can always restore the snapshot to return the disk to the way it was when you created the snapshot. Of course this means any data added to the database since the snapshot was created will be lost also. So, you should use this utility taking into account that consequence.


Create
Let’s go through the steps. Let’s say we have run bootstrap, the first step in installation. And let’s create a snapshot.

When on the Compute Engine page, click on Snapshots in the left pane.

Click on create snapshot at the top.

Select the disk in your virtual machine from the pull-down menu under “Source disk”.

If you have just completed an install phase, you may see nothing under the pull-down menu. Just return to the dashboard and go through the menu items to get back to the snapshot creation page.

Give a name (all lower case) to the snapshot so that you can easily identify it later.

Click on “Create” at the bottom of the page.
Depending on how much data you have on the disk, this could take a different amount of time to complete. For a fresh install with no database imported yet, it take about a minute.

Snapshot cost


Restore Let’s now go through the steps of restoring a snapshot.

WARNING You can have only one machine running in order to satisfy the free tier limits. Therefore, in order to restore a snapshot, you will need to first stop your existing machine. Even if you stop the instance, the disk attached to it may cost you.

Deleting your machine will delete your Nightscout database. If you want to delte a machine, only if you have no data on the machine, or only after you have backed up your database and have copied the backup file from the virtual machine to your real computer, delete the machine on the VM instances tab.

Click on create instance.

Choose region. It’s not enough to choose a free region. It must be the same region the machine in the snapshot was in. Looking at the snapshot, you can see what region the machine was in under the Location heading.

Choose e2-micro for the machine type.

Under boot disk, click on change.
At the top, click on “Snapshots”.

Select the snapshot.
Make sure to change disk type to standard. By default, it is set to balanced. Click on select.

Under firewall options, enable allow http traffic and allow https traffic.

Click on create at the bottom. Wait for the machine to be created.
After the machine is created, click on SSH to open the terminal and see the menu.
Use Status to ensure the free tier settings are satisfied.