Skip to content

feat(vmbully): add script, clone, template and passwd commands - #1022

Merged
Xe merged 2 commits into
masterfrom
feat/vmbully
Oct 10, 2026
Merged

Xe merged 2 commits into
masterfrom
feat/vmbully

Conversation

@Xe

@Xe Xe commented Oct 10, 2026

Copy link
Copy Markdown
Owner

Summary

vmbully runs JavaScript files against Proxmox VMs that are used one time, then deleted.

  • vmbully template creates a VM template from a cloud image.
  • vmbully clone clones a template into a new VM, with a tag and a password for each VM.
  • vmbully passwd sets a new password in a VM through the QEMU guest agent.
  • vmbully script runs a JavaScript file against a VM from a pool of tagged VMs.

vmbully script selects a VM with the tag vmbully and without the tag tainted. With no free VM, it clones one from the template. It adds the tag tainted, runs the script, deletes the VM, and clones the next VM.

The script has these functions:

  • $`command` runs a command in the VM and returns stdout.
  • host$`command` runs a command on the local machine.
  • scp(source, dest) copies a local file to the VM.

A failed command throws an exception. An exception that the script does not catch makes vmbully exit with status 1.

cmd/vmbully/README.md has the full documentation.

Other changes

  • yeetfile.js builds vmbully packages for amd64, arm64, ppc64le, and riscv64.
  • internal/confyg passes a rune to the %#q verb. go vet rejected the int argument, and that stopped the commit hook.
  • go.mod adds github.com/luthermonson/go-proxmox and modernc.org/quickjs. The go directive moves from 1.25.7 to 1.26.0, and some golang.org/x modules move to newer versions.

Test status

  • npm test passes in the commit hook.
  • cmd/vmbully/script_test.go covers $, host$, scp, the quoting, and the exceptions with fake functions.
  • CGO_ENABLED=0 go build ./cmd/vmbully passes for all four architectures.
  • The Proxmox, SSH, and scp code paths are not yet proven against a real host.

Xe added 2 commits October 10, 2026 00:31
go vet rejects %#q with an int argument, and that failure stopped
the commit hook for all other changes.

Signed-off-by: Xe Iaso <me@xeiaso.net>
vmbully builds Proxmox VM templates from cloud images, clones them,
and runs JavaScript against them. The script command uses a pool of
VMs tagged vmbully. Each run taints one VM, runs the script over SSH,
deletes that VM, and clones the next one.

The script can call $ for commands in the VM, host$ for commands on
this machine, and scp to copy files into the VM. Failed commands and
script errors exit nonzero.

The top-level yeetfile builds vmbully packages for all four
architectures.

Signed-off-by: Xe Iaso <me@xeiaso.net>
@github-actions

Copy link
Copy Markdown
Contributor

The latest Buf updates on your PR. Results from workflow Go / build (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedOct 10, 2026, 4:33 AM

@Xe
Xe enabled auto-merge (squash) October 10, 2026 04:33
Comment thread cmd/vmbully/clone.go
if sshIP == "" {
return fmt.Errorf("VM %d has no usable IPv4 address", newID)
}
fmt.Printf("login: %s@%s password: %s\n", sshUser, sshIP, password)
Comment thread cmd/vmbully/passwd.go
return fmt.Errorf("set password for %s on VM %d: %w", user, vmid, err)
}

fmt.Printf("login: %s password: %s\n", user, password)
Comment thread cmd/vmbully/ssh.go
User: user,
Auth: []ssh.AuthMethod{ssh.Password(password)},
// The VM is seconds old, so there is no known host key to check. Lab only.
HostKeyCallback: ssh.InsecureIgnoreHostKey(),
@Xe
Xe merged commit 42601f5 into master Oct 10, 2026
9 of 10 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