Import virtual disk to Google Cloud with Custom network

726 views Asked by At

When I try to import a vmdk file to GCP with gcloud compute images import command, I get

"googleapi: Error 400: Invalid value for field 'resource.networkInterfaces[0]': ''.

Subnetwork should be specified for custom subnetmode network".

The subnet mode in default network is set to "CUSTOM". that's why I am getting that msg.

Is there a way to specify network when I import the image? or specify the subnet information?

1

There are 1 answers

0
Sleem On

Suggestion:

This workaround worked for me, you can do it while this issue is still not solved:

  • create a temp project, a default auto network will be created automatically.
  • import the vmdk to the temp project
  • In your original project, create instance using the imported image.
  • Delete temp project

Note: Deleting the temp project will delete the imported image, but not the created instance.