CLI tool to gracefully shut down or start Proxmox LXC containers in parallel.
- Go 1.22+
- Access to a Proxmox VE API
- API credentials (user/password)
- Clone the repository and install dependencies:
go mod tidy- Create a
.envfile in the project root (optional ifPM_*are already exported):
PM_API_URL=https://YOUR_PROXMOX_HOST:8006/api2/json
PM_USER=root@pam
PM_PASS=your-passwordDo not commit .env — it is listed in .gitignore.
- Build:
go build -o proxDown ../proxDown -id <id>[,<id>...] # Gracefully shut down LXC by ID
./proxDown -a # Gracefully shut down all LXC (asks to confirm)
./proxDown -up # Start all LXC (asks to confirm)
./proxDown -up -id <id>[,<id>...] # Start LXC by ID
./proxDown -a -y # Skip confirmation for all-target ops# Shut down a single container
./proxDown -id 102
# Shut down several containers
./proxDown -id 101,102,103
# Shut down every LXC (templates are skipped; confirmation required)
./proxDown -a
# Start every LXC without prompt
./proxDown -up -y
# Start selected containers
./proxDown -up -id 102- Shutdown uses Proxmox graceful shutdown (
Guest.Shutdown), not a hard stop. - Start/shutdown wait until the guest reaches
running/stopped. - Operations run in parallel with a limit of 5 concurrent workers.
- All-target modes (
-a, or-upwithout-id) ask for confirmation unless-yis set. - Only LXC guests are targeted; QEMU VMs are rejected when passed via
-id. - Guest ID
0is rejected. - Templates are skipped when using
-aor-upwithout-id. - Missing
.envis OK ifPM_API_URL,PM_USER, andPM_PASSare already in the environment. - TLS certificate verification is skipped (
InsecureSkipVerify) for typical homelab/self-signed setups.
go test ./tests/...| Path | Role |
|---|---|
main.go |
Entry point |
cli.go |
Flags, usage, confirmation |
config.go |
.env loading and Proxmox login |
targets.go |
Target resolution / listing LXC |
lxc.go |
Start / shutdown helpers |
runner.go |
Parallel execution |
internal/ids |
LXC ID parsing |
internal/options |
CLI option validation |
tests/ |
Unit tests |
This project is licensed under the MIT License.