Membuat kumpulan Hyperdisk

Dokumen ini menjelaskan cara membuat kumpulan Hyperdisk. Gabungan Hyperdisk adalah resource block storage yang membantu Anda mengelola resource block storage Hyperdisk secara agregat. Kumpulan Hyperdisk tersedia dalam varian berikut:

  • Hyperdisk Storage Pools: direkomendasikan untuk sebagian besar workload
  • Hyperdisk Exapools: direkomendasikan untuk workload yang sangat besar yang memerlukan performa serentak lebih dari 100 GiB/s

Untuk mempelajari berbagai jenis kumpulan Hyperdisk, lihat Ringkasan kumpulan Hyperdisk.

Sebelum memulai

  • Siapkan autentikasi jika Anda belum melakukannya. Autentikasi memverifikasi identitas Anda untuk mengakses layanan Google Cloud dan API. Untuk menjalankan kode atau contoh dari lingkungan pengembangan lokal, Anda dapat mengautentikasi ke Compute Engine dengan memilih salah satu opsi berikut:

    Select the tab for how you plan to use the samples on this page:

    Console

    When you use the Google Cloud console to access Google Cloud services and APIs, you don't need to set up authentication.

    gcloud

    1. Instal Google Cloud CLI. Setelah penginstalan, inisialisasi Google Cloud CLI dengan menjalankan perintah berikut:

      gcloud init

      Jika Anda menggunakan penyedia identitas (IdP) eksternal, Anda harus login ke gcloud CLI dengan identitas gabungan Anda terlebih dahulu.

    2. Set a default region and zone.

    Go

    Untuk menggunakan contoh Go di halaman ini dalam lingkungan pengembangan lokal, instal dan lakukan inisialisasi gcloud CLI, lalu siapkan Kredensial Default Aplikasi dengan kredensial pengguna Anda.

      Instal Google Cloud CLI.

      Jika Anda menggunakan penyedia identitas (IdP) eksternal, Anda harus login ke gcloud CLI dengan identitas gabungan Anda terlebih dahulu.

      If you're using a local shell, then create local authentication credentials for your user account:

      gcloud auth application-default login

      You don't need to do this if you're using Cloud Shell.

      If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.

    Untuk informasi selengkapnya, lihat Set up authentication for a local development environment.

    Java

    Untuk menggunakan contoh Java di halaman ini dalam lingkungan pengembangan lokal, instal dan lakukan inisialisasi gcloud CLI, lalu siapkan Kredensial Default Aplikasi dengan kredensial pengguna Anda.

      Instal Google Cloud CLI.

      Jika Anda menggunakan penyedia identitas (IdP) eksternal, Anda harus login ke gcloud CLI dengan identitas gabungan Anda terlebih dahulu.

      If you're using a local shell, then create local authentication credentials for your user account:

      gcloud auth application-default login

      You don't need to do this if you're using Cloud Shell.

      If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.

    Untuk informasi selengkapnya, lihat Set up authentication for a local development environment.

    Node.js

    Untuk menggunakan contoh Node.js di halaman ini dalam lingkungan pengembangan lokal, instal dan lakukan inisialisasi gcloud CLI, lalu siapkan Kredensial Default Aplikasi dengan kredensial pengguna Anda.

      Instal Google Cloud CLI.

      Jika Anda menggunakan penyedia identitas (IdP) eksternal, Anda harus login ke gcloud CLI dengan identitas gabungan Anda terlebih dahulu.

      If you're using a local shell, then create local authentication credentials for your user account:

      gcloud auth application-default login

      You don't need to do this if you're using Cloud Shell.

      If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.

    Untuk informasi selengkapnya, lihat Set up authentication for a local development environment.

    REST

    Untuk menggunakan contoh REST API di halaman ini dalam lingkungan pengembangan lokal, gunakan kredensial yang Anda berikan ke gcloud CLI.

      Instal Google Cloud CLI.

      Jika Anda menggunakan penyedia identitas (IdP) eksternal, Anda harus login ke gcloud CLI dengan identitas gabungan Anda terlebih dahulu.

    Untuk mengetahui informasi selengkapnya, lihat Melakukan autentikasi untuk menggunakan REST dalam dokumentasi autentikasi Google Cloud .

