Thanks for your message. I experienced the same error "Invalid value for field 'guestAccelerators[0].acceleratorCount': '0'. Number of accelerator cards attached to an instance must be one of [1, 2, 4, 8]." when I used "0" count for the field "accelratorCount". Currently, It does not seem possible to remove GPU from an existing instance using 'gcloud' or using API.
I would ask you to file a feature request at public issue tracker <https://issuetracker.google.com> [1] to add the feature of removing GPU from an existing instance using API. [1] https://issuetracker.google.com On Thursday, August 31, 2017 at 3:21:26 AM UTC-4, Insharp Lotus wrote: > > Thanks Navi. > > I wrote a script to attach GPU with your API reference and it works for > attaching a GPU, thanks. > > Do you know any way to detach the GPU from a API request. Surfed the > documentation but could not find anything. I tried adding 0 to > "acceleratorCount" parameter but it says > > "Invalid value for field 'guestAccelerators[0].acceleratorCount': '0'. > Number of accelerator cards attached to an instance must be one of [1, 2, > 4, 8]." > > On Wednesday, 30 August 2017 22:15:11 UTC+5:30, Navi Aujla (Google Cloud > Support) wrote: >> >> Hello, >> >> Currently, it is not possible to attach GPU to an existing instance using >> "gcloud" command. You can attach GPU using cloud console, "EDIT" option of >> the instance when it is in the stop state. Another way to attach GPU to an >> existing instance (stopped) is through API >> <https://developers.google.com/apis-explorer/#search/compute%20engine/compute/v1/compute.instances.setMachineResources> >> [1][2]. >> >> Following is the URL which needs to be defined for >> property guestAccelerators[].acceleratorType: >> >> https://www.googleapis.com/compute/beta/projects/ >> <project-id>/zones/<zone-where-instance-is-deployed>/acceleratorTypes/nvidia-tesla-k80 >> >> Example: >> https://www.googleapis.com/compute/beta/projects/test-project/zones/us-west1-b/acceleratorTypes/nvidia-tesla-k80 >> >> You can submit a feature request at public issue tracker >> <https://issuetracker.google.com> [3] to add a parameter for "gcloud" to >> attach GPU to an existing instance. >> >> [1] >> https://developers.google.com/apis-explorer/#search/compute%20engine/compute/v1/compute.instances.setMachineResources >> [2] >> https://cloud.google.com/compute/docs/reference/beta/instances/setMachineResources >> [3] https://issuetracker.google.com >> >> >> On Wednesday, August 30, 2017 at 1:52:23 AM UTC-4, Insharp Lotus wrote: >>> >>> >>> I have a instance that I can upgrade and downgrade machine type from >>> gcloud command. For example I can do >>> >>> gcloud compute instances set-machine-type instance-name --machine-type >>> f1-micro >>> >>> to downgrade a existing instance and >>> >>> gcloud compute instances set-machine-type ubuntu --machine-type n1- >>> standard-1 >>> >>> to upgrade the machine type. But I need to also attach an GPU when when >>> I upgrade. I can do that on web interface but I need to do this on command >>> line. How can I do that? >>> >>> Thanks. >>> >> -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/google-appengine. To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/cbdf0849-7223-4202-be9f-d9191632d445%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
