예약 또는 미래용 예약 요청 보기


이 문서에서는 예약 또는 향후 예약 요청을 확인하는 방법을 설명합니다. 다양한 유형의 예약에 관한 자세한 내용은 프로비저닝 유형을 참고하세요.

예약 또는 미래용 예약 요청을 볼 때 다음 작업을 할 수 있습니다.

  • 예약 설정 보기 이 검토를 통해 예약 세부정보를 확인하고, 예약이 요구사항을 충족하는지 확인하고, 용량을 계획할 수 있습니다.

  • 소비 가능한 인스턴스 수 결정 이 검사를 통해 예약된 용량을 사용할 수 있는 Compute Engine 인스턴스의 수를 확인할 수 있습니다.

제한사항

공유 예약 또는 공유 미래용 예약 요청은 이를 만든 프로젝트에서만 볼 수 있습니다.

시작하기 전에

  • 아직 인증을 설정하지 않았다면 설정합니다. 인증은 서비스 및 API에 액세스하기 위해 ID를 확인하는 프로세스입니다. Google Cloud 로컬 개발 환경에서 코드 또는 샘플을 실행하려면 다음 옵션 중 하나를 선택하여 Compute Engine에 인증하면 됩니다.

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

    Consolegcloud

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

    1. Install the Google Cloud CLI, then initialize it by running the following command:

      gcloud init
    2. Set a default region and zone.
    3. Go

      로컬 개발 환경에서 이 페이지의 Go 샘플을 사용하려면 gcloud CLI를 설치 및 초기화한 다음 사용자 인증 정보로 애플리케이션 기본 사용자 인증 정보를 설정하세요.

      1. Install the Google Cloud CLI.
      2. To initialize the gcloud CLI, run the following command:

        gcloud init
      3. 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.

      자세한 내용은 다음을 참조하세요: Set up authentication for a local development environment.

      Java

      로컬 개발 환경에서 이 페이지의 Java 샘플을 사용하려면 gcloud CLI를 설치 및 초기화한 다음 사용자 인증 정보로 애플리케이션 기본 사용자 인증 정보를 설정하세요.

      1. Install the Google Cloud CLI.
      2. To initialize the gcloud CLI, run the following command:

        gcloud init
      3. 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.

      자세한 내용은 다음을 참조하세요: Set up authentication for a local development environment.

      Node.js

      로컬 개발 환경에서 이 페이지의 Node.js 샘플을 사용하려면 gcloud CLI를 설치 및 초기화한 다음 사용자 인증 정보로 애플리케이션 기본 사용자 인증 정보를 설정하세요.

      1. Install the Google Cloud CLI.
      2. To initialize the gcloud CLI, run the following command:

        gcloud init
      3. 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.

      자세한 내용은 다음을 참조하세요: Set up authentication for a local development environment.

      Python

      로컬 개발 환경에서 이 페이지의 Python 샘플을 사용하려면 gcloud CLI를 설치 및 초기화한 다음 사용자 인증 정보로 애플리케이션 기본 사용자 인증 정보를 설정하세요.

      1. Install the Google Cloud CLI.
      2. To initialize the gcloud CLI, run the following command:

        gcloud init
      3. 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.

      자세한 내용은 다음을 참조하세요: Set up authentication for a local development environment.

      REST

      로컬 개발 환경에서 이 페이지의 REST API 샘플을 사용하려면 gcloud CLI에 제공한 사용자 인증 정보를 사용합니다.

        Install the Google Cloud CLI, then initialize it by running the following command:

        gcloud init

      자세한 내용은 Google Cloud 인증 문서의 REST 사용을 위한 인증을 참고하세요.

필요한 역할

예약 또는 미래용 예약 요청을 보는 데 필요한 권한을 얻으려면 관리자에게 프로젝트에 대한 Compute 관리자 (roles/compute.admin) IAM 역할을 부여해 달라고 요청하세요. 역할 부여에 대한 자세한 내용은 프로젝트, 폴더, 조직에 대한 액세스 관리를 참조하세요.

이 사전 정의된 역할에는 예약 또는 향후 예약 요청을 보는 데 필요한 권한이 포함되어 있습니다. 필요한 정확한 권한을 보려면 필수 권한 섹션을 펼치세요.

예약 또는 미래용 예약 요청을 보려면 다음 권한이 필요합니다.

  • 예약 목록 보기: 프로젝트에 대한 compute.reservations.list 권한
  • 미래용 예약 요청 목록을 보려면 프로젝트에 대한 compute.futureReservations.list 권한이 필요합니다.
  • 예약의 세부정보 보기: 프로젝트에 대한 compute.reservations.get 권한
  • 미래용 예약 요청의 세부정보를 보려면 프로젝트에 대한 compute.futureReservations.get 권한이 필요합니다.

커스텀 역할이나 다른 사전 정의된 역할을 사용하여 이 권한을 부여받을 수도 있습니다.

예약 설정 보기

다음 섹션에서는 예약 설정 또는 향후 예약 요청을 확인하는 방법을 설명합니다.

예약 보기

