Class: Google::Cloud::Batch::V1::AllocationPolicy

Inherits:
Object
  • Object
show all
Extended by:
Protobuf::MessageExts::ClassMethods
Includes:
Protobuf::MessageExts
Defined in:
proto_docs/google/cloud/batch/v1/job.rb

Overview

A Job's resource allocation policy describes when, where, and how compute resources should be allocated for the Job.

Defined Under Namespace

Modules: ProvisioningModel Classes: Accelerator, AttachedDisk, Disk, InstancePolicy, InstancePolicyOrTemplate, LabelsEntry, LocationPolicy, NetworkInterface, NetworkPolicy, PlacementPolicy

Instance Attribute Summary collapse

Instance Attribute Details

#instances::Array<::Google::Cloud::Batch::V1::AllocationPolicy::InstancePolicyOrTemplate>

Returns Describe instances that can be created by this AllocationPolicy. Only instances[0] is supported now.

Returns:



328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
# File 'proto_docs/google/cloud/batch/v1/job.rb', line 328

class AllocationPolicy
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # @!attribute [rw] allowed_locations
  #   @return [::Array<::String>]
  #     A list of allowed location names represented by internal URLs.
  #
  #     Each location can be a region or a zone.
  #     Only one region or multiple zones in one region is supported now.
  #     For example,
  #     ["regions/us-central1"] allow VMs in any zones in region us-central1.
  #     ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
  #     in zones us-central1-a and us-central1-c.
  #
  #     All locations end up in different regions would cause errors.
  #     For example,
  #     ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
  #     "zones/us-west1-a"] contains 2 regions "us-central1" and
  #     "us-west1". An error is expected in this case.
  class LocationPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A new persistent disk or a local ssd.
  # A VM can only have one local SSD setting but multiple local SSD partitions.
  # See https://cloud.google.com/compute/docs/disks#pdspecs and
  # https://cloud.google.com/compute/docs/disks#localssds.
  # @!attribute [rw] image
  #   @return [::String]
  #     URL for a VM image to use as the data source for this disk.
  #     For example, the following are all valid URLs:
  #
  #     * Specify the image by its family name:
  #     projects/\\{project}/global/images/family/\\{image_family}
  #     * Specify the image version:
  #     projects/\\{project}/global/images/\\{image_version}
  #
  #     You can also use Batch customized image in short names.
  #     The following image values are supported for a boot disk:
  #
  #     * `batch-debian`: use Batch Debian images.
  #     * `batch-centos`: use Batch CentOS images.
  #     * `batch-cos`: use Batch Container-Optimized images.
  #     * `batch-hpc-centos`: use Batch HPC CentOS images.
  #     * `batch-hpc-rocky`: use Batch HPC Rocky Linux images.
  # @!attribute [rw] snapshot
  #   @return [::String]
  #     Name of a snapshot used as the data source.
  #     Snapshot is not supported as boot disk now.
  # @!attribute [rw] type
  #   @return [::String]
  #     Disk type as shown in `gcloud compute disk-types list`.
  #     For example, local SSD uses type "local-ssd".
  #     Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd"
  #     or "pd-standard".
  # @!attribute [rw] size_gb
  #   @return [::Integer]
  #     Disk size in GB.
  #
  #     **Non-Boot Disk**:
  #     If the `type` specifies a persistent disk, this field
  #     is ignored if `data_source` is set as `image` or `snapshot`.
  #     If the `type` specifies a local SSD, this field should be a multiple of
  #     375 GB, otherwise, the final size will be the next greater multiple of
  #     375 GB.
  #
  #     **Boot Disk**:
  #     Batch will calculate the boot disk size based on source
  #     image and task requirements if you do not speicify the size.
  #     If both this field and the `boot_disk_mib` field in task spec's
  #     `compute_resource` are defined, Batch will only honor this field.
  #     Also, this field should be no smaller than the source disk's
  #     size when the `data_source` is set as `snapshot` or `image`.
  #     For example, if you set an image as the `data_source` field and the
  #     image's default disk size 30 GB, you can only use this field to make the
  #     disk larger or equal to 30 GB.
  # @!attribute [rw] disk_interface
  #   @return [::String]
  #     Local SSDs are available through both "SCSI" and "NVMe" interfaces.
  #     If not indicated, "NVMe" will be the default one for local ssds.
  #     This field is ignored for persistent disks as the interface is chosen
  #     automatically. See
  #     https://cloud.google.com/compute/docs/disks/persistent-disks#choose_an_interface.
  class Disk
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A new or an existing persistent disk (PD) or a local ssd attached to a VM
  # instance.
  # @!attribute [rw] new_disk
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::Disk]
  # @!attribute [rw] existing_disk
  #   @return [::String]
  #     Name of an existing PD.
  # @!attribute [rw] device_name
  #   @return [::String]
  #     Device name that the guest operating system will see.
  #     It is used by Runnable.volumes field to mount disks. So please specify
  #     the device_name if you want Batch to help mount the disk, and it should
  #     match the device_name field in volumes.
  class AttachedDisk
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Accelerator describes Compute Engine accelerators to be attached to the VM.
  # @!attribute [rw] type
  #   @return [::String]
  #     The accelerator type. For example, "nvidia-tesla-t4".
  #     See `gcloud compute accelerator-types list`.
  # @!attribute [rw] count
  #   @return [::Integer]
  #     The number of accelerators of this type.
  # @!attribute [rw] install_gpu_drivers
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Boolean]
  #     Deprecated: please use instances[0].install_gpu_drivers instead.
  # @!attribute [rw] driver_version
  #   @return [::String]
  #     Optional. The NVIDIA GPU driver version that should be installed for this
  #     type.
  #
  #     You can define the specific driver version such as "470.103.01",
  #     following the driver version requirements in
  #     https://cloud.google.com/compute/docs/gpus/install-drivers-gpu#minimum-driver.
  #     Batch will install the specific accelerator driver if qualified.
  class Accelerator
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # InstancePolicy describes an instance type and resources attached to each VM
  # created by this InstancePolicy.
  # @!attribute [rw] machine_type
  #   @return [::String]
  #     The Compute Engine machine type.
  # @!attribute [rw] min_cpu_platform
  #   @return [::String]
  #     The minimum CPU platform.
  #     See
  #     https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform.
  # @!attribute [rw] provisioning_model
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::ProvisioningModel]
  #     The provisioning model.
  # @!attribute [rw] accelerators
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::Accelerator>]
  #     The accelerators attached to each VM instance.
  # @!attribute [rw] boot_disk
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::Disk]
  #     Boot disk to be created and attached to each VM by this InstancePolicy.
  #     Boot disk will be deleted when the VM is deleted.
  #     Batch API now only supports booting from image.
  # @!attribute [rw] disks
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::AttachedDisk>]
  #     Non-boot disks to be attached for each VM created by this InstancePolicy.
  #     New disks will be deleted when the VM is deleted.
  #     A non-boot disk is a disk that can be of a device with a
  #     file system or a raw storage drive that is not ready for data
  #     storage and accessing.
  # @!attribute [rw] reservation
  #   @return [::String]
  #     Optional. If specified, VMs will consume only the specified reservation.
  #     If not specified (default), VMs will consume any applicable reservation.
  class InstancePolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # InstancePolicyOrTemplate lets you define the type of resources to use for
  # this job either with an InstancePolicy or an instance template.
  # If undefined, Batch picks the type of VM to use and doesn't include
  # optional VM resources such as GPUs and extra disks.
  # @!attribute [rw] policy
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::InstancePolicy]
  #     InstancePolicy.
  # @!attribute [rw] instance_template
  #   @return [::String]
  #     Name of an instance template used to create VMs.
  #     Named the field as 'instance_template' instead of 'template' to avoid
  #     c++ keyword conflict.
  # @!attribute [rw] install_gpu_drivers
  #   @return [::Boolean]
  #     Set this field true if users want Batch to help fetch drivers from a
  #     third party location and install them for GPUs specified in
  #     policy.accelerators or instance_template on their behalf. Default is
  #     false.
  #
  #     For Container-Optimized Image cases, Batch will install the
  #     accelerator driver following milestones of
  #     https://cloud.google.com/container-optimized-os/docs/release-notes. For
  #     non Container-Optimized Image cases, following
  #     https://github.com/GoogleCloudPlatform/compute-gpu-installation/blob/main/linux/install_gpu_driver.py.
  class InstancePolicyOrTemplate
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A network interface.
  # @!attribute [rw] network
  #   @return [::String]
  #     The URL of an existing network resource.
  #     You can specify the network as a full or partial URL.
  #
  #     For example, the following are all valid URLs:
  #
  #     * https://www.googleapis.com/compute/v1/projects/\\{project}/global/networks/\\{network}
  #     * projects/\\{project}/global/networks/\\{network}
  #     * global/networks/\\{network}
  # @!attribute [rw] subnetwork
  #   @return [::String]
  #     The URL of an existing subnetwork resource in the network.
  #     You can specify the subnetwork as a full or partial URL.
  #
  #     For example, the following are all valid URLs:
  #
  #     * https://www.googleapis.com/compute/v1/projects/\\{project}/regions/\\{region}/subnetworks/\\{subnetwork}
  #     * projects/\\{project}/regions/\\{region}/subnetworks/\\{subnetwork}
  #     * regions/\\{region}/subnetworks/\\{subnetwork}
  # @!attribute [rw] no_external_ip_address
  #   @return [::Boolean]
  #     Default is false (with an external IP address). Required if
  #     no external public IP address is attached to the VM. If no external
  #     public IP address, additional configuration is required to allow the VM
  #     to access Google Services. See
  #     https://cloud.google.com/vpc/docs/configure-private-google-access and
  #     https://cloud.google.com/nat/docs/gce-example#create-nat for more
  #     information.
  class NetworkInterface
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # NetworkPolicy describes VM instance network configurations.
  # @!attribute [rw] network_interfaces
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::NetworkInterface>]
  #     Network configurations.
  class NetworkPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # PlacementPolicy describes a group placement policy for the VMs controlled
  # by this AllocationPolicy.
  # @!attribute [rw] collocation
  #   @return [::String]
  #     UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you
  #     want VMs to be located close to each other for low network latency
  #     between the VMs. No placement policy will be generated when collocation
  #     is UNSPECIFIED.
  # @!attribute [rw] max_distance
  #   @return [::Integer]
  #     When specified, causes the job to fail if more than max_distance logical
  #     switches are required between VMs. Batch uses the most compact possible
  #     placement of VMs even when max_distance is not specified. An explicit
  #     max_distance makes that level of compactness a strict requirement.
  #     Not yet implemented
  class PlacementPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class LabelsEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Compute Engine VM instance provisioning model.
  module ProvisioningModel
    # Unspecified.
    PROVISIONING_MODEL_UNSPECIFIED = 0

    # Standard VM.
    STANDARD = 1

    # SPOT VM.
    SPOT = 2

    # Preemptible VM (PVM).
    #
    # Above SPOT VM is the preferable model for preemptible VM instances: the
    # old preemptible VM model (indicated by this field) is the older model,
    # and has been migrated to use the SPOT model as the underlying technology.
    # This old model will still be supported.
    PREEMPTIBLE = 3
  end
