hashicorp / packer

Packer is a tool for creating identical machine images for multiple platforms from a single source configuration.
http://www.packer.io
Other
15.13k stars 3.33k forks source link

googlecompute-import unable to take virtualbox-ovf #7857

Open bizxta opened 5 years ago

bizxta commented 5 years ago

Reason being that it simply compresses the .ova file into a tar.gz, when it must be a raw disk image and it must be named disk.raw:

$ tar --list -f output/disk.raw.tar.gz
packer-virtualbox-ovf-1562685758.ova

https://gist.github.com/bizxta/855d3c6078f4bf410f53dd33b6082d96

SwampDragons commented 5 years ago

This is the documented behavior, so I am marking this as a feature request rather than a bug.

The import process operates by uploading a temporary copy of the compressed raw disk image to a GCS bucket, and calling an import task in GCP on the raw disk file. Once completed, a GCE image is created containing the converted virtual machine. The temporary raw disk image copy in GCS can be discarded after the import is complete.

bizxta commented 5 years ago

Sure! I think that does make sense since the issue is more that there is no way to have virtualbox produce a raw image with that filename.

Cireo commented 2 years ago

It seems as though google supports importing ova and ovf files, which might simplify this process significantly

https://cloud.google.com/compute/docs/import/import-ovf-files https://cloud.google.com/compute/docs/import/importing-virtual-disks

gcloud compute instances import my-instance --source-uri=gs://my-bucket/my.ova
gcloud compute images import my-image --source-file eg.vmdk

EDIT: for images, not instances