Peran dan izin yang diperlukan

Untuk mendapatkan izin yang Anda perlukan untuk membuat kumpulan Hyperdisk, minta administrator untuk memberi Anda peran IAM berikut di project:

  • Compute Instance Admin (v1) (roles/compute.instanceAdmin.v1)
  • Untuk terhubung ke instance VM yang dapat dijalankan sebagai akun layanan: Service Account User (v1) (peran roles/iam.serviceAccountUser)

Untuk mengetahui informasi selengkapnya tentang pemberian peran, lihat Mengelola akses ke project, folder, dan organisasi.

Peran bawaan ini berisi izin yang diperlukan untuk membuat kumpulan Hyperdisk. Untuk melihat izin yang benar-benar diperlukan, perluas bagian Izin yang diperlukan:

Izin yang diperlukan

Izin berikut diperlukan untuk membuat kumpulan Hyperdisk:

  • compute.storagePools.create di project
  • compute.storagePools.setLabels di project

Anda mungkin juga bisa mendapatkan izin ini dengan peran khusus atau peran bawaan lainnya.

Batasan

Batasan berikut berlaku saat Anda membuat Gabungan Penyimpanan Hyperdisk:

Batas resource:

  • Anda dapat membuat Hyperdisk Storage Pool dengan kapasitas yang disediakan hingga 5 PiB.
  • Anda dapat membuat maksimal 5 Kumpulan Penyimpanan per jam.
  • Anda dapat membuat maksimal 10 Kumpulan Penyimpanan per hari.
  • Anda dapat membuat maksimal 10 Kumpulan Penyimpanan per project.
  • Anda tidak dapat mengubah model penyediaan untuk pool. Misalnya, Anda tidak dapat mengubah Penyimpanan Gabungan berkapasitas Standar menjadi Penyimpanan Gabungan berkapasitas Lanjutan atau Penyimpanan Gabungan berperforma Lanjutan menjadi Penyimpanan Gabungan berperforma Standar.
  • Pool adalah resource zona.
  • Anda dapat membuat hingga 10.000 disk di Kumpulan Penyimpanan.
  • Anda hanya dapat menggunakan Gabungan Penyimpanan Hyperdisk dengan Compute Engine. Instance Cloud SQL tidak dapat menggunakan Gabungan Penyimpanan Hyperdisk.
  • Anda dapat mengubah kapasitas atau performa yang disediakan untuk Kumpulan Penyimpanan maksimal dua kali dalam periode 24 jam.
  • Anda hanya dapat membuat disk Hyperdisk Balanced di pool Hyperdisk Balanced, dan Anda hanya dapat membuat disk Hyperdisk Throughput di pool Hyperdisk Throughput
  • Anda harus menghubungi tim akun untuk mengubah kapasitas, IOPS, atau throughput yang disediakan dari Exapool.
  • Anda harus menghubungi tim akun Anda untuk menghapus Exapool.

Batas untuk disk di Kumpulan Penyimpanan:

  • Hanya disk baru di project dan zona yang sama yang dapat dibuat di pool.
  • Anda tidak dapat memindahkan disk ke dalam atau ke luar pool. Untuk memindahkan disk ke dalam atau ke luar pool, Anda harus membuat ulang disk dari snapshot. Untuk mengetahui informasi selengkapnya, lihat Mengubah jenis disk.
  • Untuk membuat disk boot di pool, Anda harus menggunakan Hyperdisk Balanced Storage Pool atau Hyperdisk Balanced Exapool.
  • Pool tidak mendukung disk regional.
  • Anda tidak dapat meng-clone, membuat snapshot instan, atau mengonfigurasi Replikasi Asinkron untuk disk di pool.

Rentang kapasitas dan batas performa yang disediakan

