PxPilot is a tool designed to start Proxmox virtual machines (VMs) in a specified order according to a configuration file. It ensures VMs only boot up only if their dependencies are running, and sends notifications via email or Telegram about the startup process results.
Access your LXC container via SSH or the Proxmox console and run:
bash -c "$(wget -qLO - https://github.com/ghostkaa/pxpilot/raw/main/misc/install.sh)"
This command performs the following actions:
To update PxPilot to latest version, run:
bash -c "$(wget -qLO - https://github.com/ghostkaa/pxpilot/raw/main/misc/update.sh)"
Previous version will be backed up into pxpilot_backup before updating.
Configure PxPilot in the config.yaml file. This file contains settings for connecting to your Proxmox server and managing VMs.
To check the configuration file, you can run PxPilot in validation mode:
python3 -m pxpilot [-v | --validate_config]
venv/bin/python3 -m pxpilot [-v | --validate_config]
In this mode, the configuration will be validated for the main parameters, and the connection to Proxmox will be checked.
To interact with Proxmox services, ensure that the authentication credentials have the appropriate permissions. For detailed guidance on permissions, refer to the Proxmox documentation on (e.g. PVE Permissions).
proxmox_config:
host: "192.168.1.2:8006" # proxmox host address with port
token: "pxpilot@pve!pilot" # token name in format username@pve|pam ! token name
token_value: "c5f6f8e3-4627-4347-83a4-ee7cf6b4c0b5" # token secret
verify_ssl: false
proxmox_config:
host: "192.168.1.2:8006" # Proxmox host address including port
username: "user"
realm: "pve" # Authentication realm (e.g., 'pam', 'pve')
password: "password"
verify_ssl: false
In configurations where both token and username/password details are provided, the system will default to using the token for authentication. For more information about setting up the connection, please refer to the Proxmoxer Documentation
General settings allow you to manage system behaviors such as automatic shutdowns and self-host settings.
It is possible to shutdown the pxpilot host(lxc) after start is completed. But be careful with this setting, it would be challenging to make some changes inside a container when this option is enabled
settings: # optional
auto_shutdown: true # Automatically shutdown the host where the pxpilot is located
self_host:
vm_id: 100
Configure notifications to be sent through telegram or email.
Example configuration for Telegram and email notifications:
notification_options:
- telegram:
token: "7022098123:BAH2pbAE5RueAGui43zO5wPjB5XJUWOxGsd" # telegram bot token
chat_id: "-4182361654" # telegram chat id
- email:
disabled: True # Optional, if set to "true", this notification setting will not be used.
smtp_server: "example.com"
smtp_port: 587
smtp_user: "user"
smtp_password: "pwd"
from_email: "pxpilot@example.com"
to_email: "myemail@example.com"
Configure individual virtual machines with specific startup parameters, dependencies, and health checks.
vms:
- vm_id: 100
dependencies: [] # List VM IDs that must start before this VM
startup_parameters:
await_running: true # Wait for VM to be fully up before proceeding
startup_timeout: 60 # Timeout in seconds. If the VM does not start within this time, the startup status will be set to 'failed'.
#dependencies: [] # Dependencies are optional
healthcheck:
target_url: "127.0.0.1"
check_method: "ping" # Use 'ping' or 'http' to check VM health
- vm_id: 102
healthcheck:
target_url: "http://127.0.0.1/"
check_method: "http"
dependencies:
- 101 # VM 101 must be running before this VM can start