|
This document discusses the block storage, commonly referred to as disks or volumes, offered by Compute Engine. You can use block storage for boot and data volumes for all compute instances, including virtual machines (VMs), containers, and bare metal instances. This page discusses how to choose block storage for your compute instances.
The terms disk, volume, and block storage volume are synonymous and are used interchangeably across the documentation, the Google Cloud console, the Google Cloud CLI, and the REST API.
About block storage
Google Cloud offers two types of block storage—temporary and durable block storage. You can combine these block storage types in a single compute instance.
Temporary block storage
Temporary, or ephemeral, block storage offers the fastest performance among all block storage types, with the tradeoff that the stored data is lost if the VM stops for any reason. Data is lost if you stop, suspend, or restart the VM, or if the VM crashes or fails.
Because of its ephemeral nature, use temporary block storage for only
scratch data, caches such as tempdb
for Microsoft SQL Server, or storage for
flash-optimized databases. You can't use temporary block storage as a boot volume.
Local SSD is the temporary block storage offering in Google Cloud. Local SSD disks are physically attached to the server that hosts your instance.
For more information about Local SSD, see the following sections:
- Review Local SSD performance limits
- To learn when Local SSD data is preserved, see Local SSD data persistence
- Supported machine series for Local SSD
- Add Local SSD disks you create a VM
Durable block storage
Durable, or persistent, block storage is for data that you want to preserve after you stop, suspend or delete the VM, or even if the VM crashes or fails.
Hyperdisk and Persistent Disk are the durable block storage offerings in Google Cloud, but Persistent Disk isn't available with the latest machine series. Google recommends using Hyperdisk for the highest performance and advanced features.
Hyperdisk and Persistent Disk volumes have the following characteristics:
Function as physical disks: you can use a Hyperdisk or Persistent Disk volume with compute instance as if it was a physical disk attached to the instance. However, they are network-attached devices that transmit data over Google's networks.
Portability: Hyperdisk or Persistent Disk volumes are independent of the compute instances that you attach them to. This characteristic means you can attach a volume to a running instance without downtime. You can also detach the volume to keep your data even after you delete the instance.
Security: by default, data is encrypted at rest and in transit. You can also customize the encryption with your own keys.
High availability options: protect your data from zonal failures by replicating the volume across two zones.
Differences between Hyperdisk and Persistent Disk
Hyperdisk and Persistent Disk both offer durable, secure, and efficient block storage, but Google recommends using Hyperdisk.
Hyperdisk offers the following key advantages over Persistent Disk:
Customizable performance: You can independently configure the performance and size of each Hyperdisk volume. Hyperdisk performance is independent of provisioned capacity. This feature means that you can increase or decrease a Hyperdisk volume's performance without changing its size.
Unlike Hyperdisk, Persistent Disk performance depends on provisioned capacity. Consequently, to improve a Persistent Disk volume's performance, you must increase its size.
Better overall performance: Hyperdisk has higher IOPS and throughput limits than Persistent Disk.
Choose a type of block storage
To decide between Local SSD, Hyperdisk and Persistent Disk, follow these steps:
Determine whether you need durable or temporary block storage. For example, the boot volume for a compute instance must use durable block storage.
If you need to use temporary block storage, use Local SSD if Local SSD is available for your machine series. If you need durable storage, continue to the next step.
If you need to use durable block storage, use Hyperdisk if it's available for your machine series. If your machine series doesn't support Hyperdisk, use Persistent Disk.
Choose the Hyperdisk or Persistent Disk type that best suits your workload. To learn about the Hyperdisk and Persistent Disk types, see Choose a Hyperdisk type and Persistent Disk types, respectively.
For more information about the features, performance, and durability of Hyperdisk, see About Hyperdisk. For Persistent Disk, see About Persistent Disk.
Alternatives to block storage
In addition to the disks that Google Cloud offers, you can deploy the following alternative storage solutions on your compute instances.
- Create a file server or distributed file system on Compute Engine to use as a network file system with NFSv3 and SMB3 capabilities.
- Mount a RAM disk within the VM memory that offers high throughput and low latency.
To compare block storage with the other storage options available in Google Cloud, such as Cloud Storage and Filestore, see Review the storage options in the Cloud Architecture Center.
Cost considerations
You're billed for the storage capacity provisioned from when you create a volume until you delete the volume. This charge applies to Local SSD, Persistent Disk, and Hyperdisk.
Costs continue to apply through the following scenarios:
- Boot volumes that are created automatically when you create a compute instance
- Durable storage volumes that are attached to a stopped or suspended instance
- Durable storage volumes that aren't attached to any VM
For Hyperdisk and Persistent Disk volumes, you're billed for the network usage required to transfer data between the instance and the volume.
Lastly, for Hyperdisk and Extreme Persistent Disk volumes, you're billed for the provisioned performance.
For example, since Hyperdisk ML volumes support customizing only throughput, you're billed for the provisioned throughput for a Hyperdisk ML volume, but not for the IOPS the volume uses.
However, you're billed for the provisioned IOPS and throughput of Hyperdisk Balanced volumes, because Hyperdisk Balanced volumes support configuring IOPS and throughput.
For more pricing information, see Disk and image pricing.
What's next
View machine series availability for each storage option:
Learn more about each storage option:
Learn how to use each storage option:
- To learn about replication for Hyperdisk and Persistent Disk volumes, see About synchronous disk replication.