하나 이상의 예약 설정을 보려면 이 섹션에 설명된 다음 방법 중 하나를 사용하세요.

  • 프로젝트의 모든 예약에 대한 개요를 보려면 예약 목록을 확인하세요.

  • 단일 예약의 전체 세부정보를 보려면 예약 세부정보를 확인하세요.

예약에서 deleteAtTimereservationSharingPolicy 필드(미리보기)를 보려면 Google Cloud CLI를 사용하여 예약 세부정보를 보거나 REST API를 사용하여 예약을 확인하세요. 이 입력란이 필요하지 않은 경우 다음 옵션 중 하나를 선택하여 예약을 확인합니다.

  1. Google Cloud 콘솔에서 예약 페이지로 이동합니다.

    예약으로 이동

    온디맨드 예약 탭 (기본값)의 표에는 각 예약이 나열되고 각 표 열에는 속성이 설명됩니다.

  2. 선택사항: 예약 목록을 세분화하려면 필터 필드에서 예약을 필터링할 속성을 선택합니다.

  3. 예약 세부정보를 보려면 이름 열에서 예약 이름을 클릭합니다.

    예약 세부정보가 표시된 페이지가 열립니다.

  • 예약 목록을 보려면 gcloud compute reservations list 명령어를 사용합니다.

    gcloud compute reservations list
    

    출력은 다음 예시와 비슷합니다.

    NAME: r-01
    IN_USE_COUNT: 0
    COUNT: 5
    ZONE: us-central1-a
    SHARE_TYPE: LOCAL
    
    NAME: r-02
    IN_USE_COUNT: 3
    COUNT: 10
    ZONE: us-central1-f
    SHARE_TYPE: LOCAL
    

    원하는 경우 필터 표현식을 사용하여 예약 목록을 세분화하려면 --filter 플래그를 포함합니다.

    gcloud compute reservations list \
        --filter="FILTER_EXPRESSION"
    

    FILTER_EXPRESSION을 필터 표현식으로 바꿉니다.

  • 예약 세부정보를 보려면 gcloud compute reservations describe 명령어를 사용합니다.

    gcloud compute reservations describe RESERVATION_NAME \
        --zone=ZONE
    

    다음을 바꿉니다.

    • RESERVATION_NAME: 기존 예약 이름

    • ZONE: 예약이 있는 영역입니다.

    출력은 다음 예시와 비슷합니다.

    creationTimestamp: '2024-10-11T03:25:23.192-07:00'
    id: '4488228526648280060'
    kind: compute#reservation
    name: r-01
    selfLink: https://www.googleapis.com/compute/v1/projects/my-project/zones/us-central1-a/reservations/r-01
    shareSettings:
      shareType: LOCAL
    specificReservation:
      assuredCount: '50'
      count: '50'
      inUseCount: '25'
      instanceProperties:
        machineType: n2-standard-2
    specificReservationRequired: false
    status: READY
    zone: https://www.googleapis.com/compute/v1/projects/my-project/zones/us-central1-a
    
  • 예약 목록을 보려면 다음 코드 샘플을 사용하세요.

    // Copyright 2024 Google LLC
    //
    // Licensed under the Apache License, Version 2.0 (the "License");
    // you may not use this file except in compliance with the License.
    // You may obtain a copy of the License at
    //
    //     https://www.apache.org/licenses/LICENSE-2.0
    //
    // Unless required by applicable law or agreed to in writing, software
    // distributed under the License is distributed on an "AS IS" BASIS,
    // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    // See the License for the specific language governing permissions and
    // limitations under the License.
    
    package snippets
    
    import (
    	"context"
    	"fmt"
    	"io"
    
    	compute "cloud.google.com/go/compute/apiv1"
    	computepb "cloud.google.com/go/compute/apiv1/computepb"
    	"google.golang.org/api/iterator"
    )
    
    // Get list of reservations for given project in particular zone
    func listReservations(w io.Writer, projectID, zone string) error {
    	// projectID := "your_project_id"
    	// zone := "us-west3-a"
    
    	ctx := context.Background()
    	reservationsClient, err := compute.NewReservationsRESTClient(ctx)
    	if err != nil {
    		return err
    	}
    	defer reservationsClient.Close()
    
    	req := &computepb.ListReservationsRequest{
    		Project: projectID,
    		Zone:    zone,
    	}
    
    	it := reservationsClient.List(ctx, req)
    	fmt.Fprintf(w, "Instances found in zone %s:\n", zone)
    	for {
    		instance, err := it.Next()
    		if err == iterator.Done {
    			break
    		}
    		if err != nil {
    			return err
    		}
    		fmt.Fprintf(w, "- %s %d\n", instance.GetName(), instance.GetSpecificReservation().GetCount())
    	}
    
    	return nil
    }
    
    
  • 예약 세부정보를 보려면 다음 코드 샘플을 사용하세요.

    // Copyright 2024 Google LLC
    //
    // Licensed under the Apache License, Version 2.0 (the "License");
    // you may not use this file except in compliance with the License.
    // You may obtain a copy of the License at
    //
    //     https://www.apache.org/licenses/LICENSE-2.0
    //
    // Unless required by applicable law or agreed to in writing, software
    // distributed under the License is distributed on an "AS IS" BASIS,
    // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    // See the License for the specific language governing permissions and
    // limitations under the License.
    
    package snippets
    
    import (
    	"context"
    	"fmt"
    	"io"
    
    	compute "cloud.google.com/go/compute/apiv1"
    	computepb "cloud.google.com/go/compute/apiv1/computepb"
    )
    
    // Get certain reservation for given project and zone
    func getReservation(w io.Writer, projectID, zone, reservationName string) (*computepb.Reservation, error) {
    	// projectID := "your_project_id"
    	// zone := "us-west3-a"
    	// reservationName := "your_reservation_name"
    
    	ctx := context.Background()
    	reservationsClient, err := compute.NewReservationsRESTClient(ctx)
    	if err != nil {
    		return nil, err
    	}
    	defer reservationsClient.Close()
    
    	req := &computepb.GetReservationRequest{
    		Project:     projectID,
    		Reservation: reservationName,
    		Zone:        zone,
    	}
    
    	reservation, err := reservationsClient.Get(ctx, req)
    	if err != nil {
    		return nil, fmt.Errorf("unable to delete reservation: %w", err)
    	}
    
    	fmt.Fprintf(w, "Reservation: %s\n", reservation.GetName())
    
    	return reservation, nil
    }
    
    
  • 예약 목록을 보려면 다음 코드 샘플을 사용하세요.

    /*
     * Copyright 2024 Google LLC
     *
     * Licensed under the Apache License, Version 2.0 (the "License");
     * you may not use this file except in compliance with the License.
     * You may obtain a copy of the License at
     *
     *   http://www.apache.org/licenses/LICENSE-2.0
     *
     * Unless required by applicable law or agreed to in writing, software
     * distributed under the License is distributed on an "AS IS" BASIS,
     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     * See the License for the specific language governing permissions and
     * limitations under the License.
     */
    
    package compute.reservation;
    
    import com.google.cloud.compute.v1.Reservation;
    import com.google.cloud.compute.v1.ReservationsClient;
    import java.io.IOException;
    import java.util.ArrayList;
    import java.util.List;
    
    public class ListReservations {
    
      public static void main(String[] args) throws IOException {
        // TODO(developer): Replace these variables before running the sample.
        // Project ID or project number of the Cloud project you want to use.
        String project = "YOUR_PROJECT_ID";
        // Zone in which reservations are located.
        String zone = "us-central1-a";
    
        listReservations(project, zone);
      }
    
      // List all reservations in the given project and zone.
      public static List<Reservation> listReservations(String project, String zone) throws IOException {
        // Initialize client that will be used to send requests. This client only needs to be created
        // once, and can be reused for multiple requests.
        List<Reservation> listOfReservations = new ArrayList<>();
    
        try (ReservationsClient reservationsClient = ReservationsClient.create()) {
          for (Reservation reservation : reservationsClient.list(project, zone).iterateAll()) {
            listOfReservations.add(reservation);
            System.out.println("Reservation: " + reservation.getName());
          }
        }
        return listOfReservations;
      }
    }
  • 예약 세부정보를 보려면 다음 코드 샘플을 사용하세요.

    /*
     * Copyright 2024 Google LLC
     *
     * Licensed under the Apache License, Version 2.0 (the "License");
     * you may not use this file except in compliance with the License.
     * You may obtain a copy of the License at
     *
     * http://www.apache.org/licenses/LICENSE-2.0
     *
     * Unless required by applicable law or agreed to in writing, software
     * distributed under the License is distributed on an "AS IS" BASIS,
     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     * See the License for the specific language governing permissions and
     * limitations under the License.
     */
    
    package compute.reservation;
    
    import com.google.cloud.compute.v1.Reservation;
    import com.google.cloud.compute.v1.ReservationsClient;
    import java.io.IOException;
    import java.util.concurrent.ExecutionException;
    import java.util.concurrent.TimeoutException;
    
    public class GetReservation {
    
      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 Cloud project you want to use.
        String projectId = "YOUR_PROJECT_ID";
        // Name of the zone in which you want to create the reservation.
        String zone = "us-central1-a";
        // Name of the reservation you want to create.
        String reservationName = "test-reservation-name";
    
        getReservation(projectId, reservationName, zone);
      }
    
      // Retrieve a reservation with the given name in the given zone.
      public static Reservation getReservation(
          String projectId, String reservationName, String zone)
          throws IOException {
        // 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 (ReservationsClient reservationsClient = ReservationsClient.create()) {
    
          // Get the reservation.
          Reservation reservation = reservationsClient.get(projectId, zone, reservationName);
    
          System.out.println("Reservation: " + reservation.getName());
          return reservation;
        }
      }
    }
  • 예약 목록을 보려면 다음 코드 샘플을 사용하세요.

    /*
     * Copyright 2024 Google LLC
     *
     * Licensed under the Apache License, Version 2.0 (the "License");
     * you may not use this file except in compliance with the License.
     * You may obtain a copy of the License at
     *
     *     https://www.apache.org/licenses/LICENSE-2.0
     *
     * Unless required by applicable law or agreed to in writing, software
     * distributed under the License is distributed on an "AS IS" BASIS,
     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     * See the License for the specific language governing permissions and
     * limitations under the License.
     */
    
    'use strict';
    
    async function main() {
      // Import the Compute library
      const computeLib = require('@google-cloud/compute');
    
      // Instantiate a reservationsClient
      const reservationsClient = new computeLib.ReservationsClient();
    
      /**
       * TODO(developer): Update these variables before running the sample.
       */
      // The ID of the project where your reservations are located.
      const projectId = await reservationsClient.getProjectId();
      // The zone where your reservations are located.
      const zone = 'us-central1-a';
    
      async function callGetReservations() {
        const reservations = (
          await reservationsClient.list({
            project: projectId,
            zone,
          })
        )[0];
    
        console.log(JSON.stringify(reservations));
      }
    
      await callGetReservations();
    }
    
    main().catch(err => {
      console.error(err);
      process.exitCode = 1;
    });
    
  • 예약 세부정보를 보려면 다음 코드 샘플을 사용하세요.

    /*
     * Copyright 2024 Google LLC
     *
     * Licensed under the Apache License, Version 2.0 (the "License");
     * you may not use this file except in compliance with the License.
     * You may obtain a copy of the License at
     *
     *     https://www.apache.org/licenses/LICENSE-2.0
     *
     * Unless required by applicable law or agreed to in writing, software
     * distributed under the License is distributed on an "AS IS" BASIS,
     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     * See the License for the specific language governing permissions and
     * limitations under the License.
     */
    
    'use strict';
    
    async function main(reservationName) {
      // Import the Compute library
      const computeLib = require('@google-cloud/compute');
    
      // Instantiate a reservationsClient
      const reservationsClient = new computeLib.ReservationsClient();
    
      /**
       * TODO(developer): Update/uncomment these variables before running the sample.
       */
      // The ID of the project where your reservation is located.
      const projectId = await reservationsClient.getProjectId();
      // The zone where your reservation is located.
      const zone = 'us-central1-a';
      // The name of the reservation to return.
      // reservationName = 'reservation-01';
    
      async function callGetReservation() {
        const requestedReservation = (
          await reservationsClient.get({
            project: projectId,
            zone,
            reservation: reservationName,
          })
        )[0];
    
        console.log(JSON.stringify(requestedReservation));
      }
    
      await callGetReservation();
    }
    
    main(...process.argv.slice(2)).catch(err => {
      console.error(err);
      process.exitCode = 1;
    });
    
  • 예약 목록을 보려면 다음 코드 샘플을 사용하세요.

    # Copyright 2024 Google LLC
    #
    # Licensed under the Apache License, Version 2.0 (the "License");
    # you may not use this file except in compliance with the License.
    # You may obtain a copy of the License at
    #
    #    https://www.apache.org/licenses/LICENSE-2.0
    #
    # Unless required by applicable law or agreed to in writing, software
    # distributed under the License is distributed on an "AS IS" BASIS,
    # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    # See the License for the specific language governing permissions and
    # limitations under the License.
    
    
    # This file is automatically generated. Please do not modify it directly.
    # Find the relevant recipe file in the samples/recipes or samples/ingredients
    # directory and apply your changes there.
    
    
    from google.cloud import compute_v1
    from google.cloud.compute_v1.services.reservations.pagers import ListPager
    
    
    def list_compute_reservation(project_id: str, zone: str = "us-central1-a") -> ListPager:
        """
        Lists all compute reservations in a specified Google Cloud project and zone.
        Args:
            project_id (str): The ID of the Google Cloud project.
            zone (str): The zone of the reservations.
        Returns:
            ListPager: A pager object containing the list of reservations.
        """
    
        client = compute_v1.ReservationsClient()
    
        reservations_list = client.list(
            project=project_id,
            zone=zone,
        )
    
        for reservation in reservations_list:
            print("Name: ", reservation.name)
            print(
                "Machine type: ",
                reservation.specific_reservation.instance_properties.machine_type,
            )
        # Example response:
        # Name:  my-reservation_1
        # Machine type:  n1-standard-1
        # Name:  my-reservation_2
        # Machine type:  n1-standard-1
    
        return reservations_list
    
    
    
  • 예약 세부정보를 보려면 다음 코드 샘플을 사용하세요.

    # Copyright 2024 Google LLC
    #
    # Licensed under the Apache License, Version 2.0 (the "License");
    # you may not use this file except in compliance with the License.
    # You may obtain a copy of the License at
    #
    #    https://www.apache.org/licenses/LICENSE-2.0
    #
    # Unless required by applicable law or agreed to in writing, software
    # distributed under the License is distributed on an "AS IS" BASIS,
    # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    # See the License for the specific language governing permissions and
    # limitations under the License.
    
    
    # This file is automatically generated. Please do not modify it directly.
    # Find the relevant recipe file in the samples/recipes or samples/ingredients
    # directory and apply your changes there.
    
    
    from google.cloud import compute_v1
    from google.cloud.compute_v1.types import compute
    
    
    def get_compute_reservation(
        project_id: str,
        zone: str = "us-central1-a",
        reservation_name="your-reservation-name",
    ) -> compute.Reservation:
        """
        Retrieves a compute reservation from GCP.
        Args:
            project_id (str): The ID of the Google Cloud project.
            zone (str): The zone of the reservation.
            reservation_name (str): The name of the reservation to retrieve.
        Returns:
            compute.Reservation: The reservation object retrieved from Google Cloud.
        """
    
        client = compute_v1.ReservationsClient()
    
        reservation = client.get(
            project=project_id,
            zone=zone,
            reservation=reservation_name,
        )
    
        print("Name: ", reservation.name)
        print("STATUS: ", reservation.status)
        print(reservation.specific_reservation)
        # Example response:
        # Name:  your-reservation-name
        # STATUS:  READY
        # count: 3
        # instance_properties {
        #   machine_type: "n1-standard-1"
        #   local_ssds {
        #     disk_size_gb: 375
        #     interface: "NVME"
        #   }
        # ...
    
        return reservation
    
    
    
  • 예약 목록을 보려면 reservations.list 메서드GET 요청을 실행합니다.

    GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/reservations
    

    다음을 바꿉니다.

    • PROJECT_ID: 예약을 만든 프로젝트의 ID입니다.

    • ZONE: 예약이 있는 영역입니다.

    출력은 다음 예시와 비슷합니다.

    {
      "kind": "compute#reservation",
      "id": "4100668622331754141",
      "creationTimestamp": "2019-09-27T08:21:14.707-07:00",
      "selfLink": "https://www.googleapis.com/compute/v1/projects/my-project/zones/us-central1-a/reservations/reservation-05",
      "zone": "https://www.googleapis.com/compute/v1/projects/my-project/zones/us-central1-a",
      "name": "reservation-05",
      "specificReservation": {
        "instanceProperties": {
          "machineType": "n1-standard-2"
        },
        "count": "100",
        "inUseCount": "0",
        "assuredCount": "100"
      },
      "specificReservationRequired": false,
      "status": "READY",
      "shareSettings": {
        "shareType": "LOCAL"
      }
    },
    {
      "kind": "compute#reservation",
      "id": "2533514314332214789",
      "creationTimestamp": "2019-09-27T08:21:14.707-07:00",
      "selfLink": "https://www.googleapis.com/compute/v1/projects/my-project/zones/us-central1-a/reservations/reservation-04",
      "zone": "https://www.googleapis.com/compute/v1/projects/my-project/zones/us-central1-a",
      "name": "reservation-04",
      "specificReservation": {
        "instanceProperties": {
          "machineType": "n1-standard-2",
          "guestAccelerators": [
            {
              "acceleratorType": "nvidia-tesla-t4",
              "acceleratorCount": 1
            }
          ],
          "localSsds": [
            {
              "diskSizeGb": "375",
              "interface": "SCSI"
            }
          ]
        },
        "count": "50",
        "inUseCount": "25",
        "assuredCount": "50"
      },
      "specificReservationRequired": false,
      "status": "READY",
      "shareSettings": {
        "shareType": "LOCAL"
      }
    }
    

    원하는 경우 필터 표현식을 사용하여 예약 목록을 세분화하려면 filter 쿼리 매개변수를 포함합니다.

    GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/reservations?filter=FILTER_EXPRESSION
    

    FILTER_EXPRESSIONURL 인코딩된 값을 사용하는 필터 표현식으로 바꿉니다.

  • 예약 세부정보를 보려면 GET 요청을 reservations.get 메서드로 전송합니다.

    GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/reservations/RESERVATION_NAME
    

    다음을 바꿉니다.

    • PROJECT_ID: 예약을 만든 프로젝트의 ID입니다.

    • ZONE: 예약이 있는 영역입니다.

    • RESERVATION_NAME: 기존 예약 이름

    출력은 다음 예시와 비슷합니다.

    {
      "kind": "compute#reservation",
      "id": "4488228526648280060",
      "creationTimestamp": "2024-10-11T03:25:23.192-07:00",
      "selfLink": "https://www.googleapis.com/compute/v1/projects/davide-experimental/zones/us-central1-a/reservations/r-01",
      "zone": "https://www.googleapis.com/compute/v1/projects/davide-experimental/zones/us-central1-a",
      "name": "r-01",
      "specificReservation": {
        "instanceProperties": {
          "machineType": "n2-standard-2"
        },
        "count": "50",
        "inUseCount": "25",
        "assuredCount": "50"
      },
      "specificReservationRequired": false,
      "status": "READY",
      "shareSettings": {
        "shareType": "LOCAL"
      }
    }
    

