Can not create gcp instance from machine image in a different project

0 votes

I have two GCP projects, projectA and projectB. In projectB, I have a machine image B-machine-image. My goal was to make a copy of the machine image in projectA. But since there is no way to copy the machine image from projectB to projectA directly, I thought I can create a instance in projectA using the machine image in projectB, then use the new instance in projectA to create a machine image locally.

I found a Google Doc for this: https://cloud.google.com/compute/docs/machine-images/create-instance-from-machine-image and followed the steps to first grant the service account in projectA admin role to the machine image B-machine-image in projectB, then run the command to make the instance like:

gcloud beta compute instances create my-new-instance --project=projectA --zone us-central1-b --source-machine-image projects/projectB/global/machineImages/B-machine-image --service-account 123456789000-compute@developer.gserviceaccount.com

and I am getting the error:

ERROR: (gcloud.beta.compute.instances.create) Could not fetch resource:

  • Invalid value for field 'resource.networkInterfaces[0].network': 'projects/123456789000/global/networks/projectB-vpc'. The referenced network resource cannot be found.

In projectB, I do have a VPC called projectB-vpc.

What I do not understand is that in "projects/123456789000/global/networks/projectB-vpc", 123456789000 seems is for projectA as it is part of the email for projectA service account, while projectB-vpc is for projectB. In my command I have "projects/projectB/....", why the command replaced "projectB" with 123456789000?

Any idea where did I do wrong?

Apr 7 in Cloud Computing by Rahul
• 2,540 points
12 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Cloud Computing

0 votes
1 answer

Is there a way to use amazon ECR image from one account in the code build of another account?

These forums might just about help https://forums.aws.amazon.com/ ...READ MORE

answered May 7, 2018 in Cloud Computing by brat_1
• 7,200 points
1,074 views
+2 votes
2 answers

Can I run 'manage.py' from AWS EB Linux instance

You can refer to this documentation :- https://docs.aws.amazon.com/el ...READ MORE

answered Aug 17, 2018 in Cloud Computing by Priyaj
• 58,060 points
857 views
0 votes
1 answer

Can we hit a web page regularly in AWS & get a notifications if it fails or goes down

Yes, it is possible to do so. ...READ MORE

answered May 9, 2018 in Cloud Computing by Meci Matt
• 9,460 points

reshown Aug 15, 2018 by Vardhan 218 views
0 votes
1 answer

AWS: Is there a way I can edit files in S3 right away in the browser?

There is not currently an AWS-supported method ...READ MORE

answered Jun 19, 2018 in Cloud Computing by Meci Matt
• 9,460 points
3,325 views
0 votes
1 answer
0 votes
1 answer

What are the different ways to send a request to Simple Storage Service in AWS?

There  are two ways: Using REST API Using AWS ...READ MORE

answered Jul 23, 2018 in Cloud Computing by brat_1
• 7,200 points
215 views
+1 vote
1 answer

AWS: Can some one tell me what is a golden image?

Golden Images Certain AWS resource types like Amazon ...READ MORE

answered Jul 27, 2018 in Cloud Computing by DragonLord999
• 8,450 points
3,412 views
+2 votes
2 answers

Hi, can someone help me in my research. I need a research topic for Visualization in Cloud Computing.

Find the different projects for your research ...READ MORE

answered Oct 17, 2018 in Cloud Computing by Nabarupa
534 views
0 votes
1 answer
+1 vote
1 answer

How To Migrate a CodeStar Project into a different Account

Hello @ cloudkatha , You can initiate deployments that belong ...READ MORE

answered Aug 6, 2020 in Cloud Computing by Niroj
• 82,680 points
225 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP