I believe a partial should be longer, probably like:
zones/us-east1-c/acceleratorTypes/nvidia-tesla-k80

See examples under sourceInstanceTemplate on
https://cloud.google.com/compute/docs/reference/rest/v1/instances/insert


On Thu, Nov 8, 2018 at 5:09 PM <[email protected]> wrote:

> 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
>> <https://www.packer.io/docs/builders/googlecompute.html#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.
>
> {
>   "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": "
> https://www.googleapis.com/compute/v1/projects/project-78689/zones/us-east1-c/acceleratorTypes/nvidia-tesla-k80
> ",
>     "accelerator_count": 1
>   }],
> }
>
>
> 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
>
> --
> This mailing list is governed under the HashiCorp Community Guidelines -
> https://www.hashicorp.com/community-guidelines.html. Behavior in
> violation of those guidelines may result in your removal from this mailing
> list.
>
> GitHub Issues: https://github.com/mitchellh/packer/issues
> IRC: #packer-tool on Freenode
> ---
> You received this message because you are subscribed to the Google Groups
> "Packer" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/73c84e9d-130b-40a9-8388-ebbd2802ac79%40googlegroups.com
> <https://groups.google.com/d/msgid/packer-tool/73c84e9d-130b-40a9-8388-ebbd2802ac79%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt9vvMmJi_S7QonPzHr3ykN%3D8S1DFMoJdsW4%3DefemePEtw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to