Repository navigation
Builder: add --rebuild and a VMID_DEFAULT per profile - #61
Merged
Merged
Conversation
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
Makes a monthly "recreate everything" run possible:
./build-templates.sh all --rebuild --verify.VMID_DEFAULTper profile. The examples now have 52000 (base), 52001 (extras) and 52002 (desktop). The builder default no longer gives every profile the same--vmid 52000: with no create args it passes each profile's ownVMID_DEFAULTwith--auto-vmid(a profile without one still gets 52000, so older configs behave as before).--auto-vmidon its own would start at 100, so--vmidis still passed.--rebuild. Replaces each existing template in place, using the create script's--force-overwrite --i-know-what-i-am-doing: the new image is built first and only then is the old template destroyed and recreated. The create script still refuses anything that is not a stopped template. Accepted anywhere before--, like--verify; it cannot be combined with explicit create args,--generate-onlyor--init.--rebuildthe builder stops if a profile has no validVMID_DEFAULT, if two profiles share one (the second would overwrite the first), or if a template still has linked clones (qm destroywould fail after the long build). The linked-clone check looks at the local node's/etc/pve/qemu-server.--verifywith--rebuild. Replacing a template reuses its ID, so the usual "the one new VMID" detection finds nothing. With--rebuildthe profile's own ID is verified instead;--keepstill works.Testing
bash -nandshellcheckare clean. Checked against a mockedqmand a stub create script, on a copy with the root check removed: argument parsing and the errors above; default args (including IDs already taken) and--rebuildargs; three profiles generated with their ownVMID_DEFAULT; duplicate, missing and invalid IDs; linked-clone detection with a fake config folder (base-52001-matched,base-520010-not);--rebuild --verifyand--keep; plain--verifyunchanged; real--helpand--init.Not run on a real Proxmox host. The create script's real
--force-overwriterun, and its loading ofVMID_DEFAULTfrom--config, were checked by reading the code only. Linked clones on other cluster nodes are not detected.