미래용 예약 요청 보기

하나 이상의 미래용 예약 요청의 설정을 보려면 이 섹션에 설명된 다음 방법 중 하나를 사용하세요.

  • 프로젝트의 모든 미래용 예약 요청을 개략적으로 확인하려면 요청 목록을 확인하세요.

  • 단일 미래용 예약 요청의 전체 세부정보를 보려면 요청의 세부정보를 확인하세요.

미래용 예약 요청을 보려면 다음 옵션 중 하나를 선택합니다.

  1. Google Cloud 콘솔에서 예약 페이지로 이동합니다.

    예약으로 이동

  2. 미래용 예약 탭을 클릭합니다.

    표에는 각 미래용 예약 요청이 나열되며 각 표 열은 속성을 설명합니다.

  3. 선택사항: 요청 목록을 세분화하려면 필터 필드에서 요청을 필터링할 속성을 선택합니다.

  4. 요청의 세부정보를 보려면 이름 열에서 요청의 이름을 클릭합니다.

    미래용 예약 요청에 대한 세부정보가 포함된 페이지가 열립니다.

  • 미래용 예약 요청 목록을 보려면 gcloud beta compute future-reservations list 명령어를 사용합니다.

    gcloud beta compute future-reservations list
    

    출력은 다음 예시와 비슷합니다.

    NAME: fr-04
    TOTAL_COUNT: 100
    START_TIME: 2025-07-20T07:00:00Z
    END_TIME: 2025-08-05T07:00:00Z
    PROCUREMENT_STATUS: FULFILLED
    ZONE: us-east1-a
    
    NAME: fr-05
    TOTAL_COUNT: 10
    START_TIME: 2025-07-20T07:00:00Z
    END_TIME: 2025-12-01T00:00:00Z
    PROCUREMENT_STATUS: PENDING_APPROVAL
    ZONE: us-west1-c
    

    원하는 경우 필터 표현식을 사용하여 미래용 예약 요청 목록을 세분화하려면 --filter 플래그를 포함합니다.

    gcloud beta compute future-reservations list \
        --filter="FILTER_EXPRESSION"
    

    FILTER_EXPRESSION을 필터 표현식으로 바꿉니다.

  • 미래용 예약 요청의 세부정보를 보려면 gcloud beta compute future-reservations describe 명령어를 사용합니다.

    gcloud beta compute future-reservations describe FUTURE_RESERVATION_NAME \
        --zone=ZONE
    

    다음을 바꿉니다.

    • FUTURE_RESERVATION_NAME: 기존 미래용 예약 요청의 이름입니다.

    • ZONE: 미래용 예약 요청이 있는 영역입니다.

    출력은 다음 예시와 비슷합니다.

    autoCreatedReservationsDeleteTime: '2025-05-02T01:00:00Z'
    creationTimestamp: '2025-03-23T10:08:31.613-07:00'
    id: '5212276518668495076'
    kind: compute#futureReservation
    name: fr-01
    planningStatus: SUBMITTED
    selfLink: https://www.googleapis.com/compute/beta/projects/example-project/zones/us-central1-a/futureReservations/fr-01
    selfLinkWithId: https://www.googleapis.com/compute/beta/projects/example-project/zones/us-central1-a/futureReservations/5212276518668495076
    shareSettings:
      shareType: LOCAL
    specificSkuProperties:
      instanceProperties:
        machineType: n1-standard-64
      totalCount: '800'
    status:
      existingMatchingUsageInfo:
        count: '3'
        timestamp: '2025-03-30T01:00:00Z'
      lockTime: '2025-03-30T17:09:59.297799Z'
      procurementStatus: APPROVED
    timeWindow:
      endTime: '2025-05-02T01:00:00Z'
      startTime: '2025-04-30T17:30:00Z'
    zone: https://www.googleapis.com/compute/beta/projects/example-project/zones/us-central1-a
    
  • 미래용 예약 요청 목록을 보려면 베타 futureReservations.list 메서드GET 요청을 실행합니다.

    GET https://compute.googleapis.com/compute/beta/projects/PROJECT_ID/zones/ZONE/futureReservations
    

    다음을 바꿉니다.

    • PROJECT_ID: 미래용 예약 요청을 만든 프로젝트의 ID입니다.

    • ZONE: 미래용 예약 요청이 있는 영역입니다.

    출력은 다음 예시와 비슷합니다.

    {
      "id": "projects/my-project/zones/us-east1-a/futureReservations",
      "items": [
        {
          "id": "743865190848184978",
          "creationTimestamp": "2025-03-23T18:16:45.274-07:00",
          "selfLink": "https://www.googleapis.com/compute/beta/projects/my-project/zones/us-east1-a/futureReservations/fr-base",
          "selfLinkWithId": "https://www.googleapis.com/compute/beta/projects/my-project/zones/us-east1-a/futureReservations/743865190848184978",
          "zone": "https://www.googleapis.com/compute/beta/projects/my-project/zones/us-east1-a",
          "name": "fr-base",
          "specificSkuProperties": {
            "instanceProperties": {
              "machineType": "n1-standard-1"
            },
            "totalCount": "100"
          },
          "planningStatus": "SUBMITTED",
          "timeWindow": {
            "endTime": "2025-05-02T01:00:00Z",
            "startTime": "2025-04-30T17:30:00Z"
          },
          "status": {
            "procurementStatus": "FULFILLED",
            "lockTime": "2025-03-30T07:00:00Z",
            "existingMatchingUsageInfo": {
              "count": "3",
              "timestamp": "2025-03-30T01:00:00Z"
            }
          },
          "kind": "compute#futureReservation"
        },
        ...
      ],
      "selfLink": "https://www.googleapis.com/compute/beta/projects/my-project/zones/us-east1-a/futureReservations",
      "etag": "AnzKY34l-cvvV-JnniESJ0dtQvQ=/hvc4jaHpxFAZmOt1FVtKNgzZu-M=",
      "kind": "compute#futureReservationsListResponse"
    }
    

    원하는 경우 필터 표현식을 사용하여 미래용 예약 요청 목록을 세분화하려면 filter 쿼리 매개변수를 포함합니다.

    GET https://compute.googleapis.com/compute/beta/projects/PROJECT_ID/aggregated/futureReservations?filter=FILTER_EXPRESSION
    

    FILTER_EXPRESSIONURL 인코딩된 값을 사용하는 필터 표현식으로 바꿉니다.

  • 미래용 예약 요청의 세부정보를 보려면 베타 futureReservations.get 메서드GET 요청을 실행합니다.

    GET https://compute.googleapis.com/compute/beta/projects/PROJECT_ID/zones/ZONE/futureReservations/FUTURE_RESERVATION_NAME
    

    다음을 바꿉니다.

    • PROJECT_ID: 미래용 예약 요청을 만든 프로젝트의 ID입니다.

    • ZONE: 미래용 예약 요청이 있는 영역입니다.

    • FUTURE_RESERVATION_NAME: 기존 미래용 예약 요청의 이름입니다.

    출력은 다음과 비슷합니다.

    {
      "autoCreatedReservationsDeleteTime": "2025-05-02T01:00:00Z",
      "creationTimestamp": "2025-03-23T10:08:31.613-07:00",
      "id": "5212276518668495076",
      "kind": "compute#futureReservation",
      "name": "fr-01",
      "planningStatus": "SUBMITTED",
      "selfLink": "https://www.googleapis.com/compute/beta/projects/example-project/zones/us-central1-a/futureReservations/fr-01",
      "selfLinkWithId": "https://www.googleapis.com/compute/beta/projects/example-project/zones/us-central1-a/futureReservations/5212276518668495076",
      "shareSettings": {
        "shareType": "LOCAL"
      },
      "specificSkuProperties": {
        "instanceProperties": {
          "machineType": "n1-standard-64"
        },
        "totalCount": "800"
      },
      "status": {
        "lockTime": "2025-03-30T17:09:59.297799Z",
        "procurementStatus": "APPROVED",
        "existingMatchingUsageInfo": {
          "count": "3",
          "timestamp": "2025-03-30T01:00:00Z"
        }
      },
      "timeWindow": {
        "endTime": "2025-05-02T01:00:00Z",
        "startTime": "2025-04-30T17:30:00Z"
      },
      "zone": "https://www.googleapis.com/compute/beta/projects/example-project/zones/us-central1-a"
    }
    