end

#labels::Google::Protobuf::Map{::String => ::String}

Returns Labels applied to all VM instances and other resources created by AllocationPolicy. Labels could be user provided or system generated. You can assign up to 64 labels. Google Compute Engine label restrictions apply. Label names that start with "goog-" or "google-" are reserved.

Returns:

  • (::Google::Protobuf::Map{::String => ::String})

    Labels applied to all VM instances and other resources created by AllocationPolicy. Labels could be user provided or system generated. You can assign up to 64 labels. Google Compute Engine label restrictions apply. Label names that start with "goog-" or "google-" are reserved.



328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
# File 'proto_docs/google/cloud/batch/v1/job.rb', line 328

class AllocationPolicy
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # @!attribute [rw] allowed_locations
  #   @return [::Array<::String>]
  #     A list of allowed location names represented by internal URLs.
  #
  #     Each location can be a region or a zone.
  #     Only one region or multiple zones in one region is supported now.
  #     For example,
  #     ["regions/us-central1"] allow VMs in any zones in region us-central1.
  #     ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
  #     in zones us-central1-a and us-central1-c.
  #
  #     All locations end up in different regions would cause errors.
  #     For example,
  #     ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
  #     "zones/us-west1-a"] contains 2 regions "us-central1" and
  #     "us-west1". An error is expected in this case.
  class LocationPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A new persistent disk or a local ssd.
  # A VM can only have one local SSD setting but multiple local SSD partitions.
  # See https://cloud.google.com/compute/docs/disks#pdspecs and
  # https://cloud.google.com/compute/docs/disks#localssds.
  # @!attribute [rw] image
  #   @return [::String]
  #     URL for a VM image to use as the data source for this disk.
  #     For example, the following are all valid URLs:
  #
  #     * Specify the image by its family name:
  #     projects/\\{project}/global/images/family/\\{image_family}
  #     * Specify the image version:
  #     projects/\\{project}/global/images/\\{image_version}
  #
  #     You can also use Batch customized image in short names.
  #     The following image values are supported for a boot disk:
  #
  #     * `batch-debian`: use Batch Debian images.
  #     * `batch-centos`: use Batch CentOS images.
  #     * `batch-cos`: use Batch Container-Optimized images.
  #     * `batch-hpc-centos`: use Batch HPC CentOS images.
  #     * `batch-hpc-rocky`: use Batch HPC Rocky Linux images.
  # @!attribute [rw] snapshot
  #   @return [::String]
  #     Name of a snapshot used as the data source.
  #     Snapshot is not supported as boot disk now.
  # @!attribute [rw] type
  #   @return [::String]
  #     Disk type as shown in `gcloud compute disk-types list`.
  #     For example, local SSD uses type "local-ssd".
  #     Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd"
  #     or "pd-standard".
  # @!attribute [rw] size_gb
  #   @return [::Integer]
  #     Disk size in GB.
  #
  #     **Non-Boot Disk**:
  #     If the `type` specifies a persistent disk, this field
  #     is ignored if `data_source` is set as `image` or `snapshot`.
  #     If the `type` specifies a local SSD, this field should be a multiple of
  #     375 GB, otherwise, the final size will be the next greater multiple of
  #     375 GB.
  #
  #     **Boot Disk**:
  #     Batch will calculate the boot disk size based on source
  #     image and task requirements if you do not speicify the size.
  #     If both this field and the `boot_disk_mib` field in task spec's
  #     `compute_resource` are defined, Batch will only honor this field.
  #     Also, this field should be no smaller than the source disk's
  #     size when the `data_source` is set as `snapshot` or `image`.
  #     For example, if you set an image as the `data_source` field and the
  #     image's default disk size 30 GB, you can only use this field to make the
  #     disk larger or equal to 30 GB.
  # @!attribute [rw] disk_interface
  #   @return [::String]
  #     Local SSDs are available through both "SCSI" and "NVMe" interfaces.
  #     If not indicated, "NVMe" will be the default one for local ssds.
  #     This field is ignored for persistent disks as the interface is chosen
  #     automatically. See
  #     https://cloud.google.com/compute/docs/disks/persistent-disks#choose_an_interface.
  class Disk
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A new or an existing persistent disk (PD) or a local ssd attached to a VM
  # instance.
  # @!attribute [rw] new_disk
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::Disk]
  # @!attribute [rw] existing_disk
  #   @return [::String]
  #     Name of an existing PD.
  # @!attribute [rw] device_name
  #   @return [::String]
  #     Device name that the guest operating system will see.
  #     It is used by Runnable.volumes field to mount disks. So please specify
  #     the device_name if you want Batch to help mount the disk, and it should
  #     match the device_name field in volumes.
  class AttachedDisk
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Accelerator describes Compute Engine accelerators to be attached to the VM.
  # @!attribute [rw] type
  #   @return [::String]
  #     The accelerator type. For example, "nvidia-tesla-t4".
  #     See `gcloud compute accelerator-types list`.
  # @!attribute [rw] count
  #   @return [::Integer]
  #     The number of accelerators of this type.
  # @!attribute [rw] install_gpu_drivers
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Boolean]
  #     Deprecated: please use instances[0].install_gpu_drivers instead.
  # @!attribute [rw] driver_version
  #   @return [::String]
  #     Optional. The NVIDIA GPU driver version that should be installed for this
  #     type.
  #
  #     You can define the specific driver version such as "470.103.01",
  #     following the driver version requirements in
  #     https://cloud.google.com/compute/docs/gpus/install-drivers-gpu#minimum-driver.
  #     Batch will install the specific accelerator driver if qualified.
  class Accelerator
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # InstancePolicy describes an instance type and resources attached to each VM
  # created by this InstancePolicy.
  # @!attribute [rw] machine_type
  #   @return [::String]
  #     The Compute Engine machine type.
  # @!attribute [rw] min_cpu_platform
  #   @return [::String]
  #     The minimum CPU platform.
  #     See
  #     https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform.
  # @!attribute [rw] provisioning_model
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::ProvisioningModel]
  #     The provisioning model.
  # @!attribute [rw] accelerators
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::Accelerator>]
  #     The accelerators attached to each VM instance.
  # @!attribute [rw] boot_disk
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::Disk]
  #     Boot disk to be created and attached to each VM by this InstancePolicy.
  #     Boot disk will be deleted when the VM is deleted.
  #     Batch API now only supports booting from image.
  # @!attribute [rw] disks
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::AttachedDisk>]
  #     Non-boot disks to be attached for each VM created by this InstancePolicy.
  #     New disks will be deleted when the VM is deleted.
  #     A non-boot disk is a disk that can be of a device with a
  #     file system or a raw storage drive that is not ready for data
  #     storage and accessing.
  # @!attribute [rw] reservation
  #   @return [::String]
  #     Optional. If specified, VMs will consume only the specified reservation.
  #     If not specified (default), VMs will consume any applicable reservation.
  class InstancePolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # InstancePolicyOrTemplate lets you define the type of resources to use for
  # this job either with an InstancePolicy or an instance template.
  # If undefined, Batch picks the type of VM to use and doesn't include
  # optional VM resources such as GPUs and extra disks.
  # @!attribute [rw] policy
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::InstancePolicy]
  #     InstancePolicy.
  # @!attribute [rw] instance_template
  #   @return [::String]
  #     Name of an instance template used to create VMs.
  #     Named the field as 'instance_template' instead of 'template' to avoid
  #     c++ keyword conflict.
  # @!attribute [rw] install_gpu_drivers
  #   @return [::Boolean]
  #     Set this field true if users want Batch to help fetch drivers from a
  #     third party location and install them for GPUs specified in
  #     policy.accelerators or instance_template on their behalf. Default is
  #     false.
  #
  #     For Container-Optimized Image cases, Batch will install the
  #     accelerator driver following milestones of
  #     https://cloud.google.com/container-optimized-os/docs/release-notes. For
  #     non Container-Optimized Image cases, following
  #     https://github.com/GoogleCloudPlatform/compute-gpu-installation/blob/main/linux/install_gpu_driver.py.
  class InstancePolicyOrTemplate
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A network interface.
  # @!attribute [rw] network
  #   @return [::String]
  #     The URL of an existing network resource.
  #     You can specify the network as a full or partial URL.
  #
  #     For example, the following are all valid URLs:
  #
  #     * https://www.googleapis.com/compute/v1/projects/\\{project}/global/networks/\\{network}
  #     * projects/\\{project}/global/networks/\\{network}
  #     * global/networks/\\{network}
  # @!attribute [rw] subnetwork
  #   @return [::String]
  #     The URL of an existing subnetwork resource in the network.
  #     You can specify the subnetwork as a full or partial URL.
  #
  #     For example, the following are all valid URLs:
  #
  #     * https://www.googleapis.com/compute/v1/projects/\\{project}/regions/\\{region}/subnetworks/\\{subnetwork}
  #     * projects/\\{project}/regions/\\{region}/subnetworks/\\{subnetwork}
  #     * regions/\\{region}/subnetworks/\\{subnetwork}
  # @!attribute [rw] no_external_ip_address
  #   @return [::Boolean]
  #     Default is false (with an external IP address). Required if
  #     no external public IP address is attached to the VM. If no external
  #     public IP address, additional configuration is required to allow the VM
  #     to access Google Services. See
  #     https://cloud.google.com/vpc/docs/configure-private-google-access and
  #     https://cloud.google.com/nat/docs/gce-example#create-nat for more
  #     information.
  class NetworkInterface
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # NetworkPolicy describes VM instance network configurations.
  # @!attribute [rw] network_interfaces
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::NetworkInterface>]
  #     Network configurations.
  class NetworkPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # PlacementPolicy describes a group placement policy for the VMs controlled
  # by this AllocationPolicy.
  # @!attribute [rw] collocation
  #   @return [::String]
  #     UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you
  #     want VMs to be located close to each other for low network latency
  #     between the VMs. No placement policy will be generated when collocation
  #     is UNSPECIFIED.
  # @!attribute [rw] max_distance
  #   @return [::Integer]
  #     When specified, causes the job to fail if more than max_distance logical
  #     switches are required between VMs. Batch uses the most compact possible
  #     placement of VMs even when max_distance is not specified. An explicit
  #     max_distance makes that level of compactness a strict requirement.
  #     Not yet implemented
  class PlacementPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class LabelsEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Compute Engine VM instance provisioning model.
  module ProvisioningModel
    # Unspecified.
    PROVISIONING_MODEL_UNSPECIFIED = 0

    # Standard VM.
    STANDARD = 1

    # SPOT VM.
    SPOT = 2

    # Preemptible VM (PVM).
    #
    # Above SPOT VM is the preferable model for preemptible VM instances: the
    # old preemptible VM model (indicated by this field) is the older model,
    # and has been migrated to use the SPOT model as the underlying technology.
    # This old model will still be supported.
    PREEMPTIBLE = 3
  end
