A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://cloud.google.com/compute/docs/disks/add-persistent-disk below:

Create a new Persistent Disk volume | Compute Engine Documentation

Create a new Persistent Disk volume

Stay organized with collections Save and categorize content based on your preferences.

Linux Windows

You can either create a blank Persistent Disk volume, or create a disk from a data source. You can use Persistent Disk as a boot disk for a virtual machine (VM) instance, or as a data disk that you attach to a VM.

This document explains how to create a blank, non-boot zonal Persistent Disk volume and attach it to your VM.

For other types of disk creation and addition, see the following:

Before you begin Restrictions Adding a non-boot disk to your VM

Create and attach a non-boot zonal disk by using the Google Cloud console, the Google Cloud CLI, or REST.

Persistent Disk type variables

The following table lists the reference values of each Persistent Disk type. When you create a Persistent Disk volume with the Google Cloud CLI, REST, or the Cloud Client Libraries for Compute Engine, indicate the Persistent Disk type you want to create by providing its corresponding value from the table.

If you create a disk in the Google Cloud console, the default disk type is pd-balanced. If you create a disk using the gcloud CLI or REST, the default disk type is pd-standard.

Disk type Reference name Balanced Persistent Disk pd-balanced Performance (SSD) Persistent Disk pd-ssd Standard Persistent Disk pd-standard Extreme Persistent Disk pd-extreme

You should specify a custom device name when attaching the disk to a VM. The name you specify is used to generate a symlink for the disk in the guest OS, making identification easier.

Caution: If you add a custom device name to a disk after you attach the disk to a VM, Compute Engine temporarily detaches the disk from the VM, which might disrupt your workloads. Permissions required for this task

To perform this task, you must have the following permissions:

Console
  1. Go to the VM instances page.

    Go to the VM instances page

  2. Click the name of the VM where you want to add a disk.

  3. On the details page, click Edit.

  4. Under Additional disks, click Add new disk.

  5. Specify a name for the disk, configure the disk's properties, and select Blank as the Source type.

  6. Optional: Under the heading Device name, select the option Use a custom device name. The name you enter is used to generate a symlink for the disk, which makes disk identification easier.

  7. Click Done to complete the disk's configuration.

  8. Click Save to apply your changes to the VM and add the new disk.

gcloud
  1. In the Google Cloud console, activate Cloud Shell.

    Activate Cloud Shell

    At the bottom of the Google Cloud console, a Cloud Shell session starts and displays a command-line prompt. Cloud Shell is a shell environment with the Google Cloud CLI already installed and with values already set for your current project. It can take a few seconds for the session to initialize.

  2. Use the gcloud compute disks create command to create the zonal Persistent Disk volume.

    gcloud compute disks create DISK_NAME \
      --size DISK_SIZE \
      --type DISK_TYPE
    

    Replace the following:

  3. After you create the disk, attach it to any running or stopped VM. Use the gcloud compute instances attach-disk command:

    gcloud compute instances attach-disk VM_NAME \
      --disk DISK_NAME --device-name=DEVICE_NAME
    

    Replace the following:

  4. Use the gcloud compute disks describe command to see a description of your disk.

Terraform

To create a disk, use the google_compute_disk resource.

To attach the disk to a VM, use the google_compute_instance resource.

To learn how to apply or remove a Terraform configuration, see Basic Terraform commands.

REST
  1. Construct a POST request to create a zonal Persistent Disk by using the disks.insert method. Include the name, sizeGb, and type properties. To create this disk as an empty and unformatted non-boot disk, don't specify a source image or a source snapshot.

    POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/disks
    
    {
     "name": "DISK_NAME",
     "sizeGb": "DISK_SIZE",
     "type": "DISK_TYPE"
    }
    

    Replace the following:

  2. Construct a POST request to the compute.instances.attachDisk method, and include the URL to the zonal Persistent Disk volume that you just created:

    POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instances/VM_NAME/attachDisk
    
    {
     "source": "/compute/v1/projects/PROJECT_ID/zones/ZONE/disks/DISK_NAME",
     "deviceName": DEVICE_NAME
    }
    

    Replace the following:

After you create the new disk and attach it to a VM, you must format and mount the disk, so that the operating system can use the available storage space.

What's next

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-08-07 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["This document outlines how to create a blank, non-boot zonal Persistent Disk volume and attach it to a virtual machine (VM) instance in Google Cloud."],["Authentication is required to access Google Cloud services and APIs, which can be achieved through the Google Cloud console, gcloud CLI, Terraform, or REST API, each requiring different setup steps."],["When creating a Persistent Disk, users can specify the disk's name, size (ranging from 10 GB to 65,536 GB), and type, with the option to assign a custom device name for easier identification within the guest OS."],["Attaching a created disk to a VM requires specific permissions, including `compute.disks.create`, `compute.instances.attachDisk`, and `compute.disks.use`, and can be done using the Google Cloud console, gcloud CLI, or REST API."],["After attaching a disk to a VM, it is necessary to format and mount it so that the operating system can recognize and utilize the additional storage space."]]],[]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4