To import an OVF file to GCP, follow these steps:
-
Add the virtual appliance to Cloud Storage.
-
To import an OVF file from Cloud Storage to Compute Engine, use the gcloud compute instances import command.
If your directory contains only one OVF file, you can either provide the path to the descriptor file or the path to the directory that contains the OVF file.
-
To import an OVF file using the path to the descriptor file, run the following command:
gcloud compute instances import [INSTANCE_NAME] \
--source-uri=gs:[PATH_TO_OVF_FILE]
-
To import an OVF file using the directory path, run the following command:
gcloud compute instances import [INSTANCE_NAME] \
--source-uri=gs:[PATH_TO_OVF_DIRECTORY]
where:
-
[INSTANCE_NAME] is the name of the instance you want to create.
-
[PATH_TO_OVF_FILE] is the path to the OVF file on Cloud Storage.
-
[PATH_TO_OVF_DIRECTORY] is the path to the directory that contains the OVF file on Cloud Storage.
For example, to import an OVF file Ubuntu.ovf in the my-bucket directory, that creates an instance named my-instance, run the following command:
gcloud compute instances import my-instance \
--source-uri=gs://my-bucket/
In some cases, you might be prompted to provide a value for the OS. To specify the operating system, you need to add the --os flag. For example, to import an OVF file Ubuntu.ovf and create an instance named my-instance that runs Ubuntu 16.04, run the following command:
gcloud compute instances import my-instance \
--os=ubuntu-1604 \
--source-uri=gs://my-bucket/