0

I'm trying to instantiate a VM with a maximum run duration as described here.

from google.cloud import compute_v1
...
instance = compute_v1.Instance()
instance.scheduling = compute_v1.Scheduling()
instance.scheduling.instant_termination_action = "DELETE"
instance.scheduling.max_run_duration = '60s'

This code throws an AttributeError: Unknown field for Scheduling: max_run_duration

I'm assuming that since the maxRunDuration field is in preview only, the Python client doesn't recognize it.

Is there any other way to set the maximum run duration using the Python client?

Brian
  • 165
  • 1
  • 3
  • 6
  • Currently, the official way is via the REST API and this feature is not yet supported. You may file a [Feature Request](https://issuetracker.google.com/). However, there is no ETA for when it will be implemented. – Siegfred V. Mar 13 '23 at 15:41

0 Answers0