1

We have decided to use higher-spec managed notebooks in our company and would like to set up cost alerts to manage our charges.

We attempted to perform a cost analysis by assigning labels, but we were unable to find a way to label the managed instances.

Here's what we tried:

  • We confirmed that the label settings don't exist when creating the instances in the GUI.
  • We also verified that label settings in virtual_machine_config.label and virtual_machine_config.data_disk.initialize_params.label don't reflect in the filters of cost alerts. It is possible that the Managed Notebook doesn't support labels in its specifications.

Our goal is to understand the cost of a specific Managed Notebook. Please let us know if there's any way to meet this requirement, even if it involves a workaround.

gogasca
  • 9,283
  • 6
  • 80
  • 125
miu miu
  • 13
  • 2

1 Answers1

0

You are correct, 3 issues:

  1. we currently do not expose Label option at creation time in UI.

  2. The following labels do not apply to Billing.

  • virtual_machine_config.label
  • virtual_machine_config.data_disk.initialize_params.label
  1. Labels are not supported via SDK (gcloud notebooks).

The good news is that you can assign labels at Runtime level. This should work using API via create and update(patch) methods.

https://cloud.google.com/vertex-ai/docs/workbench/reference/rest/v1/projects.locations.runtimes#Runtime

{
  "name": string,
  "state": enum (State),
  "healthState": enum (HealthState),
  "accessConfig": {
    object (RuntimeAccessConfig)
  },
  "softwareConfig": {
    object (RuntimeSoftwareConfig)
  },
  "metrics": {
    object (RuntimeMetrics)
  },
  "createTime": string,
  "updateTime": string,
  "labels": {
    string: string,
    ...
  },
gogasca
  • 9,283
  • 6
  • 80
  • 125
  • 1
    Thanks alot. We have successfully labeled the cost analysis possible. I can also confirm that the existing Terraform configuration management is not affected at all, which is what we wanted. I will include the commands in the record. ACCESS_TOKEN=`gcloud auth print-access-token` curl -X PATCH -H "Authorization: Bearer ${ACCESS_TOKEN}" -H "Content-Type: application/json" -d '{"updateMask": "labels", "resource": {"labels": {"user": "user01"}}}' \ "https://notebooks.googleapis.com/v1/projects//locations//runtimes/" – miu miu Jun 29 '23 at 13:51