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 22, 2019 in GCP by anonymous
• 6,260 points
1,101 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 22, 2019 by Sirajul
• 59,230 points

Related Questions In GCP

0 votes
1 answer

How to add a regional persistent disk to a VM instance on GCP?

You must first create the regional persistent ...READ MORE

answered Oct 18, 2019 in GCP by Sirajul
• 59,230 points
2,727 views
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, 2019 in GCP by Sirajul
• 59,230 points
6,726 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 24, 2019 in GCP by Sirajul
• 59,230 points
2,664 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, 2019 in GCP by Sirajul
• 59,230 points
2,896 views
0 votes
1 answer
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, 2019 in GCP by Sirajul
• 59,230 points

edited Jun 16, 2023 by Khan Sarfaraz 1,244 views
0 votes
1 answer
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, 2019 in GCP by Sirajul
• 59,230 points
4,996 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP