I am trying to submit a job to Google Batch that uses the Flex-Start provisioning model. It seems to get rejected with the following error if a timeout is included for the Runnable:
Job gets no longer retryable information Batch Error: code - CODE_GCE_BAD_REQUEST, description - googleapi: Error 400: Invalid value for field ‘resource.properties.scheduling.maxRunDuration’: ‘{ “seconds”: “604800”}’. max-run-duration for given provisioning model is not supported without an instance termination action., invalid, already retried 3 times, errors record CODE_GCE_BAD_REQUEST.
It’s not clear to me how to set an instance termination action for the underlying VM. Is there a better way to set a job timeout?
allocationPolicy:
instances:
- policy:
accelerators:
- count: '1'
type: nvidia-l4
bootDisk:
image: <redacted>
machineType: g2-standard-4
provisioningModel: FLEX_START
status:
runDuration: 0s
state: FAILED
statusEvents:
- description: "Job gets no longer retryable information Batch Error: code - CODE_GCE_BAD_REQUEST,\
\ description - googleapi: Error 400: Invalid value for field 'resource.properties.scheduling.maxRunDuration':\
\ '{ \"seconds\": \"604800\"}'. max-run-duration for given provisioning model\
\ is not supported without an instance termination action., invalid, already\
\ retried 3 times, errors record CODE_GCE_BAD_REQUEST."
eventTime: '2026-04-30T21:03:53.889120789Z'
taskGroups:
- name: (PII Removed by Staff)
parallelism: '1'
taskCount: '1'
taskSpec:
runnables:
- script:
text: ...
timeout: 3600s