Skip to content

Filesystem changes not fully syncing #1

@DhashS

Description

@DhashS

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions