How to import a non bootable virtual disk in GCP?

0 votes
I have a non-bootable virtual disk. How do I import in GCP?
Oct 21 in GCP by anonymous
• 3,920 points
23 views

1 answer to this question.

0 votes

You can use the gcloud compute images import command to create a non-bootable Compute Engine image. 

If your virtual disk does not have a bootable operating system installed on it, you can still import it using the --data-disk flag in place of the --os flag. This skips over the step that installs drivers and guest environment packages to make the image bootable on Compute Engine.

gcloud compute images import [IMAGE_NAME] \
    --source-file [SOURCE_FILE] \
    --data-disk

where:

  • [IMAGE_NAME] is the name of your destination image.

  • [SOURCE_FILE] is a virtual disk file. It can be a local file or a file stored in Cloud Storage. If your virtual disk is a local file, you can use an absolute or relative path. If your virtual disk file is already stored in Cloud Storage, the file must exist in a storage bucket in the project that is used for the import process, and you must specify the full path of the file in the gs://[BUCKET_NAME]/[OBJECT_NAME] format.

Sample command

The following example imports a virtual disk named your_disk.vmdk stored in gs://your_gcs_bucket.

gcloud compute images import my-imported-image \
    --source-file gs://your_gcs_bucket/your_disk.vmdk \
    --data-disk
answered Oct 21 by Sirajul
• 37,930 points

Related Questions In GCP

0 votes
1 answer
0 votes
1 answer

How do I import a OVA file in GCP?

Add the virtual appliance to Cloud Storage. To import ...READ MORE

answered Oct 21 in GCP by Sirajul
• 37,930 points
39 views
0 votes
1 answer

How to create a cloud storage bucket in GCP?

Buckets are the basic containers that hold your ...READ MORE

answered Oct 23 in GCP by Sirajul
• 37,930 points
18 views
0 votes
1 answer

Creating a SQL Server instance using Google Compute engine.

Google Compute Engine provides public images preconfigured with ...READ MORE

answered Sep 23 in GCP by Sirajul
• 37,930 points
36 views
0 votes
1 answer

How do i install gcloud compute?

The gcloud compute command-line tool enables you to easily ...READ MORE

answered Sep 23 in GCP by Sirajul
• 37,930 points
44 views
0 votes
1 answer

How to allow outbound traffic on a custom port in gcp?

To allow outbound traffic through a custom ...READ MORE

answered Sep 26 in GCP by Sirajul
• 37,930 points
32 views