Skip to content
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

Filesystem changes not fully syncing #1

Open
DhashS opened this issue Nov 22, 2024 · 0 comments
Open

Filesystem changes not fully syncing #1

DhashS opened this issue Nov 22, 2024 · 0 comments

Comments

@DhashS
Copy link
Collaborator

DhashS commented Nov 22, 2024

I've noticed that filesystem changes such as large tar files having a different sha256 than the input tar file.

Upstream, I've done something like

sync = [{"type": "shell", "inline": ["sync"]}]
packerfile["provisioners"].extend(paths_mapping)
packerfile["provisioners"].extend(sync)

which is a biiiit tacky for my taste. However, I found a doc section in the packer docs that might be a better way of doing this.

It is important to add a shutdown_command. By default Packer halts the virtual machine and the file system may not be sync'd. Thus, changes made in a provisioner might not be saved.

so maybe try doing this instead?

Thinking about how this should get tested, I'd like to generate a byte pattern, load it in via provisioners, and then immediately halt the machine, boot it back up, and attempt to sha256sum the file and see if it matches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant