gcloudalphacomputetpusqueued-resourcescreateQUEUED_RESOURCE_ID\--node-id=TPU_NAME\--zone=ZONE\--accelerator-type=ACCELERATOR_TYPE\--runtime-version=SOFTWARE_VERSION\--reservation=RESERVATION_URL\--provisioning-model=reservation-bound# Only required for calendar mode
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-04。"],[],[],null,["# Consume a reservation\n=====================\n\nIf you have a TPU reservation, you can use your reserved resources to create\nTPUs that match the reservation's properties. This action is known as *consuming\na reservation* . For information about consuming a TPU reservation when using\nGKE, see [TPU\nreservation](/kubernetes-engine/docs/concepts/plan-tpus#tpu_reservation) in the\nGKE documentation.\n| **Important:** When you consume a future reservation that was created in calendar mode, you must specify the name of the reservation you want to consume, described in the next section.\n\nConsume a specific reservation\n------------------------------\n\nWhen you create resources with the [`gcloud alpha compute tpus queued-resources\ncreate`\ncommand](/sdk/gcloud/reference/alpha/compute/tpus/queued-resources/create), use\nthe [`--reservation`\nflag](/sdk/gcloud/reference/alpha/compute/tpus/queued-resources/create#--reservation)\nto specify the name of the reservation to consume. For future reservations\ncreated in calendar mode, you must also set the [`--provisioning-model`\nflag](/sdk/gcloud/reference/alpha/compute/tpus/queued-resources/create#--provisioning-model)\nto `reservation-bound`: \n\n```bash\ngcloud alpha compute tpus queued-resources create QUEUED_RESOURCE_ID \\\n --node-id=TPU_NAME \\\n --zone=ZONE \\\n --accelerator-type=ACCELERATOR_TYPE \\\n --runtime-version=SOFTWARE_VERSION \\\n --reservation=RESERVATION_URL \\\n --provisioning-model=reservation-bound # Only required for calendar mode\n```\n\nReplace the following placeholder variables:\n\n- \u003cvar translate=\"no\"\u003eQUEUED_RESOURCE_ID\u003c/var\u003e: A user-assigned ID for the queued resource request.\n- \u003cvar translate=\"no\"\u003eTPU_NAME\u003c/var\u003e: A user-assigned ID (name) for the TPU that is created when the queued resource request is allocated.\n- \u003cvar translate=\"no\"\u003eZONE\u003c/var\u003e: The zone in which to create the TPU VM. For more information about supported zones, see [Regions and zones](/tpu/docs/regions-zones).\n- \u003cvar translate=\"no\"\u003eACCELERATOR_TYPE\u003c/var\u003e: Specifies the version and size of the Cloud TPU to create. For more information about supported accelerator types for each TPU version, see [TPU versions](/tpu/docs/system-architecture-tpu-vm#versions).\n- \u003cvar translate=\"no\"\u003eSOFTWARE_VERSION\u003c/var\u003e: The Cloud TPU [software version](/tpu/docs/runtimes).\n- \u003cvar translate=\"no\"\u003eRESERVATION_URL\u003c/var\u003e: The URL of the reservation. Specify one of the following values:\n - If the reservation is in your project: \u003cvar translate=\"no\"\u003eRESERVATION_NAME\u003c/var\u003e\n - If the reservation is in another project and your project can consume it: `projects/`\u003cvar translate=\"no\"\u003eOWNER_PROJECT_ID\u003c/var\u003e`/reservations/`\u003cvar translate=\"no\"\u003eRESERVATION_NAME\u003c/var\u003e\n\nConsume any matching reservation\n--------------------------------\n\n| **Important:** This method is not supported for future reservations created in calendar mode. When you consume a future reservation created in calendar mode, you must specify the name of the reservation you want to consume, described in the previous section.\n\nYou can use the `--reserved` flag to automatically determine the reservation to\nuse based on the accelerator type, project ID, and zone.\n\n### CreateNode\n\nTo consume any matching reservation using the CreateNode API, use the [`gcloud\nalpha compute tpus tpu-vm create`\ncommand](/sdk/gcloud/reference/alpha/compute/tpus/tpu-vm/create) with the\n[`--reserved`\nflag](/sdk/gcloud/reference/alpha/compute/tpus/tpu-vm/create#--reserved): \n\n```bash\ngcloud alpha compute tpus tpu-vm create TPU_NAME \\\n --zone=ZONE \\\n --accelerator-type=ACCELERATOR_TYPE \\\n --version=SOFTWARE_VERSION \\\n --reserved\n```\n\nReplace the following placeholder variables:\n\n- \u003cvar translate=\"no\"\u003eTPU_NAME\u003c/var\u003e: A name for the TPU.\n- \u003cvar translate=\"no\"\u003eZONE\u003c/var\u003e: The zone where to create the TPU VM, which must match the reservation zone.\n- \u003cvar translate=\"no\"\u003eACCELERATOR_TYPE\u003c/var\u003e: Specifies the version and size of the Cloud TPU to create. For more information about supported accelerator types for each TPU version, see [TPU versions](/tpu/docs/system-architecture-tpu-vm#versions).\n- \u003cvar translate=\"no\"\u003eSOFTWARE_VERSION\u003c/var\u003e: The Cloud TPU [software version](/tpu/docs/runtimes).\n\n### Queued resources\n\nTo consume any matching reservation using [queued\nresources](/tpu/docs/queued-resources), use the [`gcloud alpha compute tpus\nqueued-resources create`\ncommand](/sdk/gcloud/reference/alpha/compute/tpus/queued-resources/create) with\nthe [`--reserved`\nflag](/sdk/gcloud/reference/alpha/compute/tpus/queued-resources/create#--reserved): \n\n```bash\ngcloud alpha compute tpus queued-resources create QUEUED_RESOURCE_ID \\\n --node-id=TPU_NAME \\\n --zone=ZONE \\\n --accelerator-type=ACCELERATOR_TYPE \\\n --runtime-version=SOFTWARE_VERSION \\\n --reserved\n```\n\nReplace the following placeholder variables:\n\n- \u003cvar translate=\"no\"\u003eQUEUED_RESOURCE_ID\u003c/var\u003e: A user-assigned ID for the queued resource request.\n- \u003cvar translate=\"no\"\u003eTPU_NAME\u003c/var\u003e: A user-assigned ID (name) for the TPU that is created when the queued resource request is allocated.\n- \u003cvar translate=\"no\"\u003eZONE\u003c/var\u003e: The zone in which to create the TPU VM and where the reservation exists.\n- \u003cvar translate=\"no\"\u003eACCELERATOR_TYPE\u003c/var\u003e: Specifies the version and size of the Cloud TPU to create. For more information about supported accelerator types for each TPU version, see [TPU versions](/tpu/docs/system-architecture-tpu-vm#versions).\n- \u003cvar translate=\"no\"\u003eSOFTWARE_VERSION\u003c/var\u003e: The Cloud TPU [software version](/tpu/docs/runtimes).\n\nCheck reservation usage\n-----------------------\n\nYou can only check a shared reservation usage from its owner project. If you are\nin a consumer project, then you must switch to the owner project to check the\nreservation usage.\n\nTo see how much of the reservation is in use, use the [`gcloud compute\nreservations describe`\ncommand](/sdk/gcloud/reference/compute/reservations/describe): \n\n```bash\ngcloud compute reservations describe RESERVATION_NAME \\\n --project=PROJECT_ID --zone=ZONE\n```\n\nReplace the following placeholder variables:\n\n- \u003cvar translate=\"no\"\u003eRESERVATION_NAME\u003c/var\u003e: The name of the reservation.\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: The ID of the project that contains the reservation.\n- \u003cvar translate=\"no\"\u003eZONE\u003c/var\u003e: The zone where the reservation exists.\n\nTo list all reservations in a project, use the [`gcloud compute reservations\nlist` command](/sdk/gcloud/reference/compute/reservations/list): \n\n```bash\ngcloud compute reservations list --project=PROJECT_ID\n```\n\nReplace the following placeholder variable:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: The ID of the project.\n\nWhat's next\n-----------\n\n- [Learn about Cloud TPU reservations](/tpu/docs/about-tpu-reservations)\n- [Share a reservation between projects](/tpu/docs/share-reservation)\n- [Manage your TPUs](/tpu/docs/managing-tpus-tpu-vm)"]]