Unable to create a Batch job using custom template with hyperdisk

Hello,

I’m trying to create a Batch job using a custom instance template so that I can specify a Hyperdisk with tuned IOPS.

The problem is as soon as I specify Hyperdisk as a boot disk or attach Hyperdisk as an additional disk, the job fails immediately with the following message in the Events tab:

Job state is set from QUEUED to FAILED

1 Like

Hi @kirgene ,

Thanks for your report! Batch is now working on the latest Hyperdisk support. I’ll let you know once Batch is ready.

Thanks for your patience!

Best,

Wenyan

2 Likes

Hi @kirgene ,

May I know the hyperdisk type you used? There are some limitations on hyperdisk usage like “Hyperdisk Extreme and Hyperdisk Throughput volumes can’t be used as boot disks.”

https://cloud.google.com/compute/docs/disks/hyperdisks#limitations

We are working on support hyperdisk directly while using instance template and skipping quota check (plz refer to the label fields below) could be a work around.
I tried an instance template with hyperdisk balanced as an attached disk and it worked:

{
  "creationTimestamp": "xxx",
  "description": "",
  "id": "xxx",
  "kind": "compute#instanceTemplate",
  "name": "xx",
  "properties": {
    "confidentialInstanceConfig": {
      "enableConfidentialCompute": false
    },
    "description": "",
    "scheduling": {
      "onHostMaintenance": "MIGRATE",
      "provisioningModel": "STANDARD",
      "automaticRestart": true,
      "preemptible": false
    },
    "tags": {},
    "disks": [
      {
        "type": "PERSISTENT",
        "deviceName": "xx",
        "autoDelete": true,
        "index": 0,
        "boot": true,
        "kind": "compute#attachedDisk",
        "mode": "READ_WRITE",
        "initializeParams": {
          "sourceImage": "projects/debian-cloud/global/images/debian-12-bookworm-v20240617",
          "provisionedIops": "3060",
          "provisionedThroughput": "155",
          "diskType": "hyperdisk-balanced",
          "diskSizeGb": "10"
        }
      },
      {
        "type": "PERSISTENT",
        "deviceName": "persistent-disk-1",
        "autoDelete": false,
        "index": 1,
        "kind": "compute#attachedDisk",
        "mode": "READ_WRITE",
        "initializeParams": {
          "description": "",
          "provisionedIops": "3600",
          "provisionedThroughput": "290",
          "diskType": "hyperdisk-balanced",
          "diskSizeGb": "100"
        }
      }
    ],
    "networkInterfaces": [
      {
        "stackType": "IPV4_ONLY",
        "name": "nic0",
        "nicType": "GVNIC",
        "network": "projects/xxx/global/networks/default",
        "accessConfigs": [
          {
            "name": "External NAT",
            "type": "ONE_TO_ONE_NAT",
            "kind": "compute#accessConfig",
            "networkTier": "PREMIUM"
          }
        ],
        "kind": "compute#networkInterface"
      }
    ],
    "reservationAffinity": {
      "consumeReservationType": "ANY_RESERVATION"
    },
    "canIpForward": false,
    "keyRevocationActionType": "NONE",
    "machineType": "n4-standard-2",
    "metadata": {
      "fingerprint": "xx",
      "kind": "compute#metadata"
    },
    "shieldedVmConfig": {
      "enableSecureBoot": false,
      "enableVtpm": true,
      "enableIntegrityMonitoring": true
    },
    "shieldedInstanceConfig": {
      "enableSecureBoot": false,
      "enableVtpm": true,
      "enableIntegrityMonitoring": true
    },
    "serviceAccounts": [
      {
        "email": "xxx-compute@developer.gserviceaccount.com",
        "scopes": [
          "https://www.googleapis.com/auth/devstorage.read_only",
          "https://www.googleapis.com/auth/logging.write",
          "https://www.googleapis.com/auth/monitoring.write",
          "https://www.googleapis.com/auth/servicecontrol",
          "https://www.googleapis.com/auth/service.management.readonly",
          "https://www.googleapis.com/auth/trace.append"
        ]
      }
    ],
    "displayDevice": {
      "enableDisplay": false
    }
  },
  "selfLink": "xxx"
}

job:

{
  "task_groups":[
    {
      "task_spec":{
        "runnables": [
          {
            "script": {
              "text": "echo hello ${BATCH_TASK_INDEX}; touch /mnt/disks/share/${BATCH_TASK_INDEX}-file; ls /mnt/disks/share"
            }
          }
        ],
<strong>        "volumes": [
          {</strong>
             <strong>"device_name": "persistent-disk-1", // By default for hyperdisk-balanced, plz replace it as needed
             "mount_path": "/mnt/disks/share" // Replace with your mount path
          }
</strong>        ]
      },
      "task_count":2,
      "parallelism":3
    }
  ],
  "allocation_policy": {
    "instances": [
<strong>      {
        "instance_template": "xx"
      }</strong>
    ],
    "location": {
      "allowed_locations": [
        "regions/us-central1",
        "zones/us-central1-a"
      ]
    }
  },
  "logsPolicy": {
    "destination": "CLOUD_LOGGING"
  },
 **"labels": {**
 **"goog-batch-skip-quota-check": "true"**
 **}**
}

If we can have the job uid and region for a further look, that would be great.

Thanks,
Wen

2 Likes