end

#location::Google::Cloud::Batch::V1::AllocationPolicy::LocationPolicy

Returns Location where compute resources should be allocated for the Job.

Returns:



328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
# File 'proto_docs/google/cloud/batch/v1/job.rb', line 328

class AllocationPolicy
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # @!attribute [rw] allowed_locations
  #   @return [::Array<::String>]
  #     A list of allowed location names represented by internal URLs.
  #
  #     Each location can be a region or a zone.
  #     Only one region or multiple zones in one region is supported now.
  #     For example,
  #     ["regions/us-central1"] allow VMs in any zones in region us-central1.
  #     ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
  #     in zones us-central1-a and us-central1-c.
  #
  #     All locations end up in different regions would cause errors.
  #     For example,
  #     ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
  #     "zones/us-west1-a"] contains 2 regions "us-central1" and
  #     "us-west1". An error is expected in this case.
  class LocationPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A new persistent disk or a local ssd.
  # A VM can only have one local SSD setting but multiple local SSD partitions.
  # See https://cloud.google.com/compute/docs/disks#pdspecs and
  # https://cloud.google.com/compute/docs/disks#localssds.
  # @!attribute [rw] image
  #   @return [::String]
  #     URL for a VM image to use as the data source for this disk.
  #     For example, the following are all valid URLs:
  #
  #     * Specify the image by its family name:
  #     projects/\\{project}/global/images/family/\\{image_family}
  #     * Specify the image version:
  #     projects/\\{project}/global/images/\\{image_version}
  #
  #     You can also use Batch customized image in short names.
  #     The following image values are supported for a boot disk:
  #
  #     * `batch-debian`: use Batch Debian images.
  #     * `batch-centos`: use Batch CentOS images.
  #     * `batch-cos`: use Batch Container-Optimized images.
  #     * `batch-hpc-centos`: use Batch HPC CentOS images.
  #     * `batch-hpc-rocky`: use Batch HPC Rocky Linux images.
  # @!attribute [rw] snapshot
  #   @return [::String]
  #     Name of a snapshot used as the data source.
  #     Snapshot is not supported as boot disk now.
  # @!attribute [rw] type
  #   @return [::String]
  #     Disk type as shown in `gcloud compute disk-types list`.
  #     For example, local SSD uses type "local-ssd".
  #     Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd"
  #     or "pd-standard".
  # @!attribute [rw] size_gb
  #   @return [::Integer]
  #     Disk size in GB.
  #
  #     **Non-Boot Disk**:
  #     If the `type` specifies a persistent disk, this field
  #     is ignored if `data_source` is set as `image` or `snapshot`.
  #     If the `type` specifies a local SSD, this field should be a multiple of
  #     375 GB, otherwise, the final size will be the next greater multiple of
  #     375 GB.
  #
  #     **Boot Disk**:
  #     Batch will calculate the boot disk size based on source
  #     image and task requirements if you do not speicify the size.
  #     If both this field and the `boot_disk_mib` field in task spec's
  #     `compute_resource` are defined, Batch will only honor this field.
  #     Also, this field should be no smaller than the source disk's
  #     size when the `data_source` is set as `snapshot` or `image`.
  #     For example, if you set an image as the `data_source` field and the
  #     image's default disk size 30 GB, you can only use this field to make the
  #     disk larger or equal to 30 GB.
  # @!attribute [rw] disk_interface
  #   @return [::String]
  #     Local SSDs are available through both "SCSI" and "NVMe" interfaces.
  #     If not indicated, "NVMe" will be the default one for local ssds.
  #     This field is ignored for persistent disks as the interface is chosen
  #     automatically. See
  #     https://cloud.google.com/compute/docs/disks/persistent-disks#choose_an_interface.
  class Disk
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A new or an existing persistent disk (PD) or a local ssd attached to a VM
  # instance.
  # @!attribute [rw] new_disk
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::Disk]
  # @!attribute [rw] existing_disk
  #   @return [::String]
  #     Name of an existing PD.
  # @!attribute [rw] device_name
  #   @return [::String]
  #     Device name that the guest operating system will see.
  #     It is used by Runnable.volumes field to mount disks. So please specify
  #     the device_name if you want Batch to help mount the disk, and it should
  #     match the device_name field in volumes.
  class AttachedDisk
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Accelerator describes Compute Engine accelerators to be attached to the VM.
  # @!attribute [rw] type
  #   @return [::String]
  #     The accelerator type. For example, "nvidia-tesla-t4".
  #     See `gcloud compute accelerator-types list`.
  # @!attribute [rw] count
  #   @return [::Integer]
  #     The number of accelerators of this type.
  # @!attribute [rw] install_gpu_drivers
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Boolean]
  #     Deprecated: please use instances[0].install_gpu_drivers instead.
  # @!attribute [rw] driver_version
  #   @return [::String]
  #     Optional. The NVIDIA GPU driver version that should be installed for this
  #     type.
  #
  #     You can define the specific driver version such as "470.103.01",
  #     following the driver version requirements in
  #     https://cloud.google.com/compute/docs/gpus/install-drivers-gpu#minimum-driver.
  #     Batch will install the specific accelerator driver if qualified.
  class Accelerator
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # InstancePolicy describes an instance type and resources attached to each VM
  # created by this InstancePolicy.
  # @!attribute [rw] machine_type
  #   @return [::String]
  #     The Compute Engine machine type.
  # @!attribute [rw] min_cpu_platform
  #   @return [::String]
  #     The minimum CPU platform.
  #     See
  #     https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform.
  # @!attribute [rw] provisioning_model
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::ProvisioningModel]
  #     The provisioning model.
  # @!attribute [rw] accelerators
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::Accelerator>]
  #     The accelerators attached to each VM instance.
  # @!attribute [rw] boot_disk
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::Disk]
  #     Boot disk to be created and attached to each VM by this InstancePolicy.
  #     Boot disk will be deleted when the VM is deleted.
  #     Batch API now only supports booting from image.
  # @!attribute [rw] disks
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::AttachedDisk>]
  #     Non-boot disks to be attached for each VM created by this InstancePolicy.
  #     New disks will be deleted when the VM is deleted.
  #     A non-boot disk is a disk that can be of a device with a
  #     file system or a raw storage drive that is not ready for data
  #     storage and accessing.
  # @!attribute [rw] reservation
  #   @return [::String]
  #     Optional. If specified, VMs will consume only the specified reservation.
  #     If not specified (default), VMs will consume any applicable reservation.
  class InstancePolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # InstancePolicyOrTemplate lets you define the type of resources to use for
  # this job either with an InstancePolicy or an instance template.
  # If undefined, Batch picks the type of VM to use and doesn't include
  # optional VM resources such as GPUs and extra disks.
  # @!attribute [rw] policy
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::InstancePolicy]
  #     InstancePolicy.
  # @!attribute [rw] instance_template
  #   @return [::String]
  #     Name of an instance template used to create VMs.
  #     Named the field as 'instance_template' instead of 'template' to avoid
  #     c++ keyword conflict.
  # @!attribute [rw] install_gpu_drivers
  #   @return [::Boolean]
  #     Set this field true if users want Batch to help fetch drivers from a
  #     third party location and install them for GPUs specified in
  #     policy.accelerators or instance_template on their behalf. Default is
  #     false.
  #
  #     For Container-Optimized Image cases, Batch will install the
  #     accelerator driver following milestones of
  #     https://cloud.google.com/container-optimized-os/docs/release-notes. For
  #     non Container-Optimized Image cases, following
  #     https://github.com/GoogleCloudPlatform/compute-gpu-installation/blob/main/linux/install_gpu_driver.py.
  class InstancePolicyOrTemplate
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A network interface.
  # @!attribute [rw] network
  #   @return [::String]
  #     The URL of an existing network resource.
  #     You can specify the network as a full or partial URL.
  #
  #     For example, the following are all valid URLs:
  #
  #     * https://www.googleapis.com/compute/v1/projects/\\{project}/global/networks/\\{network}
  #     * projects/\\{project}/global/networks/\\{network}
  #     * global/networks/\\{network}
  # @!attribute [rw] subnetwork
  #   @return [::String]
  #     The URL of an existing subnetwork resource in the network.
  #     You can specify the subnetwork as a full or partial URL.
  #
  #     For example, the following are all valid URLs:
  #
  #     * https://www.googleapis.com/compute/v1/projects/\\{project}/regions/\\{region}/subnetworks/\\{subnetwork}
  #     * projects/\\{project}/regions/\\{region}/subnetworks/\\{subnetwork}
  #     * regions/\\{region}/subnetworks/\\{subnetwork}
  # @!attribute [rw] no_external_ip_address
  #   @return [::Boolean]
  #     Default is false (with an external IP address). Required if
  #     no external public IP address is attached to the VM. If no external
  #     public IP address, additional configuration is required to allow the VM
  #     to access Google Services. See
  #     https://cloud.google.com/vpc/docs/configure-private-google-access and
  #     https://cloud.google.com/nat/docs/gce-example#create-nat for more
  #     information.
  class NetworkInterface
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # NetworkPolicy describes VM instance network configurations.
  # @!attribute [rw] network_interfaces
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::NetworkInterface>]
  #     Network configurations.
  class NetworkPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # PlacementPolicy describes a group placement policy for the VMs controlled
  # by this AllocationPolicy.
  # @!attribute [rw] collocation
  #   @return [::String]
  #     UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you
  #     want VMs to be located close to each other for low network latency
  #     between the VMs. No placement policy will be generated when collocation
  #     is UNSPECIFIED.
  # @!attribute [rw] max_distance
  #   @return [::Integer]
  #     When specified, causes the job to fail if more than max_distance logical
  #     switches are required between VMs. Batch uses the most compact possible
  #     placement of VMs even when max_distance is not specified. An explicit
  #     max_distance makes that level of compactness a strict requirement.
  #     Not yet implemented
  class PlacementPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class LabelsEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Compute Engine VM instance provisioning model.
  module ProvisioningModel
    # Unspecified.
    PROVISIONING_MODEL_UNSPECIFIED = 0

    # Standard VM.
    STANDARD = 1

    # SPOT VM.
    SPOT = 2

    # Preemptible VM (PVM).
    #
    # Above SPOT VM is the preferable model for preemptible VM instances: the
    # old preemptible VM model (indicated by this field) is the older model,
    # and has been migrated to use the SPOT model as the underlying technology.
    # This old model will still be supported.
    PREEMPTIBLE = 3
  end
