# Google Cloud Vm Migration V1 Client - Class ComputeScheduling (1.4.0)

1.4.0 (latest) 1.3.0 1.2.1 1.1.0 1.0.5 0.6.5 0.5.2 0.4.2 0.3.2 0.2.3 Reference documentation and code samples for the Google Cloud Vm Migration V1 Client class ComputeScheduling.

Scheduling information for VM on maintenance/restart behaviour and
node allocation in sole tenant nodes.

Options for instance behavior when the host machine undergoes
maintenance that may temporarily impact instance performance.

Generated from protobuf message `google.cloud.vmmigration.v1.ComputeScheduling`

## Namespace

Google \\ Cloud \\ VMMigration \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ on_host_maintenance` | `int` How the instance should behave when the host machine undergoes maintenance that may temporarily impact instance performance. |
| `↳ restart_type` | `int` Whether the Instance should be automatically restarted whenever it is terminated by Compute Engine (not terminated by user). This configuration is identical to `automaticRestart` field in Compute Engine create instance under scheduling. It was changed to an enum (instead of a boolean) to match the default value in Compute Engine which is automatic restart. |
| `↳ node_affinities` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-vm-migration/latest/V1.SchedulingNodeAffinity>` A set of node affinity and anti-affinity configurations for sole tenant nodes. |
| `↳ min_node_cpus` | `int` The minimum number of virtual CPUs this instance will consume when running on a sole-tenant node. Ignored if no node_affinites are configured. |

### getOnHostMaintenance

How the instance should behave when the host machine undergoes
maintenance that may temporarily impact instance performance.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [OnHostMaintenance](https://docs.cloud.google.com/php/docs/reference/cloud-vm-migration/latest/V1.ComputeScheduling.OnHostMaintenance). |

### setOnHostMaintenance

How the instance should behave when the host machine undergoes
maintenance that may temporarily impact instance performance.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [OnHostMaintenance](https://docs.cloud.google.com/php/docs/reference/cloud-vm-migration/latest/V1.ComputeScheduling.OnHostMaintenance). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getRestartType

Whether the Instance should be automatically restarted whenever it is
terminated by Compute Engine (not terminated by user).

This configuration is identical to `automaticRestart` field in Compute
Engine create instance under scheduling.
It was changed to an enum (instead of a boolean) to match the default
value in Compute Engine which is automatic restart.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [RestartType](https://docs.cloud.google.com/php/docs/reference/cloud-vm-migration/latest/V1.ComputeScheduling.RestartType). |

### setRestartType

Whether the Instance should be automatically restarted whenever it is
terminated by Compute Engine (not terminated by user).

This configuration is identical to `automaticRestart` field in Compute
Engine create instance under scheduling.
It was changed to an enum (instead of a boolean) to match the default
value in Compute Engine which is automatic restart.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [RestartType](https://docs.cloud.google.com/php/docs/reference/cloud-vm-migration/latest/V1.ComputeScheduling.RestartType). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getNodeAffinities

A set of node affinity and anti-affinity configurations for sole tenant
nodes.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-vm-migration/latest/V1.SchedulingNodeAffinity>` |   |

### setNodeAffinities

A set of node affinity and anti-affinity configurations for sole tenant
nodes.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-vm-migration/latest/V1.SchedulingNodeAffinity>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getMinNodeCpus

The minimum number of virtual CPUs this instance will consume when
running on a sole-tenant node. Ignored if no node_affinites are
configured.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### setMinNodeCpus

The minimum number of virtual CPUs this instance will consume when
running on a sole-tenant node. Ignored if no node_affinites are
configured.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |