Repository navigation
Shared VM helpers: disk import, releases, checksums, first boot, IP by MAC - #117
Merged
Merged
Conversation
vm/common.func (loaded by the Proxmox and Incus engines) adds vm_require_tools, vm_release_asset, vm_latest_from_index, vm_firstboot_unit, vm_wait_http and a standard summary/finish block. pve/vm-core.func adds vm_import_disk, vm_start_vm, vm_guest_exec, vm_wait_guest_agent and vm_wait_for_ip; Incus refuses those explicitly. get_vm_ip matches the NIC by MAC and skips container bridges, wait_for_cloud_init uses the guest agent, and checksum discovery covers OpenWrt, FreeBSD and TurnKey plus --checksum-url. vm-app.func now uses these helpers instead of its own copies. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Try this branchThe engine and the scripts resolve independently, so a production script can COMMUNITY_SCRIPTS_CORE_URL=https://raw.githubusercontent.com/community-scripts/core/feat/vm-harmonization \
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/debian.sh)"Swap This PR touches both backends. Worth running on a Proxmox VE and an Incus host. Run a script from a fork as wellcurl -fsSL https://raw.githubusercontent.com/community-scripts/core/feat/vm-harmonization/tools/run.sh |
bash -s -- https://raw.githubusercontent.com/YOU/DevScripts/your-branch ct/debian.sh \
https://raw.githubusercontent.com/community-scripts/core/feat/vm-harmonizationNote that Useful flags while testing
|
8 of 28 tasks
MickLesk
marked this pull request as ready for review
October 7, 2026 18:07
javexed
pushed a commit
to javexed/ProxmoxVED
that referenced
this pull request
Oct 8, 2026
All 14 vm/*.sh follow one layout: Core headers instead of embedded banners, vm_dialog instead of whiptail, vm_require_tools instead of host apt, vm_release_asset/vm_latest_from_index for releases, vm_extract_image, vm_customize and vm_firstboot_unit for image changes, vm_import_disk with the reported volume, vm_wait_for_ip by MAC, and vm_print_summary/vm_next_steps/vm_finish. The wizard harness enforces the layout; CI tests against the Core branch of the same name when it exists. Requires community-scripts/core#117. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…omments qm prints "Successfully imported disk as 'unused0:<volume>'": capital S, "as", and the unusedN: prefix. The regex matched none of that and the test encoded the wrong line, so every import went through the unusedN fallback. vm_wait_http counted 5s per round but each round could take 10s. The summary no longer names the Proxmox UI, since common.func serves Incus too.
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.
Shared helpers so DevScripts VM scripts stop hand-rolling the same steps (and the same bugs).
New
vm/common.func(loaded bypve/vm-core.funcandincus/vm-core.func, prefetched bycore/build.func):vm_require_tools– install missing host tools up front (one apt call) or stop before anything is createdvm_customize– named virt-customize step that warns with libguestfs' reason and returns failurevm_release_asset– GitHub/GitLab/Codeberg release asset vialib/forge.func(token, rate limit, API-less fallback); exposes GitHub's assetdigestasVM_RELEASE_SHA256vm_latest_from_index– newest entry of an HTML index (--sort-by,--probetemplates), never a hardcoded fallbackvm_firstboot_unit– run-once systemd unit with Cloud-Init-aware ordering (nomulti-user/cloud-finalcycle) and a success markervm_wait_http,vm_print_summary,vm_next_steps,vm_finish– standard readiness check and closing blockpve/vm-core.funcvm_import_disk–qm disk import/importdisk, returns the volume Proxmox reported or the newunusedN; fixes thepvesm list | sort | tailfallback pickingdisk-9overdisk-10vm_start_vm,vm_wait_guest_agent,vm_guest_exec,vm_wait_for_ip(Incus: explicit exit 119)sha256sums, FreeBSDCHECKSUM.SHA256, TurnKey.hash(GNU/BSD/bare layouts) plusvm_fetch_image --checksum-urlvm/cloud-init.funcget_vm_ip <vmid> [timeout] [mac]matches the NIC by MAC and skips docker/podman/CNI/link-local addresseswait_for_cloud_inituses the guest agent (cloud-init status --wait) before SSHpve/vm-app.funcuses the shared download, import, tool and IP helpers instead of its own copies (its import swallowed failures).Tests: new
tests/vm-helpers.sh(39 cases, added to Verify split files);tests/vm-iso-storage.shandtests/vm-consoles.shunchanged and passing; ShellCheck error-clean. Docs:docs/vm.md,docs/backends.md,docs/README.md.DevScripts counterpart (all VM scripts migrated) follows on the branch of the same name, whose CI runs against this branch.