1.57.0 (latest) 1.56.0 1.55.0 1.54.0 1.53.0 1.52.0 1.51.0 1.50.0 1.49.0 1.48.0 1.41.0 1.40.0 1.39.0 1.38.0 1.37.0 1.36.0 1.35.0 1.34.0 1.33.0 1.32.0 1.31.0 1.30.0 1.29.0 1.28.0 1.27.0 1.26.0 1.25.0 1.24.0 1.23.0 1.22.0 1.21.0 1.20.1 1.19.2 1.18.0 1.17.0 1.16.1 1.15.0 1.14.1 1.13.0 1.12.1 1.11.0 1.10.1 1.9.0 1.8.0 1.7.0 1.6.1 1.5.2 1.4.0 1.3.2 1.2.0 1.1.0 1.0.0 0.9.0 0.8.0 0.7.0 0.6.0 0.5.0 0.4.2 0.3.0 0.2.1 0.1.0

```python
Scheduling(mapping=None, *, ignore_unknown_fields=False, **kwargs)
```
Sets the scheduling options for an Instance.

.. _oneof: <https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields>

| ## Attributes ||
|---|---|
| **Name** | **Description** |
| `automatic_restart` | `bool` Specifies whether the instance should be automatically restarted if it is terminated by Compute Engine (not terminated by a user). You can only set the automatic restart option for standard instances.Preemptible instances cannot be automatically restarted. By default, this is set to true so an instance is automatically restarted if it is terminated by Compute Engine. This field is a member of `oneof`_ `_automatic_restart`. |
| `availability_domain` | `int` Specifies the availability domain to place the instance in. The value must be a number between 1 and the number of availability domains specified in the spread placement policy attached to the instance. This field is a member of `oneof`_ `_availability_domain`. |
| `expose_host_topology` | `bool` This optional flag exposes the hashed physical host ID in the ResourceStatus resource of the VM. This field is a member of `oneof`_ `_expose_host_topology`. |
| `graceful_shutdown` | `google.cloud.compute_v1.types.SchedulingGracefulShutdown` This field is a member of `oneof`_ `_graceful_shutdown`. |
| `host_error_timeout_seconds` | `int` Specify the time in seconds for host error detection, the value must be within the range of \[90, 330\] with the increment of 30, if unset, the default behavior of host error recovery will be used. This field is a member of `oneof`_ `_host_error_timeout_seconds`. |
| `instance_termination_action` | `str` Specifies the termination action for the instance. Check the InstanceTerminationAction enum for the list of possible values. This field is a member of `oneof`_ `_instance_termination_action`. |
| `local_ssd_recovery_timeout` | `google.cloud.compute_v1.types.Duration` Specifies the maximum amount of time a Local Ssd Vm should wait while recovery of the Local Ssd state is attempted. Its value should be in between 0 and 168 hours with hour granularity and the default value being 1 hour. This field is a member of `oneof`_ `_local_ssd_recovery_timeout`. |
| `location_hint` | `str` An opaque location hint used to place the instance close to other resources. This field is for use by internal tools that use the public API. This field is a member of `oneof`_ `_location_hint`. |
| `max_run_duration` | `google.cloud.compute_v1.types.Duration` Specifies the max run duration for the given instance. If specified, the instance termination action will be performed at the end of the run duration. This field is a member of `oneof`_ `_max_run_duration`. |
| `min_node_cpus` | `int` The minimum number of virtual CPUs this instance will consume when running on a sole-tenant node. This field is a member of `oneof`_ `_min_node_cpus`. |
| `node_affinities` | `MutableSequence[google.cloud.compute_v1.types.SchedulingNodeAffinity]` A set of node affinity and anti-affinity configurations. Refer toConfiguring node affinity for more information. Overrides reservationAffinity. |
| `on_host_maintenance` | `str` Defines the maintenance behavior for this instance. For standard instances, the default behavior is MIGRATE. Forpreemptible instances, the default and only possible behavior is TERMINATE. For more information, see Set VM host maintenance policy. Check the OnHostMaintenance enum for the list of possible values. This field is a member of `oneof`_ `_on_host_maintenance`. |
| `on_instance_stop_action` | `google.cloud.compute_v1.types.SchedulingOnInstanceStopAction` This field is a member of `oneof`_ `_on_instance_stop_action`. |
| `preemptible` | `bool` Defines whether the instance is preemptible. This can only be set during instance creation or while the instance isstopped and therefore, in a `TERMINATED` state. SeeInstance Life Cycle for more information on the possible instance states. This field is a member of `oneof`_ `_preemptible`. |
| `preemption_notice_duration` | `google.cloud.compute_v1.types.Duration` Specifies the Metadata Service preemption notice duration before the GCE ACPI G2 Soft Off signal is triggered for Spot VMs only. If not specified, there will be no wait before the G2 Soft Off signal is triggered. This field is a member of `oneof`_ `_preemption_notice_duration`. |
| `protection_tier` | `str` Protection tier for the workload which specifies the workload expectations in the event of infrastructure failures at data center (e.g. power and/or cooling failures). Check the ProtectionTier enum for the list of possible values. This field is a member of `oneof`_ `_protection_tier`. |
| `provisioning_model` | `str` Specifies the provisioning model of the instance. Check the ProvisioningModel enum for the list of possible values. This field is a member of `oneof`_ `_provisioning_model`. |
| `skip_guest_os_shutdown` | `bool` Defines whether GCE ACPI G2 Soft Off signal should be skipped during shutdown operation of VM. Default is false, meaning there will be 120 seconds between GCE ACPI G2 Soft Off and ACPI G3 Mechanical Off for Standard VMs and 30 seconds for Spot VMs. This field is a member of `oneof`_ `_skip_guest_os_shutdown`. |
| `termination_time` | `str` Specifies the timestamp, when the instance will be terminated, inRFC3339 text format. If specified, the instance termination action will be performed at the termination time. This field is a member of `oneof`_ `_termination_time`. |

## Classes

### InstanceTerminationAction

```python
InstanceTerminationAction(value)
```
Specifies the termination action for the instance.

### OnHostMaintenance

```python
OnHostMaintenance(value)
```
Defines the maintenance behavior for this instance. For
standard instances, the default behavior is MIGRATE.
Forpreemptible instances, the default and only possible behavior
is TERMINATE. For more information, see
Set
VM host maintenance policy.

### ProtectionTier

```python
ProtectionTier(value)
```
Protection tier for the workload which specifies the workload
expectations in the event of infrastructure failures at data
center (e.g. power and/or cooling failures).

### ProvisioningModel

```python
ProvisioningModel(value)
```
Specifies the provisioning model of the instance.