end

#network::Google::Cloud::Batch::V1::AllocationPolicy::NetworkPolicy

Returns The network policy.

If you define an instance template in the InstancePolicyOrTemplate field, Batch will use the network settings in the instance template instead of this field.

Returns:



328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
# File 'proto_docs/google/cloud/batch/v1/job.rb', line 328

class AllocationPolicy
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # @!attribute [rw] allowed_locations
  #   @return [::Array<::String>]
  #     A list of allowed location names represented by internal URLs.
  #
  #     Each location can be a region or a zone.
  #     Only one region or multiple zones in one region is supported now.
  #     For example,
  #     ["regions/us-central1"] allow VMs in any zones in region us-central1.
  #     ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
  #     in zones us-central1-a and us-central1-c.
  #
  #     All locations end up in different regions would cause errors.
  #     For example,
  #     ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
  #     "zones/us-west1-a"] contains 2 regions "us-central1" and
  #     "us-west1". An error is expected in this case.
  class LocationPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A new persistent disk or a local ssd.
  # A VM can only have one local SSD setting but multiple local SSD partitions.
  # See https://cloud.google.com/compute/docs/disks#pdspecs and
  # https://cloud.google.com/compute/docs/disks#localssds.
  # @!attribute [rw] image
  #   @return [::String]
  #     URL for a VM image to use as the data source for this disk.
  #     For example, the following are all valid URLs:
  #
  #     * Specify the image by its family name:
  #     projects/\\{project}/global/images/family/\\{image_family}
  #     * Specify the image version:
  #     projects/\\{project}/global/images/\\{image_version}
  #
  #     You can also use Batch customized image in short names.
  #     The following image values are supported for a boot disk:
  #
  #     * `batch-debian`: use Batch Debian images.
  #     * `batch-centos`: use Batch CentOS images.
  #     * `batch-cos`: use Batch Container-Optimized images.
  #     * `batch-hpc-centos`: use Batch HPC CentOS images.
  #     * `batch-hpc-rocky`: use Batch HPC Rocky Linux images.
  # @!attribute [rw] snapshot
  #   @return [::String]
  #     Name of a snapshot used as the data source.
  #     Snapshot is not supported as boot disk now.
  # @!attribute [rw] type
  #   @return [::String]
  #     Disk type as shown in `gcloud compute disk-types list`.
  #     For example, local SSD uses type "local-ssd".
  #     Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd"
  #     or "pd-standard".
  # @!attribute [rw] size_gb
  #   @return [::Integer]
  #     Disk size in GB.
  #
  #     **Non-Boot Disk**:
  #     If the `type` specifies a persistent disk, this field
  #     is ignored if `data_source` is set as `image` or `snapshot`.
  #     If the `type` specifies a local SSD, this field should be a multiple of
  #     375 GB, otherwise, the final size will be the next greater multiple of
  #     375 GB.
  #
  #     **Boot Disk**:
  #     Batch will calculate the boot disk size based on source
  #     image and task requirements if you do not speicify the size.
  #     If both this field and the `boot_disk_mib` field in task spec's
  #     `compute_resource` are defined, Batch will only honor this field.
  #     Also, this field should be no smaller than the source disk's
  #     size when the `data_source` is set as `snapshot` or `image`.
  #     For example, if you set an image as the `data_source` field and the
  #     image's default disk size 30 GB, you can only use this field to make the
  #     disk larger or equal to 30 GB.
  # @!attribute [rw] disk_interface
  #   @return [::String]
  #     Local SSDs are available through both "SCSI" and "NVMe" interfaces.
  #     If not indicated, "NVMe" will be the default one for local ssds.
  #     This field is ignored for persistent disks as the interface is chosen
  #     automatically. See
  #     https://cloud.google.com/compute/docs/disks/persistent-disks#choose_an_interface.
  class Disk
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A new or an existing persistent disk (PD) or a local ssd attached to a VM
  # instance.
  # @!attribute [rw] new_disk
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::Disk]
  # @!attribute [rw] existing_disk
  #   @return [::String]
  #     Name of an existing PD.
  # @!attribute [rw] device_name
  #   @return [::String]
  #     Device name that the guest operating system will see.
  #     It is used by Runnable.volumes field to mount disks. So please specify
  #     the device_name if you want Batch to help mount the disk, and it should
  #     match the device_name field in volumes.
  class AttachedDisk
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Accelerator describes Compute Engine accelerators to be attached to the VM.
  # @!attribute [rw] type
  #   @return [::String]
  #     The accelerator type. For example, "nvidia-tesla-t4".
  #     See `gcloud compute accelerator-types list`.
  # @!attribute [rw] count
  #   @return [::Integer]
  #     The number of accelerators of this type.
  # @!attribute [rw] install_gpu_drivers
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Boolean]
  #     Deprecated: please use instances[0].install_gpu_drivers instead.
  # @!attribute [rw] driver_version
  #   @return [::String]
  #     Optional. The NVIDIA GPU driver version that should be installed for this
  #     type.
  #
  #     You can define the specific driver version such as "470.103.01",
  #     following the driver version requirements in
  #     https://cloud.google.com/compute/docs/gpus/install-drivers-gpu#minimum-driver.
  #     Batch will install the specific accelerator driver if qualified.
  class Accelerator
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # InstancePolicy describes an instance type and resources attached to each VM
  # created by this InstancePolicy.
  # @!attribute [rw] machine_type
  #   @return [::String]
  #     The Compute Engine machine type.
  # @!attribute [rw] min_cpu_platform
  #   @return [::String]
  #     The minimum CPU platform.
  #     See
  #     https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform.
  # @!attribute [rw] provisioning_model
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::ProvisioningModel]
  #     The provisioning model.
  # @!attribute [rw] accelerators
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::Accelerator>]
  #     The accelerators attached to each VM instance.
  # @!attribute [rw] boot_disk
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::Disk]
  #     Boot disk to be created and attached to each VM by this InstancePolicy.
  #     Boot disk will be deleted when the VM is deleted.
  #     Batch API now only supports booting from image.
  # @!attribute [rw] disks
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::AttachedDisk>]
  #     Non-boot disks to be attached for each VM created by this InstancePolicy.
  #     New disks will be deleted when the VM is deleted.
  #     A non-boot disk is a disk that can be of a device with a
  #     file system or a raw storage drive that is not ready for data
  #     storage and accessing.
  # @!attribute [rw] reservation
  #   @return [::String]
  #     Optional. If specified, VMs will consume only the specified reservation.
  #     If not specified (default), VMs will consume any applicable reservation.
  class InstancePolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # InstancePolicyOrTemplate lets you define the type of resources to use for
  # this job either with an InstancePolicy or an instance template.
  # If undefined, Batch picks the type of VM to use and doesn't include
  # optional VM resources such as GPUs and extra disks.
  # @!attribute [rw] policy
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::InstancePolicy]
  #     InstancePolicy.
  # @!attribute [rw] instance_template
  #   @return [::String]
  #     Name of an instance template used to create VMs.
  #     Named the field as 'instance_template' instead of 'template' to avoid
  #     c++ keyword conflict.
  # @!attribute [rw] install_gpu_drivers
  #   @return [::Boolean]
  #     Set this field true if users want Batch to help fetch drivers from a
  #     third party location and install them for GPUs specified in
  #     policy.accelerators or instance_template on their behalf. Default is
  #     false.
  #
  #     For Container-Optimized Image cases, Batch will install the
  #     accelerator driver following milestones of
  #     https://cloud.google.com/container-optimized-os/docs/release-notes. For
  #     non Container-Optimized Image cases, following
  #     https://github.com/GoogleCloudPlatform/compute-gpu-installation/blob/main/linux/install_gpu_driver.py.
  class InstancePolicyOrTemplate
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A network interface.
  # @!attribute [rw] network
  #   @return [::String]
  #     The URL of an existing network resource.
  #     You can specify the network as a full or partial URL.
  #
  #     For example, the following are all valid URLs:
  #
  #     * https://www.googleapis.com/compute/v1/projects/\\{project}/global/networks/\\{network}
  #     * projects/\\{project}/global/networks/\\{network}
  #     * global/networks/\\{network}
  # @!attribute [rw] subnetwork
  #   @return [::String]
  #     The URL of an existing subnetwork resource in the network.
  #     You can specify the subnetwork as a full or partial URL.
  #
  #     For example, the following are all valid URLs:
  #
  #     * https://www.googleapis.com/compute/v1/projects/\\{project}/regions/\\{region}/subnetworks/\\{subnetwork}
  #     * projects/\\{project}/regions/\\{region}/subnetworks/\\{subnetwork}
  #     * regions/\\{region}/subnetworks/\\{subnetwork}
  # @!attribute [rw] no_external_ip_address
  #   @return [::Boolean]
  #     Default is false (with an external IP address). Required if
  #     no external public IP address is attached to the VM. If no external
  #     public IP address, additional configuration is required to allow the VM
  #     to access Google Services. See
  #     https://cloud.google.com/vpc/docs/configure-private-google-access and
  #     https://cloud.google.com/nat/docs/gce-example#create-nat for more
  #     information.
  class NetworkInterface
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # NetworkPolicy describes VM instance network configurations.
  # @!attribute [rw] network_interfaces
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::NetworkInterface>]
  #     Network configurations.
  class NetworkPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # PlacementPolicy describes a group placement policy for the VMs controlled
  # by this AllocationPolicy.
  # @!attribute [rw] collocation
  #   @return [::String]
  #     UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you
  #     want VMs to be located close to each other for low network latency
  #     between the VMs. No placement policy will be generated when collocation
  #     is UNSPECIFIED.
  # @!attribute [rw] max_distance
  #   @return [::Integer]
  #     When specified, causes the job to fail if more than max_distance logical
  #     switches are required between VMs. Batch uses the most compact possible
  #     placement of VMs even when max_distance is not specified. An explicit
  #     max_distance makes that level of compactness a strict requirement.
  #     Not yet implemented
  class PlacementPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class LabelsEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Compute Engine VM instance provisioning model.
  module ProvisioningModel
    # Unspecified.
    PROVISIONING_MODEL_UNSPECIFIED = 0

    # Standard VM.
    STANDARD = 1

    # SPOT VM.
    SPOT = 2

    # Preemptible VM (PVM).
    #
    # Above SPOT VM is the preferable model for preemptible VM instances: the
    # old preemptible VM model (indicated by this field) is the older model,
    # and has been migrated to use the SPOT model as the underlying technology.
    # This old model will still be supported.
    PREEMPTIBLE = 3
  end
