0

我有一个每月流程,从我的 GCP GCE 实例创建 VMDK 并将它们存储到 GCS 中,以便在冷线存储桶中长时间保留。

导出过程运行良好,我正在使用它来导出:

gcloud compute images export \
    --image=${_IMAGE_NAME} \
    --destination-uri=${_DEST_URI} \
    --export-format=vmdk \
    --network=${_NETWORK} \
    --subnet=${_SUBNET} \
    --project=${PROJECT_ID} --timeout=12h \
    --async

现在我正在尝试将 gcloud 生成的 vmdk 导入 GCE 以恢复给定的 VM,但它失败了:

gcloud compute images import disk-name --os=windows-2016 --source-file=gs//my-bucket-name/my-vmdk-name.vmdk

这是返回错误:

starting build "xxxxxxxx-xxxx-xxxxxx-xxxxx-xxxxxxxxxx"
    
[import-image]: 2021-09-06T10:10:23Z the input file is a gzip file, which is not supported by image import. To import a file that was exported from Google Compute Engine, please use image create. To import a file that was exported from a different system, decompress it and run image import on the disk image file directly
    
ERROR
ERROR: build step 0 "europe-west3-docker.pkg.dev/compute-image-tools/wrappers/gce_vm_image_import:release" failed: step exited with non-zero status: 1

ERROR: (gcloud.beta.compute.images.import) build xxxxxxxx-xxxx-xxxxxx-xxxxx-xxxxxxxxxx completed with status "FAILURE"

我按照消息中的建议重新尝试了该过程,image create但它仍然返回 gzip 文件错误。

我怎样才能做到这一点而不会出错?这是 GCP 生成的图像。

4

0 回答 0