Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

how can i get labels on boot disk when gcp batch to create vm/instance template/boot disk

I create batch tasks with carefully  chosen labels to track and monitor costs.

I'm using python `google.cloud.batch_v1` to create my batch jobs and I've tried setting the labels field throughout the protobuf structure associated with creating the batch job.

The labels field has been set on:

- batch_v1.Runnable
batch_v1.AllocationPolicy
batch_v1.Job

This gets my labels set on the instances -- which is good, but not on the boot disk attached to the instance.  Any idea how this can be fixed?  It would certainly be nice if google batch would propogate through the labels set on the job to literally everything it creates -- however ... definitely doesn't do that on its own and seems to create some resources that don't have a way to be labeled at all ...

Solved Solved
1 4 313
1 ACCEPTED SOLUTION

Since I posted this the behavior has changed and I now see the labels I desire on the disks and other resources created by the batch service.  That's great! 

View solution in original post