end

#placement::Google::Cloud::Batch::V1::AllocationPolicy::PlacementPolicy

Returns The placement policy.



328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
# File 'proto_docs/google/cloud/batch/v1/job.rb', line 328

class AllocationPolicy
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # @!attribute [rw] allowed_locations
  #   @return [::Array<::String>]
  #     A list of allowed location names represented by internal URLs.
  #
  #     Each location can be a region or a zone.
  #     Only one region or multiple zones in one region is supported now.
  #     For example,
  #     ["regions/us-central1"] allow VMs in any zones in region us-central1.
  #     ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
  #     in zones us-central1-a and us-central1-c.
  #
  #     All locations end up in different regions would cause errors.
  #     For example,
  #     ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
  #     "zones/us-west1-a"] contains 2 regions "us-central1" and
  #     "us-west1". An error is expected in this case.
  class LocationPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A new persistent disk or a local ssd.
  # A VM can only have one local SSD setting but multiple local SSD partitions.
  # See https://cloud.google.com/compute/docs/disks#pdspecs and
  # https://cloud.google.com/compute/docs/disks#localssds.
  # @!attribute [rw] image
  #   @return [::String]
  #     URL for a VM image to use as the data source for this disk.
  #     For example, the following are all valid URLs:
  #
  #     * Specify the image by its family name:
  #     projects/\\{project}/global/images/family/\\{image_family}
  #     * Specify the image version:
  #     projects/\\{project}/global/images/\\{image_version}
  #
  #     You can also use Batch customized image in short names.
  #     The following image values are supported for a boot disk:
  #
  #     * `batch-debian`: use Batch Debian images.
  #     * `batch-centos`: use Batch CentOS images.
  #     * `batch-cos`: use Batch Container-Optimized images.
  #     * `batch-hpc-centos`: use Batch HPC CentOS images.
  #     * `batch-hpc-rocky`: use Batch HPC Rocky Linux images.
  # @!attribute [rw] snapshot
  #   @return [::String]
  #     Name of a snapshot used as the data source.
  #     Snapshot is not supported as boot disk now.
  # @!attribute [rw] type
  #   @return [::String]
  #     Disk type as shown in `gcloud compute disk-types list`.
  #     For example, local SSD uses type "local-ssd".
  #     Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd"
  #     or "pd-standard".
  # @!attribute [rw] size_gb
  #   @return [::Integer]
  #     Disk size in GB.
  #
  #     **Non-Boot Disk**:
  #     If the `type` specifies a persistent disk, this field
  #     is ignored if `data_source` is set as `image` or `snapshot`.
  #     If the `type` specifies a local SSD, this field should be a multiple of
  #     375 GB, otherwise, the final size will be the next greater multiple of
  #     375 GB.
  #
  #     **Boot Disk**:
  #     Batch will calculate the boot disk size based on source
  #     image and task requirements if you do not speicify the size.
  #     If both this field and the `boot_disk_mib` field in task spec's
  #     `compute_resource` are defined, Batch will only honor this field.
  #     Also, this field should be no smaller than the source disk's
  #     size when the `data_source` is set as `snapshot` or `image`.
  #     For example, if you set an image as the `data_source` field and the
  #     image's default disk size 30 GB, you can only use this field to make the
  #     disk larger or equal to 30 GB.
  # @!attribute [rw] disk_interface
  #   @return [::String]
  #     Local SSDs are available through both "SCSI" and "NVMe" interfaces.
  #     If not indicated, "NVMe" will be the default one for local ssds.
  #     This field is ignored for persistent disks as the interface is chosen
  #     automatically. See
  #     https://cloud.google.com/compute/docs/disks/persistent-disks#choose_an_interface.
  class Disk
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A new or an existing persistent disk (PD) or a local ssd attached to a VM
  # instance.
  # @!attribute [rw] new_disk
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::Disk]
  # @!attribute [rw] existing_disk
  #   @return [::String]
  #     Name of an existing PD.
  # @!attribute [rw] device_name
  #   @return [::String]
  #     Device name that the guest operating system will see.
  #     It is used by Runnable.volumes field to mount disks. So please specify
  #     the device_name if you want Batch to help mount the disk, and it should
  #     match the device_name field in volumes.
  class AttachedDisk
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Accelerator describes Compute Engine accelerators to be attached to the VM.
  # @!attribute [rw] type
  #   @return [::String]
  #     The accelerator type. For example, "nvidia-tesla-t4".
  #     See `gcloud compute accelerator-types list`.
  # @!attribute [rw] count
  #   @return [::Integer]
  #     The number of accelerators of this type.
  # @!attribute [rw] install_gpu_drivers
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Boolean]
  #     Deprecated: please use instances[0].install_gpu_drivers instead.
  # @!attribute [rw] driver_version
  #   @return [::String]
  #     Optional. The NVIDIA GPU driver version that should be installed for this
  #     type.
  #
  #     You can define the specific driver version such as "470.103.01",
  #     following the driver version requirements in
  #     https://cloud.google.com/compute/docs/gpus/install-drivers-gpu#minimum-driver.
  #     Batch will install the specific accelerator driver if qualified.
  class Accelerator
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # InstancePolicy describes an instance type and resources attached to each VM
  # created by this InstancePolicy.
  # @!attribute [rw] machine_type
  #   @return [::String]
  #     The Compute Engine machine type.
  # @!attribute [rw] min_cpu_platform
  #   @return [::String]
  #     The minimum CPU platform.
  #     See
  #     https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform.
  # @!attribute [rw] provisioning_model
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::ProvisioningModel]
  #     The provisioning model.
  # @!attribute [rw] accelerators
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::Accelerator>]
  #     The accelerators attached to each VM instance.
  # @!attribute [rw] boot_disk
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::Disk]
  #     Boot disk to be created and attached to each VM by this InstancePolicy.
  #     Boot disk will be deleted when the VM is deleted.
  #     Batch API now only supports booting from image.
  # @!attribute [rw] disks
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::AttachedDisk>]
  #     Non-boot disks to be attached for each VM created by this InstancePolicy.
  #     New disks will be deleted when the VM is deleted.
  #     A non-boot disk is a disk that can be of a device with a
  #     file system or a raw storage drive that is not ready for data
  #     storage and accessing.
  # @!attribute [rw] reservation
  #   @return [::String]
  #     Optional. If specified, VMs will consume only the specified reservation.
  #     If not specified (default), VMs will consume any applicable reservation.
  class InstancePolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # InstancePolicyOrTemplate lets you define the type of resources to use for
  # this job either with an InstancePolicy or an instance template.
  # If undefined, Batch picks the type of VM to use and doesn't include
  # optional VM resources such as GPUs and extra disks.
  # @!attribute [rw] policy
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::InstancePolicy]
  #     InstancePolicy.
  # @!attribute [rw] instance_template
  #   @return [::String]
  #     Name of an instance template used to create VMs.
  #     Named the field as 'instance_template' instead of 'template' to avoid
  #     c++ keyword conflict.
  # @!attribute [rw] install_gpu_drivers
  #   @return [::Boolean]
  #     Set this field true if users want Batch to help fetch drivers from a
  #     third party location and install them for GPUs specified in
  #     policy.accelerators or instance_template on their behalf. Default is
  #     false.
  #
  #     For Container-Optimized Image cases, Batch will install the
  #     accelerator driver following milestones of
  #     https://cloud.google.com/container-optimized-os/docs/release-notes. For
  #     non Container-Optimized Image cases, following
  #     https://github.com/GoogleCloudPlatform/compute-gpu-installation/blob/main/linux/install_gpu_driver.py.
  class InstancePolicyOrTemplate
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A network interface.
  # @!attribute [rw] network
  #   @return [::String]
  #     The URL of an existing network resource.
  #     You can specify the network as a full or partial URL.
  #
  #     For example, the following are all valid URLs:
  #
  #     * https://www.googleapis.com/compute/v1/projects/\\{project}/global/networks/\\{network}
  #     * projects/\\{project}/global/networks/\\{network}
  #     * global/networks/\\{network}
  # @!attribute [rw] subnetwork
  #   @return [::String]
  #     The URL of an existing subnetwork resource in the network.
  #     You can specify the subnetwork as a full or partial URL.
  #
  #     For example, the following are all valid URLs:
  #
  #     * https://www.googleapis.com/compute/v1/projects/\\{project}/regions/\\{region}/subnetworks/\\{subnetwork}
  #     * projects/\\{project}/regions/\\{region}/subnetworks/\\{subnetwork}
  #     * regions/\\{region}/subnetworks/\\{subnetwork}
  # @!attribute [rw] no_external_ip_address
  #   @return [::Boolean]
  #     Default is false (with an external IP address). Required if
  #     no external public IP address is attached to the VM. If no external
  #     public IP address, additional configuration is required to allow the VM
  #     to access Google Services. See
  #     https://cloud.google.com/vpc/docs/configure-private-google-access and
  #     https://cloud.google.com/nat/docs/gce-example#create-nat for more
  #     information.
  class NetworkInterface
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # NetworkPolicy describes VM instance network configurations.
  # @!attribute [rw] network_interfaces
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::NetworkInterface>]
  #     Network configurations.
  class NetworkPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # PlacementPolicy describes a group placement policy for the VMs controlled
  # by this AllocationPolicy.
  # @!attribute [rw] collocation
  #   @return [::String]
  #     UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you
  #     want VMs to be located close to each other for low network latency
  #     between the VMs. No placement policy will be generated when collocation
  #     is UNSPECIFIED.
  # @!attribute [rw] max_distance
  #   @return [::Integer]
  #     When specified, causes the job to fail if more than max_distance logical
  #     switches are required between VMs. Batch uses the most compact possible
  #     placement of VMs even when max_distance is not specified. An explicit
  #     max_distance makes that level of compactness a strict requirement.
  #     Not yet implemented
  class PlacementPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class LabelsEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Compute Engine VM instance provisioning model.
  module ProvisioningModel
    # Unspecified.
    PROVISIONING_MODEL_UNSPECIFIED = 0

    # Standard VM.
    STANDARD = 1

    # SPOT VM.
    SPOT = 2

    # Preemptible VM (PVM).
    #
    # Above SPOT VM is the preferable model for preemptible VM instances: the
    # old preemptible VM model (indicated by this field) is the older model,
    # and has been migrated to use the SPOT model as the underlying technology.
    # This old model will still be supported.
    PREEMPTIBLE = 3
  end