소비 가능한 인스턴스 수 확인

예약된 용량을 사용할 수 있는 컴퓨팅 인스턴스 수를 확인하려면 다음 중 하나를 실행합니다.

예약의 사용 가능한 인스턴스

예약 세부정보를 확인할 때 다음 필드를 선택하여 예약을 사용하는 컴퓨팅 인스턴스 수와 예약을 사용할 수 있는 인스턴스 수를 확인할 수 있습니다.

  • 보장된 개수 (assuredCount): 프로젝트의 예약 영역 및 공유 예약이 공유된 모든 프로젝트에 예약된 인스턴스 수입니다.

  • 총 개수 (count): 예약에 지정된 예약된 인스턴스 수입니다. 이 수는 보장된 수와 일치해야 합니다.

  • 사용 중인 머신 (inUseCount): 예약을 사용하는 프로젝트 또는 공유 예약이 공유된 프로젝트에서 실행 중인 인스턴스 수입니다.

예를 들어 보장된 개수 (assuredCount)와 총 개수 (count)가 모두 50이고 예약을 사용하는 인스턴스 수 (inUseCount)가 25이면 예약이 완전히 사용되기 전에 25개의 인스턴스가 더 예약을 사용할 수 있습니다.

미래용 예약 요청의 사용 가능한 인스턴스