Saat Anda membuat Penyimpanan Gabungan, kapasitas, IOPS, dan throughput yang disediakan tidak boleh melebihi batas yang dijelaskan dalam Batas untuk gabungan.

Membuat Penyimpanan Gabungan Hyperdisk

Untuk membuat Kumpulan Penyimpanan Hyperdisk baru, gunakan Google Cloud konsol, Google Cloud CLI, atau REST. Anda harus menentukan properti berikut saat membuat Kumpulan Penyimpanan:

  • Zona
  • Jenis Kumpulan Penyimpanan
  • Model penyediaan kapasitas
  • Kapasitas yang disediakan gabungan
  • Jenis penyediaan performa
  • IOPS dan throughput yang disediakan pool

Konsol

  1. Buka halaman Create a storage pool di konsol Google Cloud .
    Buka halaman Create Storage Pool
  2. Di kolom Name, masukkan nama unik untuk Storage Pool.
  3. Opsional: Di kolom Description, masukkan deskripsi untuk Kumpulan Penyimpanan.
  4. Pilih Region dan Zone tempat Anda ingin membuat Storage Pool.
  5. Pilih nilai untuk Jenis pool penyimpanan.
  6. Pilih jenis penyediaan di kolom Jenis kapasitas dan tentukan kapasitas yang akan disediakan untuk Kumpulan Penyimpanan di kolom Kapasitas kumpulan penyimpanan. Anda dapat menentukan ukuran dari 10 TiB hingga 1 PiB.

    Untuk membuat pool penyimpanan dengan kapasitas besar, Anda mungkin harus meminta penyesuaian kuota.

  7. Pilih jenis penyediaan di kolom Jenis performa. Anda dapat menggunakan jenis penyediaan berikut dengan Gabungan Penyimpanan Hyperdisk:

    • Kapasitas standar: Kapasitas yang disediakan untuk setiap disk yang dibuat di Kumpulan Penyimpanan dikurangi dari total kapasitas yang disediakan di Kumpulan Penyimpanan.
    • Kapasitas lanjutan: Storage Pool diuntungkan dari penyediaan tipis dan pengurangan data. Hanya jumlah data yang benar-benar ditulis yang dikurangi dari total kapasitas yang disediakan untuk Kumpulan Penyimpanan.
    • Performa standar: Performa yang disediakan untuk setiap disk yang dibuat di Kumpulan Penyimpanan dikurangi dari total performa yang disediakan untuk Kumpulan Penyimpanan.
    • Performa lanjutan: Performa yang disediakan untuk setiap disk diuntungkan dari penyediaan tipis. Hanya jumlah performa yang digunakan oleh disk yang dikurangi dari total performa yang disediakan di Kumpulan Penyimpanan.
  8. Untuk Penyimpanan Gabungan Hyperdisk Balanced, di kolom IOPS yang disediakan, masukkan IOPS yang akan disediakan untuk Penyimpanan Gabungan.

  9. Untuk Hyperdisk Throughput Storage Pool atau Hyperdisk Balanced Storage Pool, di kolom Throughput yang disediakan, masukkan throughput yang akan disediakan untuk Storage Pool.

  10. Klik Submit untuk membuat Storage Pool.

gcloud

Untuk membuat Gabungan Penyimpanan Hyperdisk, gunakan perintah gcloud compute storage-pools create.

gcloud compute storage-pools create NAME  \
    --zone=ZONE   \
    --storage-pool-type=STORAGE_POOL_TYPE   \
    --capacity-provisioning-type=CAPACITY_TYPE \
    --provisioned-capacity=POOL_CAPACITY   \
    --performance-provisioning-type=PERFORMANCE_TYPE \
    --provisioned-iops=IOPS   \
    --provisioned-throughput=THROUGHPUT   \
    --description=DESCRIPTION