end

#service_account::Google::Cloud::Batch::V1::ServiceAccount

Returns Defines the service account for Batch-created VMs. If omitted, the default Compute Engine service account is used. Must match the service account specified in any used instance template configured in the Batch job.

Includes the following fields:

  • email: The service account's email address. If not set, the default Compute Engine service account is used.
  • scopes: Additional OAuth scopes to grant the service account, beyond the default cloud-platform scope. (list of strings).

Returns:

  • (::Google::Cloud::Batch::V1::ServiceAccount)

    Defines the service account for Batch-created VMs. If omitted, the default Compute Engine service account is used. Must match the service account specified in any used instance template configured in the Batch job.

    Includes the following fields:

    • email: The service account's email address. If not set, the default Compute Engine service account is used.
    • scopes: Additional OAuth scopes to grant the service account, beyond the default cloud-platform scope. (list of strings)


328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
# File 'proto_docs/google/cloud/batch/v1/job.rb', line 328

class AllocationPolicy
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # @!attribute [rw] allowed_locations
  #   @return [::Array<::String>]
  #     A list of allowed location names represented by internal URLs.
  #
  #     Each location can be a region or a zone.
  #     Only one region or multiple zones in one region is supported now.
  #     For example,
  #     ["regions/us-central1"] allow VMs in any zones in region us-central1.
  #     ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
  #     in zones us-central1-a and us-central1-c.
  #
  #     All locations end up in different regions would cause errors.
  #     For example,
  #     ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
  #     "zones/us-west1-a"] contains 2 regions "us-central1" and
  #     "us-west1". An error is expected in this case.
  class LocationPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A new persistent disk or a local ssd.
  # A VM can only have one local SSD setting but multiple local SSD partitions.
  # See https://cloud.google.com/compute/docs/disks#pdspecs and
  # https://cloud.google.com/compute/docs/disks#localssds.
  # @!attribute [rw] image
  #   @return [::String]
  #     URL for a VM image to use as the data source for this disk.
  #     For example, the following are all valid URLs:
  #
  #     * Specify the image by its family name:
  #     projects/\\{project}/global/images/family/\\{image_family}
  #     * Specify the image version:
  #     projects/\\{project}/global/images/\\{image_version}
  #
  #     You can also use Batch customized image in short names.
  #     The following image values are supported for a boot disk:
  #
  #     * `batch-debian`: use Batch Debian images.
  #     * `batch-centos`: use Batch CentOS images.
  #     * `batch-cos`: use Batch Container-Optimized images.
  #     * `batch-hpc-centos`: use Batch HPC CentOS images.
  #     * `batch-hpc-rocky`: use Batch HPC Rocky Linux images.
  # @!attribute [rw] snapshot
  #   @return [::String]
  #     Name of a snapshot used as the data source.
  #     Snapshot is not supported as boot disk now.
  # @!attribute [rw] type
  #   @return [::String]
  #     Disk type as shown in `gcloud compute disk-types list`.
  #     For example, local SSD uses type "local-ssd".
  #     Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd"
  #     or "pd-standard".
  # @!attribute [rw] size_gb
  #   @return [::Integer]
  #     Disk size in GB.
  #
  #     **Non-Boot Disk**:
  #     If the `type` specifies a persistent disk, this field
  #     is ignored if `data_source` is set as `image` or `snapshot`.
  #     If the `type` specifies a local SSD, this field should be a multiple of
  #     375 GB, otherwise, the final size will be the next greater multiple of
  #     375 GB.
  #
  #     **Boot Disk**:
  #     Batch will calculate the boot disk size based on source
  #     image and task requirements if you do not speicify the size.
  #     If both this field and the `boot_disk_mib` field in task spec's
  #     `compute_resource` are defined, Batch will only honor this field.
  #     Also, this field should be no smaller than the source disk's
  #     size when the `data_source` is set as `snapshot` or `image`.
  #     For example, if you set an image as the `data_source` field and the
  #     image's default disk size 30 GB, you can only use this field to make the
  #     disk larger or equal to 30 GB.
  # @!attribute [rw] disk_interface
  #   @return [::String]
  #     Local SSDs are available through both "SCSI" and "NVMe" interfaces.
  #     If not indicated, "NVMe" will be the default one for local ssds.
  #     This field is ignored for persistent disks as the interface is chosen
  #     automatically. See
  #     https://cloud.google.com/compute/docs/disks/persistent-disks#choose_an_interface.
  class Disk
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A new or an existing persistent disk (PD) or a local ssd attached to a VM
  # instance.
  # @!attribute [rw] new_disk
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::Disk]
  # @!attribute [rw] existing_disk
  #   @return [::String]
  #     Name of an existing PD.
  # @!attribute [rw] device_name
  #   @return [::String]
  #     Device name that the guest operating system will see.
  #     It is used by Runnable.volumes field to mount disks. So please specify
  #     the device_name if you want Batch to help mount the disk, and it should
  #     match the device_name field in volumes.
  class AttachedDisk
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Accelerator describes Compute Engine accelerators to be attached to the VM.
  # @!attribute [rw] type
  #   @return [::String]
  #     The accelerator type. For example, "nvidia-tesla-t4".
  #     See `gcloud compute accelerator-types list`.
  # @!attribute [rw] count
  #   @return [::Integer]
  #     The number of accelerators of this type.
  # @!attribute [rw] install_gpu_drivers
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Boolean]
  #     Deprecated: please use instances[0].install_gpu_drivers instead.
  # @!attribute [rw] driver_version
  #   @return [::String]
  #     Optional. The NVIDIA GPU driver version that should be installed for this
  #     type.
  #
  #     You can define the specific driver version such as "470.103.01",
  #     following the driver version requirements in
  #     https://cloud.google.com/compute/docs/gpus/install-drivers-gpu#minimum-driver.
  #     Batch will install the specific accelerator driver if qualified.
  class Accelerator
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # InstancePolicy describes an instance type and resources attached to each VM
  # created by this InstancePolicy.
  # @!attribute [rw] machine_type
  #   @return [::String]
  #     The Compute Engine machine type.
  # @!attribute [rw] min_cpu_platform
  #   @return [::String]
  #     The minimum CPU platform.
  #     See
  #     https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform.
  # @!attribute [rw] provisioning_model
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::ProvisioningModel]
  #     The provisioning model.
  # @!attribute [rw] accelerators
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::Accelerator>]
  #     The accelerators attached to each VM instance.
  # @!attribute [rw] boot_disk
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::Disk]
  #     Boot disk to be created and attached to each VM by this InstancePolicy.
  #     Boot disk will be deleted when the VM is deleted.
  #     Batch API now only supports booting from image.
  # @!attribute [rw] disks
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::AttachedDisk>]
  #     Non-boot disks to be attached for each VM created by this InstancePolicy.
  #     New disks will be deleted when the VM is deleted.
  #     A non-boot disk is a disk that can be of a device with a
  #     file system or a raw storage drive that is not ready for data
  #     storage and accessing.
  # @!attribute [rw] reservation
  #   @return [::String]
  #     Optional. If specified, VMs will consume only the specified reservation.
  #     If not specified (default), VMs will consume any applicable reservation.
  class InstancePolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # InstancePolicyOrTemplate lets you define the type of resources to use for
  # this job either with an InstancePolicy or an instance template.
  # If undefined, Batch picks the type of VM to use and doesn't include
  # optional VM resources such as GPUs and extra disks.
  # @!attribute [rw] policy
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::InstancePolicy]
  #     InstancePolicy.
  # @!attribute [rw] instance_template
  #   @return [::String]
  #     Name of an instance template used to create VMs.
  #     Named the field as 'instance_template' instead of 'template' to avoid
  #     c++ keyword conflict.
  # @!attribute [rw] install_gpu_drivers
  #   @return [::Boolean]
  #     Set this field true if users want Batch to help fetch drivers from a
  #     third party location and install them for GPUs specified in
  #     policy.accelerators or instance_template on their behalf. Default is
  #     false.
  #
  #     For Container-Optimized Image cases, Batch will install the
  #     accelerator driver following milestones of
  #     https://cloud.google.com/container-optimized-os/docs/release-notes. For
  #     non Container-Optimized Image cases, following
  #     https://github.com/GoogleCloudPlatform/compute-gpu-installation/blob/main/linux/install_gpu_driver.py.
  class InstancePolicyOrTemplate
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A network interface.
  # @!attribute [rw] network
  #   @return [::String]
  #     The URL of an existing network resource.
  #     You can specify the network as a full or partial URL.
  #
  #     For example, the following are all valid URLs:
  #
  #     * https://www.googleapis.com/compute/v1/projects/\\{project}/global/networks/\\{network}
  #     * projects/\\{project}/global/networks/\\{network}
  #     * global/networks/\\{network}
  # @!attribute [rw] subnetwork
  #   @return [::String]
  #     The URL of an existing subnetwork resource in the network.
  #     You can specify the subnetwork as a full or partial URL.
  #
  #     For example, the following are all valid URLs:
  #
  #     * https://www.googleapis.com/compute/v1/projects/\\{project}/regions/\\{region}/subnetworks/\\{subnetwork}
  #     * projects/\\{project}/regions/\\{region}/subnetworks/\\{subnetwork}
  #     * regions/\\{region}/subnetworks/\\{subnetwork}
  # @!attribute [rw] no_external_ip_address
  #   @return [::Boolean]
  #     Default is false (with an external IP address). Required if
  #     no external public IP address is attached to the VM. If no external
  #     public IP address, additional configuration is required to allow the VM
  #     to access Google Services. See
  #     https://cloud.google.com/vpc/docs/configure-private-google-access and
  #     https://cloud.google.com/nat/docs/gce-example#create-nat for more
  #     information.
  class NetworkInterface
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # NetworkPolicy describes VM instance network configurations.
  # @!attribute [rw] network_interfaces
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::NetworkInterface>]
  #     Network configurations.
  class NetworkPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # PlacementPolicy describes a group placement policy for the VMs controlled
  # by this AllocationPolicy.
  # @!attribute [rw] collocation
  #   @return [::String]
  #     UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you
  #     want VMs to be located close to each other for low network latency
  #     between the VMs. No placement policy will be generated when collocation
  #     is UNSPECIFIED.
  # @!attribute [rw] max_distance
  #   @return [::Integer]
  #     When specified, causes the job to fail if more than max_distance logical
  #     switches are required between VMs. Batch uses the most compact possible
  #     placement of VMs even when max_distance is not specified. An explicit
  #     max_distance makes that level of compactness a strict requirement.
  #     Not yet implemented
  class PlacementPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class LabelsEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Compute Engine VM instance provisioning model.
  module ProvisioningModel
    # Unspecified.
    PROVISIONING_MODEL_UNSPECIFIED = 0

    # Standard VM.
    STANDARD = 1

    # SPOT VM.
    SPOT = 2

    # Preemptible VM (PVM).
    #
    # Above SPOT VM is the preferable model for preemptible VM instances: the
    # old preemptible VM model (indicated by this field) is the older model,
    # and has been migrated to use the SPOT model as the underlying technology.
    # This old model will still be supported.
    PREEMPTIBLE = 3
  end