Compute Engine에서 미래용 예약 요청 시작 시간에 예약을 생성할 컴퓨팅 인스턴스의 수를 결정할 수 있습니다. 초안, 승인 대기 중인 요청 또는 승인된 요청의 경우 다음과 같이 이 번호를 확인할 수 있습니다.

  1. 프로젝트 및 요청이 공유된 프로젝트에서 실행 중인 인스턴스 수와 사용되지 않은 예약 중 요청 속성과 일치하는 수를 확인합니다.

  2. 요청의 총 개수에서 일치하는 실행 중인 인스턴스 수와 사용되지 않은 예약 수를 뺍니다.

단일 또는 여러 요청에 대해 사용 가능한 인스턴스의 수를 한 번에 결정할 수 있습니다. 여러 요청의 경우 Google Cloud 콘솔 또는 REST API를 사용하세요. 단일 요청의 경우 다음 옵션 중 하나를 선택합니다.

  1. Google Cloud 콘솔에서 예약 페이지로 이동합니다.

    예약으로 이동

  2. 미래용 예약 탭을 클릭합니다.

    표에는 각 미래용 예약 요청이 나열되며 각 표 열은 속성을 설명합니다.

  3. Compute Engine에서 시작 시간에 요청에 대해 예약할 인스턴스 수를 확인하려면 총 개수 열에서 일치 개수 열을 빼세요.

    일치 개수 열에 다음 경고 중 하나가 표시됩니다.

    • 일치 수가 0임: 프로젝트 또는 요청이 공유된 프로젝트에 일치하는 실행 중인 인스턴스 또는 사용되지 않은 예약이 없습니다.

    • 일치 수가 총 개수와 같음: Compute Engine은 시작 시 요청에 대해 인스턴스를 예약하지 않습니다.

    요청을 수정하거나 요청과 일치하는 새 인스턴스 또는 예약을 만들면 Compute Engine에서 30분 이내에 일치 개수 열을 업데이트합니다.

  4. 선택사항: 요청에서 일치 개수 열이 마지막으로 업데이트된 시점을 확인하려면 다음을 실행합니다.

    1. 이름 열에서 요청 이름을 클릭합니다.

      미래용 예약 요청에 대한 세부정보가 포함된 페이지가 열립니다.

    2. 리소스 세부정보 섹션에서 최근 사용량 일치 평가 시간 필드를 확인합니다.

  1. 미래용 예약 요청의 세부정보를 보려면 gcloud beta compute future-reservations describe 명령어를 사용합니다.

    gcloud beta compute future-reservations describe FUTURE_RESERVATION_NAME \
        --zone=ZONE
    

    다음을 바꿉니다.

    • FUTURE_RESERVATION_NAME: 기존 미래용 예약 요청의 이름입니다.

    • ZONE: 미래용 예약 요청이 있는 영역입니다.

    출력에서 counttotalCount 필드를 찾습니다.

    ...
    specificSkuProperties:
      ...
      totalCount: '100'
    status:
      existingMatchingUsageInfo:
        count: '50'
        timestamp: '2025-03-30T01:00:00Z'
      ...
      procurementStatus: DRAFTING
    ...
    
  2. totalCount에서 count의 값을 뺍니다. 예를 들어 count이 50이고 totalCount이 100이면 Compute Engine은 요청 시작 시간에 50개 인스턴스의 예약을 자동으로 만듭니다.

    요청을 수정하거나 요청과 일치하는 새 인스턴스 또는 예약을 만들면 Compute Engine에서 30분 이내에 existingMatchingUsageInfo 필드를 업데이트합니다. 이 필드가 마지막으로 업데이트된 시점을 확인하려면 existingMatchingUsageInfo.timestamp 값을 확인합니다.

  1. 미래용 예약 요청 목록을 보려면 베타 futureReservations.list 메서드GET 요청을 실행합니다. 요청 URL에 filter 쿼리 매개변수를 포함하고 name, specificSkuProperties, status 필드만 표시하도록 지정합니다.

    GET https://compute.googleapis.com/compute/beta/projects/PROJECT_ID/zones/ZONE/futureReservations?fields=items.name,items.specificSkuProperties,items.status
    

    다음을 바꿉니다.

    • PROJECT_ID: 미래용 예약 요청을 만든 프로젝트의 ID입니다.

    • ZONE: 미래용 예약 요청이 있는 영역입니다.

    출력에서 각 초안, 승인 대기 중인 요청 또는 승인된 요청의 counttotalCount 필드를 찾습니다.

    {
      "items": [
        {
          "specificSkuProperties": {
            ...
            totalCount: "100"
          },
          "name": "fr-01",
          "status": {
            "procurementStatus": "APPROVED",
            ...
            existingMatchingUsageInfo: {
              count: "50",
              "timestamp": "2025-01-22T07:54:26.295Z"
            }
          }
        },
        {
          "specificSkuProperties": {
            ...
            totalCount: "20"
          },
          "name": "fr-02",
          "status": {
            "procurementStatus": "DRAFTING",
            ...
            existingMatchingUsageInfo: {
              "count": "2",
              "timestamp": "2025-01-22T07:54:26.295Z"
            }
          }
        }
      ]
    }
    
  2. 각 요청에 대해 totalCount에서 count 값을 뺍니다. 예를 들어 count이 50이고 totalCount이 100이면 Compute Engine은 요청 시작 시간에 50개 인스턴스의 예약을 자동으로 만듭니다.

    요청을 수정하거나 요청과 일치하는 새 인스턴스 또는 예약을 만들면 Compute Engine에서 30분 이내에 existingMatchingUsageInfo 필드를 업데이트합니다. 이 필드가 마지막으로 업데이트된 시점을 확인하려면 existingMatchingUsageInfo.timestamp 값을 확인합니다.

다음 단계