hashicorp / packer-plugin-openstack

Packer plugin for OpenStack Builder
https://www.packer.io/docs/builders/openstack
Mozilla Public License 2.0
20 stars 19 forks source link

openstack builder hangs when using use_blockstorage_volume if volume size is too small #20

Open ghost opened 3 years ago

ghost commented 3 years ago

This issue was originally opened by @puetzk as hashicorp/packer#6957. It was migrated here as a result of the Packer plugin split. The original body of the issue is below.


From https://github.com/hashicorp/packer/issues/6956#issuecomment-435854310

If the value determined by GetVolumeSize is actually too low, perhaps an image with no value set for MinDiskGigabytes, in a format (e.g. qcow2) where the file is considerably smaller than the minimum volume that can unpack it, the volume is created but the status shown in cinder list becomes "error". WaitForVolume doesn't seem to recognize this case, and just keeps looping (and waiting) indefinitely), since volumes.Get is succeeding (the GUID does exist and has a status to read), and "error" != "available".

puetzk commented 3 years ago

I believe this issue remains valid in that WaitForVolume seems unchanged, and will only exit for network errors https://github.com/hashicorp/packer-plugin-openstack/blob/ae1177934942f7f7caff6a39591461738ac65dc7/builder/openstack/volume.go#L21

and successful completion https://github.com/hashicorp/packer-plugin-openstack/blob/ae1177934942f7f7caff6a39591461738ac65dc7/builder/openstack/volume.go#L35

So it will continue to wait and re-check if the service is reporting status == "error", even though nothing is going to change. However, our company has shut down their openstack environment, so it is no longer important to me specifically, and I would not have an environment in which to test any changes.