SimonInNYC
SimonInNYC

Reputation: 410

Share google cloud snapshot to another user

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

Answers (3)

Michael Yuniverg
Michael Yuniverg

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

Alexey Alexandrov
Alexey Alexandrov

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

Ramesh Dharan
Ramesh Dharan

Reputation: 895

There are multiple ways to achieve what you want.

  1. 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.

  2. 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

Related Questions