Ganti kode berikut:

  • NAME: nama Storage Pool yang unik.
  • ZONE: zona tempat untuk membuat Storage Pool, misalnya, us-central1-a.
  • STORAGE_POOL_TYPE: jenis disk yang akan disimpan di Storage Pool. Nilai yang diizinkan adalah hyperdisk-throughput dan hyperdisk-balanced.
  • CAPACITY_TYPE: Opsional: jenis penyediaan kapasitas Storage Pool. Nilai yang diizinkan adalah advanced dan standard. Jika tidak ditentukan, nilai advanced akan digunakan.
  • POOL_CAPACITY: total kapasitas yang akan disediakan untuk Kumpulan Penyimpanan baru, yang ditentukan dalam GiB secara default.
  • PERFORMANCE_TYPE: Opsional: jenis penyediaan performa Storage Pool. Nilai yang diizinkan adalah advanced dan standard. Jika tidak ditentukan, nilai advanced akan digunakan.
  • IOPS: IOPS yang akan disediakan untuk Pool Penyimpanan. Anda hanya dapat menggunakan flag ini dengan Hyperdisk Balanced Storage Pools.
  • THROUGHPUT: throughput dalam MBps yang akan disediakan untuk Storage Pool.
  • DESCRIPTION: Opsional: string teks yang mendeskripsikan Storage Pool.

REST

Buat permintaan POST untuk membuat Gabungan Penyimpanan Hyperdisk menggunakan metode storagePools.insert.

POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/storagePools

{
    "name": "NAME",
    "description": "DESCRIPTION",
    "poolProvisionedCapacityGb": "POOL_CAPACITY",
    "storagePoolType": "projects/PROJECT_ID/zones/ZONE/storagePoolTypes/STORAGE_POOL_TYPE",
    "poolProvisionedIops": "IOPS",
    "poolProvisionedThroughput": "THROUGHPUT",
    "capacityProvisioningType": "CAPACITY_TYPE",
    "performanceProvisioningType": "PERFORMANCE_TYPE"
}

Ganti kode berikut:

  • PROJECT_ID: the project ID
  • ZONE: zona tempat untuk membuat Storage Pool, misalnya, us-central1-a.
  • NAME: nama unik untuk Storage Pool .
  • DESCRIPTION: Opsional: string teks yang mendeskripsikan Storage Pool.
  • POOL_CAPACITY: total kapasitas yang akan disediakan untuk Kumpulan Penyimpanan baru, yang ditentukan dalam GiB secara default.
  • STORAGE_POOL_TYPE: jenis disk yang akan disimpan di Storage Pool. Nilai yang diizinkan adalah hyperdisk-throughput dan hyperdisk-balanced.
  • IOPS: Opsional: IOPS yang akan disediakan untuk Pool Penyimpanan. Anda hanya dapat menggunakan flag ini dengan Hyperdisk Balanced Storage Pools.
  • THROUGHPUT: Opsional: Throughput dalam MBps yang akan disediakan untuk Pool Penyimpanan.
  • CAPACITY_TYPE: Opsional: jenis penyediaan kapasitas Storage Pool. Nilai yang diizinkan adalah advanced dan standard. Jika tidak ditentukan, nilai advanced akan digunakan.
  • PERFORMANCE_TYPE: Opsional: jenis penyediaan performa Storage Pool. Nilai yang diizinkan adalah advanced dan standard. Jika tidak ditentukan, nilai advanced akan digunakan.

Go


