Thomas Ruble
Thomas Ruble

Reputation: 952

Can I create a Google Compute Instance from an Instance Template in another project?

Title says it all:

Can I create a Google Compute Engine instance in one project, based off of an Instance Template living in another project?

Upvotes: 4

Views: 1547

Answers (1)

Jose Luis Delgadillo
Jose Luis Delgadillo

Reputation: 2468

As far as I know, there isn’t a direct way to create a Google Compute Engine Instance in one project, based off of an Instance Template living in another project.

Instance templates define the machine type, boot disk image or container image, labels, and other properties based on the project where the template was created, for example the service-account or the network.

Having said that, I tried to reproduce the scenario in my own projects and I have found a way to create a new instance in a project (project-2) using an Instance Template “extracted” from a different project (project-1):

I created an Instance template in the project-1 following the next steps

  1. Go to the Instance templates page in my project-1.
  2. Click on the instance template that you want to copy.
  3. Click Create similar.
  4. Go to the command line link at the end of the page and copy in an editor the parameters provided.
  5. I’ve edited some parameters like the project, network, service-account, so on.
  6. Open a Cloud Shell on project-2 and paste the parameters already edited.
  7. As a result I have a new Instance Template with the same parameters (machine type, boot disk image or container image, labels, etc.) in the project-2 .
  8. With this new template I was able to create a new Instance in project-2.

On the other hand, I recommend you to review the following guides on asking questions: How do I ask a good question? and How to create a Minimal, Complete, and Verifiable example in order to provide a better context on what you are doing and what do you want to achieve.

Upvotes: 5

Related Questions