Reputation: 410
Hi I am curious is there a way to share my google cloud snapshot with another person, so that he can easily set up everything?
Upvotes: 7
Views: 4561
Reputation: 107
I wanted merely add a comment to Alexey's answer, but my reputation is still below 50 :)
So to save you time - the exact command to create an instance from the source image is:
gcloud compute instances create _new-instance-name --image-project _name-of-source-project --image _name_of_source_image
Upvotes: 2
Reputation: 3129
Assuming by sharing you mean "another user be able to create a VM which is a copy of mine but in their project". You could create a VM image rather than a snapshot, add the user as a READER on your project, then have them use gcloud compute instance create
with --image-project
and --image
pointing to your VM image.
Upvotes: 6
Reputation: 895
There are multiple ways to achieve what you want.
If you want the second person to have their own instance which is a duplicate of yours, then what you probably want to do is to take a snapshot of the root persistent disk, and create a new instance from that snapshot. You can find more details on how to do that here:
https://cloud.google.com/compute/docs/disks/create-root-persistent-disks
Note that in this case you probably want to add the second person's Google account to your project so that they can interact with the instance you create for them.
Alternatively, you could create an account for the other person on your instance, then configure SSH to allow them to log in. You can find more details on how to set up SSH for Linux instances in Google Cloud here:
https://cloud.google.com/compute/docs/instances/connecting-to-instance
Upvotes: 1