Course contentsShow
← Cloud and Infrastructure
Lesson 128 of 2,9893. Storage PrimitivesFree lesson

Creating and Attaching Volumes

How to provision block storage volumes and attach them to compute instances across cloud providers.

Creating and Attaching Volumes

What you'll learn: How to provision a block storage volume and connect it to a running compute instance.

The Process in Plain English

Creating and attaching block storage volumes is like buying an external hard drive and plugging it into your computer. First, you create the volume by specifying its size, performance tier (remember those IOPS and throughput metrics?), and which data center zone it lives in. Then you attach it to a running VM instance, making the storage available to that machine.

The key constraint: volumes must be in the same availability zone as the VM they attach to. A volume in US-East-1a cannot attach to a VM in US-East-1b—they need to be neighbors.

The Two-Step Workflow

Step 1: Create the Volume
You specify size (e.g., 100 GB), volume type (general purpose SSD, provisioned IOPS, etc.), and location. The cloud provider provisions this persistent block storage separately from any VM.

Step 2: Attach to Instance
You select the volume and the target VM, then attach. The cloud platform creates a connection, and the volume appears as a raw block device to the operating system (like /dev/xvdf on Linux or a new disk in Windows Disk Management).

After attachment, you still need to format the volume with a filesystem and mount it—but that's an OS-level task, not a cloud control plane operation.

Cross-Provider Similarity

All major providers follow this create-then-attach pattern: AWS EBS volumes, Azure Managed Disks, and GCP Persistent Disks work nearly identically at this fundamental level.

Key Takeaway: Creating a volume provisions persistent block storage; attaching it connects that storage to a VM, making it available as a raw block device that still needs formatting and mounting at the OS level.