-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Floppy gets overwritten with multiple parallel runs #93
Comments
Out of curiosity, do you also observe the issue occur if your Packer template has For example, does the issue occur if you have the following in a template:
And then you run build all four at the same time...
Ryan |
@tenthirtyam The above was just an example, as we have multiple teams building different images for different projects and operating systems. Combining all of them into a single git repository is just not practical as they all have different settings. |
@agowa338 I assume then that this is has not been observed with a single execution with multiple source/builds in a single template, but only observed during parallel executions of Packer to the same vSphere endpoint? Ryan |
yes, only when multiple parallel executions of Packer to the same vSphere endpoint run. |
I'm unable to reproduce this in my environments.
Host: Ubuntu Server 20.04 LTS The build were started 2s apart: Online and Ansible engaged.... Builds completed w/o error. Note: skipping import to content library (new in 1.7.7) for testing purposes. Ryan |
…p#93) * Update circleci image to use new cimg namespace with Go1.17 * Update build tags for Go 1.17 ``` make fmt ``` * Fix path to Go working directory on linux
The changes proposed in #399 may allow for this to be avoided by allowing for isolated remote caches. |
The simplest solution to avoid this overwriting issue is probably to add a runtime generated uuid or a sha256 hash (that dependent on the virtual floppies content) to the filename. Would adding something like this (just to be extra safe) work with your proposal? @tenthirtyam |
There's another change I've already prepared for similar that will ensure additional coverage. |
I plan to implement this with: import
github.com/hashicorp/packer-plugin-sdk/uuid where Here we can generate a similar name like Should be in this week. |
Looking at this a little more, the SDK is actually using its own tmp package by using "packer-*.iso". https://github.com/hashicorp/packer-plugin-sdk/blob/main/tmp/tmp.go Either way, this can be updated to generate a unique name in the same format but with the |
But wouldn't TimeOrderedUUID still pose a significant risk of collisions? E.g. when there are multiple CI jobs getting triggered simultaneously? Also if the unique id is content dependent we can also detect if it already exists and overwrite (avoid cluttering the datastore in case the final deletion failed in former runs). |
- Updates the naming pattern for a generated floppy from the status `packer-tmp-created-floppy.flp` to a pattern of `packer-##########.flp`. This naming pattern matches the one used by packer-sdk for generated ISOs. This helps avoid conflicts with other floppy images that might be uploaded. - Updates the tests to account for this change from the static name to the new pattern. Ref: #93 Signed-off-by: Ryan Johnson <[email protected]>
PR #403 |
- Updates the naming pattern for a generated floppy from the status `packer-tmp-created-floppy.flp` to a pattern of `packer-##########.flp`. This naming pattern matches the one used by packer-sdk for generated ISOs. This helps avoid conflicts with other floppy images that might be uploaded. - Updates the tests to account for this change from the static name to the new pattern. Ref: #93 Signed-off-by: Ryan Johnson <[email protected]>
- Updates the naming pattern for a generated floppy from the status `packer-tmp-created-floppy.flp` to a pattern of `packer-##########.flp`. This naming pattern matches the one used by packer-sdk for generated ISOs. This helps avoid conflicts with other floppy images that might be uploaded. - Updates the tests to account for this change from the static name to the new pattern. Ref: #93 Signed-off-by: Ryan Johnson <[email protected]>
- Updates the naming pattern for a generated floppy from the status `packer-tmp-created-floppy.flp` to a pattern of `packer-##########.flp`. This naming pattern matches the one used by packer-sdk for generated ISOs. This helps avoid conflicts with other floppy images that might be uploaded. - Updates the tests to account for this change from the static name to the new pattern. Ref: #93 Signed-off-by: Ryan Johnson <[email protected]>
Overview of the Issue
When two or more packer instances are executed simultaneously for different projects against the same vsphere server the floppy file gets overwritten.
Reproduction Steps
as well as
Plugin and Packer version
Packer v1.7.4
Simplified Packer Buildfile
Operating system and Environment details
OS, Architecture, and any other information you can provide about the
environment.
GitLab CI pipeline
Log Fragments and crash.log files
Packer doesn't crash, building the VM fails (race conditions, see above).
The text was updated successfully, but these errors were encountered: