Shared VPC network not visible?

1,255 views
Skip to first unread message

joseph...@providence.org

unread,
Jun 11, 2018, 9:27:26 PM6/11/18
to gce-discussion
I have a hosting project, "ProjectA" that is sharing a VPC with ProjectB, however using the gcloud command line I don't seem to be able to list the network (using " gcloud compute networks list") nor use it  (using "gcloud compute instances create --network default-vpc test").   Is there something that I'm missing?

Navi Aujla (Google Cloud Support)

unread,
Jun 12, 2018, 10:34:25 AM6/12/18
to gce-discussion
Hello 

You should be to list available subnets as Service Project Admin using the following commands:

gcloud auth login [SERVICE_PROJECT_ADMIN]
gcloud beta compute networks subnets list-usable --project [HOST_PROJECT_ID]

For more information, refer to this public documentation link and gcloud command reference.

To create an instance, can use the following command:
gcloud compute instances create [INSTANCE_NAME] \
--project [SERVICE_PROJECT_ID] \
--subnet projects/[HOST_PROJECT_ID]/regions/[REGION]/subnetworks/[SUBNET] \
--zone [ZONE]
More details are available here. In addition, if you have any feedback for improvement to this, feel free to submit a feature request using GCP public issue tracker.  

I hope it helps. 

joseph...@providence.org

unread,
Jun 12, 2018, 2:07:11 PM6/12/18
to gce-discussion
Thanks for the info.  However it seems a little backwards to have to use the service project to be able to list networks and create instances.  Isn't the point of having a shared VPC to be able to use the VPC within one's own project?  And along the same lines, ideally I'd like the the shared VPC to be project B's default network, which you don't seem to be able to do.

-Joe

Navi Aujla (Google Cloud Support)

unread,
Jun 13, 2018, 3:55:32 PM6/13/18
to gce-discussion
Hello Joe 

Can you please provide your use case, in order to better understand your question? 

Moreover, if you are looking for a feature which currently do not exist, feel free to submit a feature request using GCP public issue tracker. Google thrives on improving its products and that your feedback helps us do just that. 
Reply all
Reply to author
Forward
0 new messages