end

#tags::Array<::String>

Returns Optional. Tags applied to the VM instances.

The tags identify valid sources or targets for network firewalls. Each tag must be 1-63 characters long, and comply with RFC1035.

Returns:

  • (::Array<::String>)

    Optional. Tags applied to the VM instances.

    The tags identify valid sources or targets for network firewalls. Each tag must be 1-63 characters long, and comply with RFC1035.



328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
# File 'proto_docs/google/cloud/batch/v1/job.rb', line 328

class AllocationPolicy
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # @!attribute [rw] allowed_locations
  #   @return [::Array<::String>]
  #     A list of allowed location names represented by internal URLs.
  #
  #     Each location can be a region or a zone.
  #     Only one region or multiple zones in one region is supported now.
  #     For example,
  #     ["regions/us-central1"] allow VMs in any zones in region us-central1.
  #     ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
  #     in zones us-central1-a and us-central1-c.
  #
  #     All locations end up in different regions would cause errors.
  #     For example,
  #     ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
  #     "zones/us-west1-a"] contains 2 regions "us-central1" and
  #     "us-west1". An error is expected in this case.
  class LocationPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A new persistent disk or a local ssd.
  # A VM can only have one local SSD setting but multiple local SSD partitions.
  # See https://cloud.google.com/compute/docs/disks#pdspecs and
  # https://cloud.google.com/compute/docs/disks#localssds.
  # @!attribute [rw] image
  #   @return [::String]
  #     URL for a VM image to use as the data source for this disk.
  #     For example, the following are all valid URLs:
  #
  #     * Specify the image by its family name:
  #     projects/\\{project}/global/images/family/\\{image_family}
  #     * Specify the image version:
  #     projects/\\{project}/global/images/\\{image_version}
  #
  #     You can also use Batch customized image in short names.
  #     The following image values are supported for a boot disk:
  #
  #     * `batch-debian`: use Batch Debian images.
  #     * `batch-centos`: use Batch CentOS images.
  #     * `batch-cos`: use Batch Container-Optimized images.
  #     * `batch-hpc-centos`: use Batch HPC CentOS images.
  #     * `batch-hpc-rocky`: use Batch HPC Rocky Linux images.
  # @!attribute [rw] snapshot
  #   @return [::String]
  #     Name of a snapshot used as the data source.
  #     Snapshot is not supported as boot disk now.
  # @!attribute [rw] type
  #   @return [::String]
  #     Disk type as shown in `gcloud compute disk-types list`.
  #     For example, local SSD uses type "local-ssd".
  #     Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd"
  #     or "pd-standard".
  # @!attribute [rw] size_gb
  #   @return [::Integer]
  #     Disk size in GB.
  #
  #     **Non-Boot Disk**:
  #     If the `type` specifies a persistent disk, this field
  #     is ignored if `data_source` is set as `image` or `snapshot`.
  #     If the `type` specifies a local SSD, this field should be a multiple of
  #     375 GB, otherwise, the final size will be the next greater multiple of
  #     375 GB.
  #
  #     **Boot Disk**:
  #     Batch will calculate the boot disk size based on source
  #     image and task requirements if you do not speicify the size.
  #     If both this field and the `boot_disk_mib` field in task spec's
  #     `compute_resource` are defined, Batch will only honor this field.
  #     Also, this field should be no smaller than the source disk's
  #     size when the `data_source` is set as `snapshot` or `image`.
  #     For example, if you set an image as the `data_source` field and the
  #     image's default disk size 30 GB, you can only use this field to make the
  #     disk larger or equal to 30 GB.
  # @!attribute [rw] disk_interface
  #   @return [::String]
  #     Local SSDs are available through both "SCSI" and "NVMe" interfaces.
  #     If not indicated, "NVMe" will be the default one for local ssds.
  #     This field is ignored for persistent disks as the interface is chosen
  #     automatically. See
  #     https://cloud.google.com/compute/docs/disks/persistent-disks#choose_an_interface.
  class Disk
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A new or an existing persistent disk (PD) or a local ssd attached to a VM
  # instance.
  # @!attribute [rw] new_disk
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::Disk]
  # @!attribute [rw] existing_disk
  #   @return [::String]
  #     Name of an existing PD.
  # @!attribute [rw] device_name
  #   @return [::String]
  #     Device name that the guest operating system will see.
  #     It is used by Runnable.volumes field to mount disks. So please specify
  #     the device_name if you want Batch to help mount the disk, and it should
  #     match the device_name field in volumes.
  class AttachedDisk
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Accelerator describes Compute Engine accelerators to be attached to the VM.
  # @!attribute [rw] type
  #   @return [::String]
  #     The accelerator type. For example, "nvidia-tesla-t4".
  #     See `gcloud compute accelerator-types list`.
  # @!attribute [rw] count
  #   @return [::Integer]
  #     The number of accelerators of this type.
  # @!attribute [rw] install_gpu_drivers
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Boolean]
  #     Deprecated: please use instances[0].install_gpu_drivers instead.
  # @!attribute [rw] driver_version
  #   @return [::String]
  #     Optional. The NVIDIA GPU driver version that should be installed for this
  #     type.
  #
  #     You can define the specific driver version such as "470.103.01",
  #     following the driver version requirements in
  #     https://cloud.google.com/compute/docs/gpus/install-drivers-gpu#minimum-driver.
  #     Batch will install the specific accelerator driver if qualified.
  class Accelerator
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # InstancePolicy describes an instance type and resources attached to each VM
  # created by this InstancePolicy.
  # @!attribute [rw] machine_type
  #   @return [::String]
  #     The Compute Engine machine type.
  # @!attribute [rw] min_cpu_platform
  #   @return [::String]
  #     The minimum CPU platform.
  #     See
  #     https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform.
  # @!attribute [rw] provisioning_model
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::ProvisioningModel]
  #     The provisioning model.
  # @!attribute [rw] accelerators
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::Accelerator>]
  #     The accelerators attached to each VM instance.
  # @!attribute [rw] boot_disk
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::Disk]
  #     Boot disk to be created and attached to each VM by this InstancePolicy.
  #     Boot disk will be deleted when the VM is deleted.
  #     Batch API now only supports booting from image.
  # @!attribute [rw] disks
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::AttachedDisk>]
  #     Non-boot disks to be attached for each VM created by this InstancePolicy.
  #     New disks will be deleted when the VM is deleted.
  #     A non-boot disk is a disk that can be of a device with a
  #     file system or a raw storage drive that is not ready for data
  #     storage and accessing.
  # @!attribute [rw] reservation
  #   @return [::String]
  #     Optional. If specified, VMs will consume only the specified reservation.
  #     If not specified (default), VMs will consume any applicable reservation.
  class InstancePolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # InstancePolicyOrTemplate lets you define the type of resources to use for
  # this job either with an InstancePolicy or an instance template.
  # If undefined, Batch picks the type of VM to use and doesn't include
  # optional VM resources such as GPUs and extra disks.
  # @!attribute [rw] policy
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::InstancePolicy]
  #     InstancePolicy.
  # @!attribute [rw] instance_template
  #   @return [::String]
  #     Name of an instance template used to create VMs.
  #     Named the field as 'instance_template' instead of 'template' to avoid
  #     c++ keyword conflict.
  # @!attribute [rw] install_gpu_drivers
  #   @return [::Boolean]
  #     Set this field true if users want Batch to help fetch drivers from a
  #     third party location and install them for GPUs specified in
  #     policy.accelerators or instance_template on their behalf. Default is
  #     false.
  #
  #     For Container-Optimized Image cases, Batch will install the
  #     accelerator driver following milestones of
  #     https://cloud.google.com/container-optimized-os/docs/release-notes. For
  #     non Container-Optimized Image cases, following
  #     https://github.com/GoogleCloudPlatform/compute-gpu-installation/blob/main/linux/install_gpu_driver.py.
  class InstancePolicyOrTemplate
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A network interface.
  # @!attribute [rw] network
  #   @return [::String]
  #     The URL of an existing network resource.
  #     You can specify the network as a full or partial URL.
  #
  #     For example, the following are all valid URLs:
  #
  #     * https://www.googleapis.com/compute/v1/projects/\\{project}/global/networks/\\{network}
  #     * projects/\\{project}/global/networks/\\{network}
  #     * global/networks/\\{network}
  # @!attribute [rw] subnetwork
  #   @return [::String]
  #     The URL of an existing subnetwork resource in the network.
  #     You can specify the subnetwork as a full or partial URL.
  #
  #     For example, the following are all valid URLs:
  #
  #     * https://www.googleapis.com/compute/v1/projects/\\{project}/regions/\\{region}/subnetworks/\\{subnetwork}
  #     * projects/\\{project}/regions/\\{region}/subnetworks/\\{subnetwork}
  #     * regions/\\{region}/subnetworks/\\{subnetwork}
  # @!attribute [rw] no_external_ip_address
  #   @return [::Boolean]
  #     Default is false (with an external IP address). Required if
  #     no external public IP address is attached to the VM. If no external
  #     public IP address, additional configuration is required to allow the VM
  #     to access Google Services. See
  #     https://cloud.google.com/vpc/docs/configure-private-google-access and
  #     https://cloud.google.com/nat/docs/gce-example#create-nat for more
  #     information.
  class NetworkInterface
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # NetworkPolicy describes VM instance network configurations.
  # @!attribute [rw] network_interfaces
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::NetworkInterface>]
  #     Network configurations.
  class NetworkPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # PlacementPolicy describes a group placement policy for the VMs controlled
  # by this AllocationPolicy.
  # @!attribute [rw] collocation
  #   @return [::String]
  #     UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you
  #     want VMs to be located close to each other for low network latency
  #     between the VMs. No placement policy will be generated when collocation
  #     is UNSPECIFIED.
  # @!attribute [rw] max_distance
  #   @return [::Integer]
  #     When specified, causes the job to fail if more than max_distance logical
  #     switches are required between VMs. Batch uses the most compact possible
  #     placement of VMs even when max_distance is not specified. An explicit
  #     max_distance makes that level of compactness a strict requirement.
  #     Not yet implemented
  class PlacementPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class LabelsEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Compute Engine VM instance provisioning model.
  module ProvisioningModel
    # Unspecified.
    PROVISIONING_MODEL_UNSPECIFIED = 0

    # Standard VM.
    STANDARD = 1

    # SPOT VM.
    SPOT = 2

    # Preemptible VM (PVM).
    #
    # Above SPOT VM is the preferable model for preemptible VM instances: the
    # old preemptible VM model (indicated by this field) is the older model,
    # and has been migrated to use the SPOT model as the underlying technology.
    # This old model will still be supported.
    PREEMPTIBLE = 3
  end
end