// createHyperdiskStoragePool creates a new Hyperdisk storage pool in the specified project and zone.
func createHyperdiskStoragePool(w io.Writer, projectId, zone, storagePoolName, storagePoolType string) error {
	// projectID := "your_project_id"
	// zone := "europe-west4-b"
	// storagePoolName := "your_storage_pool_name"
	// storagePoolType := "projects/**your_project_id**/zones/europe-west4-b/diskTypes/hyperdisk-balanced"

	ctx := context.Background()
	client, err := compute.NewStoragePoolsRESTClient(ctx)
	if err != nil {
		return fmt.Errorf("NewStoragePoolsRESTClient: %v", err)
	}
	defer client.Close()

	// Create the storage pool resource
	resource := &computepb.StoragePool{
		Name:                        proto.String(storagePoolName),
		Zone:                        proto.String(zone),
		StoragePoolType:             proto.String(storagePoolType),
		CapacityProvisioningType:    proto.String("advanced"),
		PerformanceProvisioningType: proto.String("advanced"),
		PoolProvisionedCapacityGb:   proto.Int64(10240),
		PoolProvisionedIops:         proto.Int64(10000),
		PoolProvisionedThroughput:   proto.Int64(1024),
	}

	// Create the insert storage pool request
	req := &computepb.InsertStoragePoolRequest{
		Project:             projectId,
		Zone:                zone,
		StoragePoolResource: resource,
	}

	// Send the insert storage pool request
	op, err := client.Insert(ctx, req)
	if err != nil {
		return fmt.Errorf("Insert storage pool request failed: %v", err)
	}

	// Wait for the insert storage pool operation to complete
	if err = op.Wait(ctx); err != nil {
		return fmt.Errorf("unable to wait for the operation: %w", err)
	}

	// Retrieve and return the created storage pool
	storagePool, err := client.Get(ctx, &computepb.GetStoragePoolRequest{
		Project:     projectId,
		Zone:        zone,
		StoragePool: storagePoolName,
	})
	if err != nil {
		return fmt.Errorf("Get storage pool request failed: %v", err)
	}

	fmt.Fprintf(w, "Hyperdisk Storage Pool created: %v\n", storagePool.GetName())
	return nil
}

Java

import com.google.cloud.compute.v1.InsertStoragePoolRequest;
import com.google.cloud.compute.v1.Operation;
import com.google.cloud.compute.v1.StoragePool;
import com.google.cloud.compute.v1.StoragePoolsClient;
import java.io.IOException;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

public class CreateHyperdiskStoragePool {
  public static void main(String[] args)
          throws IOException, ExecutionException, InterruptedException, TimeoutException {
    // TODO(developer): Replace these variables before running the sample.
    // Project ID or project number of the Google Cloud project you want to use.
    String projectId = "YOUR_PROJECT_ID";
    // Name of the zone in which you want to create the storagePool.
    String zone = "us-central1-a";
    // Name of the storagePool you want to create.
    String storagePoolName = "YOUR_STORAGE_POOL_NAME";
    // The type of disk you want to create.
    // Storage types can be "hyperdisk-throughput" or "hyperdisk-balanced"
    String storagePoolType = String.format(
        "projects/%s/zones/%s/storagePoolTypes/hyperdisk-balanced", projectId, zone);
    // Optional: the capacity provisioning type of the storage pool.
    // The allowed values are advanced and standard. If not specified, the value advanced is used.
    String capacityProvisioningType = "advanced";
    // The total capacity to provision for the new storage pool, specified in GiB by default.
    long provisionedCapacity = 128;
    // the IOPS to provision for the storage pool.
    // You can use this flag only with Hyperdisk Balanced Storage Pools.
    long provisionedIops = 3000;
    // the throughput in MBps to provision for the storage pool.
    long provisionedThroughput = 140;
    // The allowed values are low-casing strings "advanced" and "standard".
    // If not specified, "advanced" is used.
    String performanceProvisioningType = "advanced";

    createHyperdiskStoragePool(projectId, zone, storagePoolName, storagePoolType,
            capacityProvisioningType, provisionedCapacity, provisionedIops,
        provisionedThroughput, performanceProvisioningType);
  }

