The migration to google cloud was postponed but it is back. So I still have this issue. The problem isn't with creating vpc's. The network team in my company have created a network project and created various subnets and shared them. So we do have vpcs that are shared and we have managed to create an instance with the gcloud command using --subnet flag with a long directory like name that ends in the shared subnet.
My problem is that I'm trying to use chef & knife to create servers. So the command I'm using is
'knife google server create ${server} --gce-image-project ${SharedImages} --gce-image ${imageName} --gce-machine-type ${machineType} --gce-subnet ${same path used for gcloud} ...various ssh options'
The error I get is 'ERROR: RuntimeError: Invalid network: default'
the command,
gcloud compute networks list
doesn't give any networks.
going into the web interface to create a vm, selecting the more advanced options from the link 'Management, security, disks, networking, sole tenancy', then selecting networking. This shows under network interfaces "click-here-and-select-shared-subnet-region-specific', clicking on this with the button Networks in this Project shows no networks.
Selecting 'Networks shared with me (from host project: "network team"), gives me some subnets I can use. These are the subnets I'm able to use with the gcloud command.
So coming back to my original issue, using the knife google command I have two options --gce-network and --gce-subnet. Is there some way to specify a shared resource for network? It seems like anything I've tried putting in the gce-network option returns an error similar to the default error I described above.