- NAME
-
- gcloud ai persistent-resources create - create a new persistent resource
- SYNOPSIS
-
-
gcloud ai persistent-resources create
--persistent-resource-id
=PERSISTENT_RESOURCE_ID
(--config
=CONFIG
--resource-pool-spec
=[RESOURCE_POOL_SPEC
,…]) [--display-name
=DISPLAY_NAME
] [--enable-custom-service-account
] [--labels
=[KEY
=VALUE
,…]] [--network
=NETWORK
] [--region
=REGION
] [--kms-key
=KMS_KEY
:--kms-keyring
=KMS_KEYRING
--kms-location
=KMS_LOCATION
--kms-project
=KMS_PROJECT
] [GCLOUD_WIDE_FLAG …
]
-
- DESCRIPTION
- This command will create a persistent resource on the users project to use with Vertex AI custom training jobs. Persistent resources remain active until they are deleted by the user.
- EXAMPLES
-
To create a PersistentResource under project
in regionexample
, run:us-central1
gcloud ai persistent-resources create --region=us-central1 --project=example --resource-pool-spec=replica-count=1,machine-type='n1-standard-4' --display-name=example-resource
- REQUIRED FLAGS
-
--persistent-resource-id
=PERSISTENT_RESOURCE_ID
- User-specified ID of the Persistent Resource.
-
resource pool specification.
At least one of these must be specified:
--config
=CONFIG
-
Path to the Persistent Resource configuration file. This file should be a YAML
document containing a list of
ResourcePool
If an option is specified both in the configuration file **and** via command-line arguments, the command-line arguments override the configuration file. Note that keys with underscore are invalid.Example(YAML):
resourcePoolSpecs: machineSpec: machineType: n1-standard-4 replicaCount: 1
--resource-pool-spec
=[RESOURCE_POOL_SPEC
,…]-
Defines a resource pool to be created in the Persistent Resource. You can
include multiple resource pool specs in order to create a Persistent Resource
with multiple resource pools.
The spec can contain the following fields:
machine-type
-
(Required): The type of the machine. see https://cloud.google.com/vertex-ai/docs/training/configure-compute#machine-types
for supported types. This field corresponds to the
machineSpec.machineType
field inResourcePool
API message. replica-count
- (Required if autoscaling not enabled) The number of replicas to use when creating this resource pool. This field corresponds to the replicaCount field in 'ResourcePool' API message.
min-replica-count
- (Optional) The minimum number of replicas that autoscaling will down-size to for this resource pool. Both min-replica-count and max-replica-count are required to enable autoscaling on this resource pool. The value for this parameter must be at least 1.
max-replica-count
- (Optional) The maximum number of replicas that autoscaling will create for this resource pool. Both min-replica-count and max-replica-count are required to enable autoscaling on this resource pool. The maximum value for this parameter is 1000.
accelerator-type
-
(Optional) The type of GPU to attach to the machines. see https://cloud.google.com/vertex-ai/docs/training/configure-compute#specifying_gpus
for more requirements. This field corresponds to the
machineSpec.acceleratorType
field inResourcePool
API message. accelerator-count
-
(Required with accelerator-type) The number of GPUs for each VM in the resource
pool to use. The default the value if 1. This field corresponds to the
machineSpec.acceleratorCount
field inResourcePool
API message. disk-type
-
(Optional) The type of disk to use for each machine's boot disk in the resource
pool. The default is
pd-standard
. This field corresponds to thediskSpec.bootDiskType
field inResourcePool
API message. disk-size
-
(Optional) The disk size in Gb for each machine's boot disk in the resource
pool. The default is
100
. This field corresponds to thediskSpec.bootDiskSizeGb
field inResourcePool
API message.
- OPTIONAL FLAGS
-
--display-name
=DISPLAY_NAME
- Display name of the Persistent Resource.
--enable-custom-service-account
- Whether or not to use a custom user-managed service account with this Persistent Resource.
--labels
=[KEY
=VALUE
,…]-
List of label KEY=VALUE pairs to add.
Keys must start with a lowercase character and contain only hyphens (
-
), underscores (_
), lowercase characters, and numbers. Values must contain only hyphens (-
), underscores (_
), lowercase characters, and numbers. --network
=NETWORK
- Full name of the Google Compute Engine network to which the Job is peered with. Private services access must already have been configured. If unspecified, the Job is not peered with any network.
-
Region resource - Cloud region to create a Persistent Resource. This represents
a Cloud resource. (NOTE) Some attributes are not given arguments in this group
but can be set in other ways.
To set the
project
attribute:-
provide the argument
--region
on the command line with a fully specified name; -
set the property
ai/region
with a fully specified name; - choose one from the prompted list of available regions with a fully specified name;
-
provide the argument
--project
on the command line; -
set the property
core/project
.
--region
=REGION
-
ID of the region or fully qualified identifier for the region.
To set the
region
attribute:-
provide the argument
--region
on the command line; -
set the property
ai/region
; - choose one from the prompted list of available regions.
-
provide the argument
-
provide the argument
-
Key resource - The Cloud KMS (Key Management Service) cryptokey that will be
used to protect the persistent resource. The 'Vertex AI Service Agent' service
account must hold permission 'Cloud KMS CryptoKey Encrypter/Decrypter'. The
arguments in this group can be used to specify the attributes of this resource.
--kms-key
=KMS_KEY
-
ID of the key or fully qualified identifier for the key.
To set the
kms-key
attribute:-
provide the argument
--kms-key
on the command line.
This flag argument must be specified if any of the other arguments in this group are specified.
-
provide the argument
--kms-keyring
=KMS_KEYRING
-
The KMS keyring of the key.
To set the
kms-keyring
attribute:-
provide the argument
--kms-key
on the command line with a fully specified name; -
provide the argument
--kms-keyring
on the command line.
-
provide the argument
--kms-location
=KMS_LOCATION
-
The Google Cloud location for the key.
To set the
kms-location
attribute:-
provide the argument
--kms-key
on the command line with a fully specified name; -
provide the argument
--kms-location
on the command line.
-
provide the argument
--kms-project
=KMS_PROJECT
-
The Google Cloud project for the key.
To set the
kms-project
attribute:-
provide the argument
--kms-key
on the command line with a fully specified name; -
provide the argument
--kms-project
on the command line; -
set the property
core/project
.
-
provide the argument
- GCLOUD WIDE FLAGS
-
These flags are available to all commands:
--access-token-file
,--account
,--billing-project
,--configuration
,--flags-file
,--flatten
,--format
,--help
,--impersonate-service-account
,--log-http
,--project
,--quiet
,--trace-token
,--user-output-enabled
,--verbosity
.Run
$ gcloud help
for details. - NOTES
-
These variants are also available:
gcloud alpha ai persistent-resources create
gcloud beta ai persistent-resources create
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 2024-04-16 UTC.