mitchellh/vagrant-google

Support for creating GPU instances

hannes-brt opened this issue · 2 comments

I was hoping I could use vagrant-google to set up a GPU-backed box on GCP. However, it seems that the necessary API option --accelerator-type is currently not supported.

gcloud beta compute instances create [INSTANCE_NAME] \
    --machine-type [MACHINE_TYPE] --zone [ZONE] \
    --accelerator type=[ACCELERATOR_TYPE],count=[ACCELERATOR_COUNT] \
    --image-family [IMAGE_FAMILY] --image-project [IMAGE_PROJECT] \
    --maintenance-policy TERMINATE --restart-on-failure \
    --metadata startup-script='[STARTUP_SCRIPT]'

More info: https://cloud.google.com/compute/docs/gpus/add-gpus#create-new-gpu-instance

Accelerators are now supported in fog, this should be relatively easy to implement

This is the mapping in fog-google:

        attribute :guest_accelerators, :aliases => "guestAccelerators"

Don't have much time nowadays but I'll try to get to it next time I'm implementing changes.
I'm more than happy to review a pull request and/or help with building it out if anyone's interested.