0

I have a vmdk file for a windows server boot disk that I received from our partners. I have loaded it up in a google GCS bucket with intention of creating a GCP disk "image" and thereafter using that "image" to create a boot disk for new GCP compute engine instance

When I try to "import" the VMDK to create the "image" it fails after a very long time - ( 1 hour 59 minutes)

I do the import from GCP console ; The equivalent gcloud command is

gcloud compute images import my-bootable-disk --source-file=gs://partner-image-stage/MyImageOfBootDisk.vmdk --guest-environment

note that I have not specified the "--os=windows-XXX " option as I am not sure which specific windows version is on the disk. Instead I used "Detect Operating system " option

The log of import run in gcp looks as follows

[translate.import]: 2022-02-03T16:48:39Z Running step "wait-for-translate (WaitForInstancesSignal)
[translate.import.wait-for-translate]: 2022-02-03T16:48:39Z WaitForInstancesSignal: Waiting for instance "inst-translate-translate-import-6xjvv" to stop.
[translate.import.wait-for-translate]: 2022-02-03T16:48:39Z WaitForInstancesSignal: Instance "inst-translate-translate-import-6xjvv": watching serial port 1, SuccessMatch: "Translate complete", FailureMatch: ["TranslateFailed:" "Failed to download GCS path"] (this is not an error), StatusMatch: "Translate:".
[translate.import]: 2022-02-03T18:34:46Z Step "wait-for-translate" (WaitForInstancesSignal) timed-out.
[translate]: 2022-02-03T18:34:46Z Error running workflow: step "import" run error: Step "wait for-translate" (WaitForInstancesSignal) timed-out.
[translate]: 2022-02-03T18:34:46Z Workflow "translate" cleaning up (this may take up to 2 minutes).
[translate]: 2022-02-03T18:37:04Z Workflow "translate" finished cleanup.
[import-image]: 2022-02-03T18:37:05Z Import did not complete within the specified timeout of 1h56m24s
ERROR
ERROR: build step 0 "gcr.io/compute-image-tools/gce_vm_image_import:release" failed: step 

Another interesting point to note is that when I import the same image without specifying it as a "bootable image" but rather caling it a "data disk" then the import succeeds ! The equivalent gcloud command in that case (when import succeeds as a "data disk") is as follows

gcloud compute images import my-data-disk --source-file=gs://partner-image-stage/MyImageOfBootDisk.vmdk --data-disk

So, this seems to be a problem owing to some kind of restrictions google cloud has with bootable images

I did look at Google documentation that spells out the requirements that the source VM needs to meet https://cloud.google.com/compute/docs/import/import-ovf-files#source_vm_requirements

And another one for importing boot disks https://cloud.google.com/compute/docs/import/import-existing-image

However problem is, since this image is shared by our partners I am expected to specify what exact problem does their image have

I did look at Timeout error when creating an image in Google Cloud from a .vmdk file - and I did verify I have appropriate permissions. DO note that I can import the same file if I refrain from treating it as boot disk

And do you think I could use the disk imported as data disk and convert it to a bootable disk ?

Your inputs are solicited

Many thanks

Yogesh

Yogesh Devi
  • 617
  • 11
  • 30
  • 1
    How is the disk formatted (MBR or UEFI)? https://cloud.google.com/compute/docs/import/import-ovf-files#import_ova_file_bootloader – John Hanley Feb 04 '22 at 19:17
  • 1
    Have you run the [Image Import Precheck Tool](https://github.com/GoogleCloudPlatform/compute-image-tools/tree/master/cli_tools/import_precheck/) as seen in the [documentation](https://cloud.google.com/compute/docs/import/import-ovf-files#:~:text=To%20verify%20that%20your%20VM%20meets%20the%20requirements%2C%20you%20can%20run%20the%20precheck%20tool.) – Pit Feb 07 '22 at 08:53
  • @JohnHanley The link https://cloud.google.com/compute/docs/import/import-ovf-files#import_ova_file_bootloader seems to be concerning import of an OVA file to create a VM. In my case I am trying to create a disk image from a VMDK. Does the disk image creation command has an equivalant option like "--guest-os--features =UEFI_COMPATIBLE " ? The gcloud compute images import command for creating a disk image gives an error as follows ERROR: (gcloud.compute.images.import) unrecognized arguments: --guest-os-features =UEFI_COMPATIBLE – Yogesh Devi Feb 07 '22 at 09:15
  • 2
    Try the next command to import the disk: `gcloud alpha compute images create --source-image= --source-image-project= --guest-os-features=UEFI_COMPATIBLE` – Jofre Feb 24 '22 at 14:26

1 Answers1

0

Use the next command to import the data disk and convert it to a bootable disk:

gcloud alpha compute images create <MY_IMAGE_NAME> --source-image=<SOURCE_IMAGE_NAME> --source-image-project=<SOURCE_IMAGE_PROJECT> --guest-os-features=UEFI_COMPATIBLE
Marc Pons
  • 79
  • 4