Hello,
This might be a bug, but I thought I'd post here before putting it on GitHub, just in case I'm doing something wrong.
According the docs, the accelerator_type just needs to include part of the type URL:
accelerator_type (string) - Full or partial URL of the guest accelerator type. GPU accelerators can only be used with"on_host_maintenance": "TERMINATE" option set. Example: "projects/project_id/zones/europe-west1-b/acceleratorTypes/nvidia-tesla-k80"
Below is my packer.json file. This one fails with the error below.
{
"builders": [{
"type": "googlecompute",
"project_id": "project-78689",
"zone": "us-east1-c",
"source_image_family": "ubuntu-1804-lts",
"ssh_username": "packer",
"image_name": "wowza-gpu-{{timestamp}}",
"on_host_maintenance": "TERMINATE",
"accelerator_type": "nvidia-tesla-k80",
"accelerator_count": 1
}],
}
==> googlecompute: Error creating instance: googleapi: Error 400: Invalid value for field 'resource.guestAccelerators[0].acceleratorType': 'nvidia-tesla-k80'. The URL is malformed., invalid
Build 'googlecompute' errored: Error creating instance: googleapi: Error 400: Invalid value for field 'resource.guestAccelerators[0].acceleratorType': 'nvidia-tesla-k80'. The URL is malformed., invalid
If I modify the packer.json file to include the full URL for the GPU, it builds properly.
Am I missing something, or is this a bug I should report on GitHub? I've tried multiple regions and zones, all of which include the GPU I'm trying to use and all fail with the same error.
Kerry