Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ProxDown

CLI tool to gracefully shut down or start Proxmox LXC containers in parallel.

Requirements

  • Go 1.22+
  • Access to a Proxmox VE API
  • API credentials (user/password)

Setup

  1. Clone the repository and install dependencies:
go mod tidy
  1. Create a .env file in the project root (optional if PM_* are already exported):
PM_API_URL=https://YOUR_PROXMOX_HOST:8006/api2/json
PM_USER=root@pam
PM_PASS=your-password

Do not commit .env — it is listed in .gitignore.

  1. Build:
go build -o proxDown .

Usage

./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

Examples

# 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

Behavior

  • 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 -up without -id) ask for confirmation unless -y is set.
  • Only LXC guests are targeted; QEMU VMs are rejected when passed via -id.
  • Guest ID 0 is rejected.
  • Templates are skipped when using -a or -up without -id.
  • Missing .env is OK if PM_API_URL, PM_USER, and PM_PASS are already in the environment.
  • TLS certificate verification is skipped (InsecureSkipVerify) for typical homelab/self-signed setups.

Tests

go test ./tests/...

Project layout

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

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages