Based on this option
https://cloud.google.com/compute/docs/instances/create-vm-from-similar-instance
Is there a way to clone or copy a VM using API?
I need to assign multiple users a VM similar than the one I work it, and we are trying to do this from firebase app with the google API. But can't find the API or console option for this.
Thanks.
Solved! Go to Solution.
All the commands that can be executed by the gcloud command line tool can also be executed by API. This means that if we can find a recipe using gcloud, we can do the same thing using API. It looks like we can use
to create a snapshot of a VM disk. Once we have a snapshot, we can create a new VM disk using that as a base image using:
gcloud compute disks create --souce-snapshot
when you create your new VM, you can then use this newly created disk as the attached disk to your VM and we should have achieved the goal.
I think the trick to this puzzle will be to ask "What does it mean to create a VM similar to the one I have". From what I glean reading the page, it seems that the new VM will basically be one that is created with similar/identical configuration to the one you already have. Since there are APIs and command line tools that can retrieve the configuration of one VM and create a new VM with arbitrary configurations, it would appear that the solution would be use two APIs. One to query a VMs current settings and a second API to create a new VM with specific settings.
Not just the configuration, but what the user have done in it. Every software installed and SO changes. We want to clone the VM and give it to someone else.
All the commands that can be executed by the gcloud command line tool can also be executed by API. This means that if we can find a recipe using gcloud, we can do the same thing using API. It looks like we can use
to create a snapshot of a VM disk. Once we have a snapshot, we can create a new VM disk using that as a base image using:
gcloud compute disks create --souce-snapshot
when you create your new VM, you can then use this newly created disk as the attached disk to your VM and we should have achieved the goal.