Skip to content

computepb: Add support for labelling individual VMs on instance bulk insert requests #20595

Description

@ssales-asml

Is your feature request related to a problem? Please describe.

Creating VMs in bulk doesn't allow us to setup labels per VM. This creates a problem because within our organization we have several labels that we need to use on all resources, which in this case are unique per VM. We follow best practices and VMs that share similar configurations are created with the bulk API. We cannot use the single API because that will blow up the API rate limit quota and, we simply do way too many requests to justify a retry mechanism with single API, which would just slow down our application. Support for per VM labelling on bulk requests would solve this issue.

Describe the solution you'd like

As per the code at https://github.com/googleapis/google-cloud-go/blob/compute/v1.70.0/compute/apiv1/computepb/compute.pb.go there is a struct BulkInsertInstanceResourcePerInstanceProperties which seems to be the right place to add a field for labels. Because then in BulkInsertInstanceResource.PerInstanceProperties we can map the name to specific properties.

Describe alternatives you've considered

  • Using only single API: way back in the past we used to, but then added bulk. We create way too many VMs, and a retry mechanism slows down the application a lot. Not to mention the fact that this is just simply a bad practice.
  • Updating the labels when starting the VM: this just goes back to the API rate limit quota issue, where in this case we would slow down the startup of the VM. All the VMs would be competing for the same API call when trying to label themselves. Another detail to this is that these VMs are short-lived and they need to execute their startup script as fast as they can, so we want to minimize extra configuration in it.

Additional context

N/A

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: questionRequest for information or clarification. Not an issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions