Google Cloud Platform – Persistent storage

How to use the Docker Compose command

Persistent storage consists of persistent disks that are durable network storage devices that are mapped to your instance. This logo represents persistent storage:

These disks can be used as regular storage disks and the data stored on them remains on the disk until it is deleted. The data on a persistent disk is redundant and also optimized for performance. Persistent disks are independent of any compute instances (virtual machines), so you can detach and re-attach a persistent disk to another compute instance. If your instance is deleted, your persistent disk data remains if you choose not to delete it. Persistent disks are offered in standard hard disk drives or solid state drives and can be resized at any time. Here is an example of a boot persistent disk for a Debian VM:

A compute engine, by default, gets deployed with one root persistent disk that contains the operating system. You can add more persistent disks when your application needs more disk storage space. The scope of persistent disks is limited to a zone, that is a persistent disk can only exist in one zone in a region and does not span multiple zones or regions. The redundancy, partitioning, and disk management tasks are handled by the compute engine. Instances write data to persistent disks three times in parallel to achieve a high rate of redundancy.

Consider one persistent disk per partition instead of having multiple partitions on a single persistent disk. For additional partitions, add additional persistent disks.

As mentioned earlier, persistent disks are available as both standard hard disk drives and solid state drives (SSD). If your application requires high IOPS, SSD persistent disks are the best to use:

Persistent disks are network-based disks and each write adds to the total network egress cap of your compute virtual machine instance.
  1. To add more persistent disks during virtual machine creation, click on Add item as shown here:
  1. Select Create a disk from the dropdown.
  2. Next, select the type of disk. You can also select an image or a snapshot to deploy the disk from:

You can take snapshots on persistent disks to protect data against user error. Snapshots are incremental and allow you to take backups even while the instance is up and running.

All data is encrypted by the compute engine before it travels outside your virtual machine and is written on the persistent disk. Each persistent disk is encrypted either by the system defined or customer supplied keys. Once you delete a persistent disk, Google discards its cipher keys and that data is irretrievable.

The maximum size of a persistent disk is 64 TB. Most virtual machine instances can have up to a maximum of 64 TB of persistent disk storage space and a maximum of 16 attached disks. Custom machine instances with less than 3.75 GB of memory are limited to 3 TB of total persistent disk space and a maximum of four attached disks. Remember that the total persistent disk space of virtual machines includes the size of the root disk.

Attaching more than 16 persistent disks is available in the beta feature where you can go up to 128 attached persistent disks for predefined machine types.

Another option in persistent disks is to the ability to use local SSDs that are physically attached to the server that hosts your virtual machine instance. Such a design gives you disks with higher throughput and lower latency than the standard or SSD (network based) persistent disks. Local SSDs connect through both SCSI and NVMe interfaces. Using a local SSD also does not count towards your network egress bandwidth cap.

There is a catch that the data on the local SSDs only lasts as long as the instance is up and running. Data will remain in the local SSD if you reboot the instance or if you live migrate the instance. During a live migration, all data from the local SSD is copied to the instance itself and you will notice a performance decrease. If the instance is stopped or deleted, all data is lost.

Local SSDs need to be manually stripped into a single logical volume to achieve best performance. Each local SSD disk is 375 GB in size and you can attach up to 8 local SSD disks to give you a total of 3 TB of storage space per instance.

Comments are closed.