Repository navigation
Add verify-clone.sh: verify a template from the Proxmox host - #50
Merged
Merged
Conversation
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
… the host Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ounce Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
modem7
added a commit
that referenced
this pull request
Oct 23, 2026
Host-side wrapper: clones a template, boots the clone, runs verify-template.sh inside it through the guest agent, returns its exit code and removes the clone. Also: verify-template.sh skips shell and sudo checks for a root login, and refuses a script that is not verify-template.sh.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
verify-clone.sh, a host-side wrapper soverify-template.shno longer has to be copied into a clone by hand../verify-clone.sh <template-vmid> [--profile ...] [--send-test-mail <addr>] [--vmid N] [--full [--storage S]] [--keep] [--timeout S] [--verify-timeout S]Flow:
qm clone(linked by default),qm start, wait onqm agent ping,cloud-init status --wait, thenqm guest exec --pass-stdin 1 -- /bin/bash -s -- <args>withverify-template.shon stdin (about 22 KB, limit 1 MiB). The guest output is printed in order and the exit code is returned. The clone is destroyed on exit, failure, Ctrl-C and SIGTERM unless--keepis given.qm clonesucceeds).--send-test-mail, polls the guest's Postfix journal forstatus=sent(up to 60s).deferredorbouncedis a FAIL.--helpfollows thebuild-templates.shstyle.verify-template.shis unchanged.Testing
bash -nandshellcheckare clean. Behaviour was checked against a mockedqmandpvesh: happy path, verify FAIL,--keep, existing VMID, agent timeout, clone failure, SIGINT and SIGTERM, mail sent, deferred and missing, plain-text qm output, jq fallback, bad arguments.Not run on a real Proxmox host. Two things are assumed, not confirmed:
qm guest execprints JSON like{"exitcode":0,"exited":1,"out-data":"..."}(not documented; plain text is also handled).postfix@-.service; bothpostfixandpostfix@*units are queried.