Create a VM from an image stored in Google Cloud Platform
Currently, you can't use the console to create a VM from an imported image. Select the Command Line tab to use the Google Cloud command-line interface to create a virtual machine.
- Run this command to set a compute zone:
gcloud config set compute/zone <zone>
- Run this command to create a Compute Engine image:
gcloud compute images create <image-name> --source-uri <filepath>
- <image-name> is the name of the image.
- <filepath> is the complete path to the image tar.gz file.
In this example, replace <image-name> with my-image-name, and <filepath> with gs://my-bucket-name/my-tar-file-name.tar.gz:
gcloud compute images create my-image-name --source-uri gs://my-bucket-name/my-tar-file-name.tar.gz
Create an instance of the VM
Perform the following steps to create and launch an instance of the VM:
-
Click Compute Engine.
-
Click Images.
-
Click Create Instance. and give a name.
-
Enter a name for the instance.
-
Specify the region and the zone.
-
Choose the default machine configuration. Select one or both of Allow HTTP traffic and Allow HTTPS traffic under Firewall.
See Creating and starting a VM instance for more details on using VMs in Google Cloud.