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 google-appengine+unsubscr...@googlegroups.com. To post to this group, send email to google-appengine@googlegroups.com. 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/9b0ba1f1-858b-4163-8a29-995dd1b2a48b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.