Skip to content

Sync VM filesystem before snapshot to prevent data loss#46

Merged
mtarsel merged 1 commit into
IBM:mainfrom
dale-fu:fix/sudo
Jun 24, 2026
Merged

Sync VM filesystem before snapshot to prevent data loss#46
mtarsel merged 1 commit into
IBM:mainfrom
dale-fu:fix/sudo

Conversation

@dale-fu

@dale-fu dale-fu commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Add filesystem sync before VM snapshot to prevent data loss. Late-stage file writes (e.g., /etc/sudoers.d/runner) can remain in the guest VM's page cache when lxc snapshot captures the virtual disk. This causes those writes to be silently lost in the published image. Adding sync inside the VM before snapshotting ensures all pending writes are flushed to the virtual disk.

How it was found

VM images were missing passwordless sudo for the runner user. The sudoers file was written correctly during the build (confirmed via build logs), but was empty or absent when launching a VM from the published image. Disabling cloud-init confirmed the file was never in the image. A manual test with sync before snapshot resolved it.

@dale-fu dale-fu requested review from mtarsel and rahulssv-ibm June 23, 2026 03:11
Signed-off-by: Dale Fu <Dale.Fu@ibm.com>
@dale-fu dale-fu marked this pull request as ready for review June 23, 2026 17:56
@dale-fu

dale-fu commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

@rahulssv-ibm Can you double check this for ppc64le env?

@mtarsel mtarsel merged commit 6897ac5 into IBM:main Jun 24, 2026
4 checks passed
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

Successfully merging this pull request may close these issues.

2 participants