  // Creates a hyperdisk storagePool in a project
  public static StoragePool createHyperdiskStoragePool(String projectId, String zone,
        String storagePoolName, String storagePoolType, String capacityProvisioningType,
        long capacity, long iops, long throughput, String performanceProvisioningType)
          throws IOException, ExecutionException, InterruptedException, TimeoutException {
    // Initialize client that will be used to send requests. This client only needs to be created
    // once, and can be reused for multiple requests.
    try (StoragePoolsClient client = StoragePoolsClient.create()) {
      // Create a storagePool.
      StoragePool resource = StoragePool.newBuilder()
              .setZone(zone)
              .setName(storagePoolName)
              .setStoragePoolType(storagePoolType)
              .setCapacityProvisioningType(capacityProvisioningType)
              .setPoolProvisionedCapacityGb(capacity)
              .setPoolProvisionedIops(iops)
              .setPoolProvisionedThroughput(throughput)
              .setPerformanceProvisioningType(performanceProvisioningType)
              .build();

      InsertStoragePoolRequest request = InsertStoragePoolRequest.newBuilder()
              .setProject(projectId)
              .setZone(zone)
              .setStoragePoolResource(resource)
              .build();

      // Wait for the insert disk operation to complete.
      Operation operation = client.insertAsync(request).get(1, TimeUnit.MINUTES);

      if (operation.hasError()) {
        System.out.println("StoragePool creation failed!");
        throw new Error(operation.getError().toString());
      }

      // Wait for server update
      TimeUnit.SECONDS.sleep(10);

      StoragePool storagePool = client.get(projectId, zone, storagePoolName);

      System.out.printf("Storage pool '%s' has been created successfully", storagePool.getName());

      return storagePool;
    }
  }
}

Node.js

// Import the Compute library
const computeLib = require('@google-cloud/compute');
const compute = computeLib.protos.google.cloud.compute.v1;

// Instantiate a storagePoolClient
const storagePoolClient = new computeLib.StoragePoolsClient();
// Instantiate a zoneOperationsClient
const zoneOperationsClient = new computeLib.ZoneOperationsClient();

/**
 * TODO(developer): Update/uncomment these variables before running the sample.
 */
// Project ID or project number of the Google Cloud project you want to use.
const projectId = await storagePoolClient.getProjectId();
// Name of the zone in which you want to create the storagePool.
const zone = 'us-central1-a';
// Name of the storagePool you want to create.
// storagePoolName = 'storage-pool-name';
// The type of disk you want to create. This value uses the following format:
// "projects/{projectId}/zones/{zone}/storagePoolTypes/(hyperdisk-throughput|hyperdisk-balanced)"
const storagePoolType = `projects/${projectId}/zones/${zone}/storagePoolTypes/hyperdisk-balanced`;
// Optional: The capacity provisioning type of the storage pool.
// The allowed values are advanced and standard. If not specified, the value advanced is used.
const capacityProvisioningType = 'advanced';
// The total capacity to provision for the new storage pool, specified in GiB by default.
const provisionedCapacity = 10240;
// The IOPS to provision for the storage pool.
// You can use this flag only with Hyperdisk Balanced Storage Pools.
const provisionedIops = 10000;
// The throughput in MBps to provision for the storage pool.
const provisionedThroughput = 1024;
// Optional: The performance provisioning type of the storage pool.
// The allowed values are advanced and standard. If not specified, the value advanced is used.
const performanceProvisioningType = 'advanced';

async function callCreateComputeHyperdiskPool() {
  // Create a storagePool.
  const storagePool = new compute.StoragePool({
    name: storagePoolName,
    poolProvisionedCapacityGb: provisionedCapacity,
    poolProvisionedIops: provisionedIops,
    poolProvisionedThroughput: provisionedThroughput,
    storagePoolType,
    performanceProvisioningType,
    capacityProvisioningType,
    zone,
  });

  const [response] = await storagePoolClient.insert({
    project: projectId,
    storagePoolResource: storagePool,
    zone,
  });

  let operation = response.latestResponse;

  // Wait for the create storage pool operation to complete.
  while (operation.status !== 'DONE') {
    [operation] = await zoneOperationsClient.wait({
      operation: operation.name,
      project: projectId,
      zone: operation.zone.split('/').pop(),
    });
  }

  console.log(`Storage pool: ${storagePoolName} created.`);
}

await callCreateComputeHyperdiskPool();

Membuat Hyperdisk Exapool

Exapools Hyperdisk tersedia secara umum dengan daftar yang diizinkan. Untuk membuat Exapool Hyperdisk, hubungi tim akun Anda.

Apa langkah selanjutnya?