Google Cloud Persistent Disk is a high-performance and durable block storage service provided by Google Cloud Platform. It allows you to create and manage disk volumes that can be attached to virtual machine (VM) instances running on Google Compute Engine. Persistent Disk offers a variety of features, including automatic encryption, snapshot capabilities, and support for multiple disk types.
There are majorly three types of persistent disks available in Google Cloud:
- Standard Persistent Disk (HDD)
- SSD Persistent Disk
- Balanced Persistent Disk
Let’s explore each disk type in more detail:
- Standard Persistent Disk (HDD):
- These are magnetic hard disk drives (HDDs) that provide cost-effective storage for workloads with low IOPS (input/output operations per second) and throughput requirements.
- Use cases: Suitable for workloads such as backups, large data storage, or applications that require infrequent access to data.
- Pricing: Standard Persistent Disks are the most affordable option, with costs based on provisioned storage capacity and network egress.
- SSD Persistent Disk:
- These are solid-state drives (SSDs) that offer higher IOPS and lower latency compared to Standard Persistent Disks, providing better performance for I/O-intensive workloads.
- Use cases: Suitable for workloads such as databases, high-performance applications, and analytics workloads that require fast and consistent I/O performance.
- Pricing: SSD Persistent Disks are more expensive than Standard Persistent Disks, with costs based on provisioned storage capacity and network egress.
- Balanced Persistent Disk:
- These disks offer a balance between performance and cost, providing better performance than Standard Persistent Disks at a lower cost than SSD Persistent Disks.
- Use cases: Suitable for workloads that require moderate performance and cost-efficiency, such as web applications, content management systems, and general-purpose databases.
- Pricing: Balanced Persistent Disks are priced between Standard Persistent Disks and SSD Persistent Disks, with costs based on provisioned storage capacity and network egress.
To manage Persistent Disks in Google Cloud, you can use the Google Cloud Console, the gcloud command-line tool, or the Compute Engine API.
Here are some common gcloud commands for working with Persistent Disks:
- Create a Persistent Disk:
Standard Persistent Disk:
gcloud compute disks create DISK_NAME --size DISK_SIZE --type pd-standard --zone ZONE
SSD Persistent Disk:
gcloud compute disks create DISK_NAME --size DISK_SIZE --type pd-ssd --zone ZONE
Balanced Persistent Disk:
gcloud compute disks create DISK_NAME --size DISK_SIZE --type pd-balanced --zone ZONE
- List Persistent Disks:
gcloud compute disks list
- Resize a Persistent Disk:
gcloud compute disks resize DISK_NAME --size NEW_SIZE --zone ZONE
- Delete a Persistent Disk:
gcloud compute disks delete DISK_NAME --zone ZONE
- Snapshot a Persistent Disk:
gcloud compute disks snapshot DISK_NAME --snapshot-names SNAPSHOT_NAME --zone ZONE
- Restore a Persistent Disk from a Snapshot:
gcloud compute disks create NEW_DISK_NAME --source-snapshot SNAPSHOT_NAME --zone ZONE