A collection of Python scripts for managing Incus containers, with special integration for CheckMK monitoring.
Sets up Incus on your system. This script handles the installation and initial configuration of Incus on Debian-based and Arch Linux-based systems.
Creates multiple Incus containers with SSH access.
./create_containers.py --count 5 --prefix test --ssh-key ~/.ssh/id_rsa.pub
Options:
--image
: Container image to use (default: images:debian/bookworm)--start
: First container ID number (default: 1)--count
: Number of containers to create (required)--prefix
: Prefix for container names (default: test)--type
: Type of instance (default: t1.micro)--ssh-key
: Path to SSH public key file (required)--ignore-existing
: Skip creation if container exists (default: False)--workers
: Number of parallel workers (default: 4)
Removes multiple Incus containers.
./remove_containers.py --count 5 --prefix test
Options:
--prefix
: Prefix for container names (default: test)--start
: First id of container to remove (default: 1)--count
: Number of containers to remove (required)--workers
: Number of parallel workers (default: 4)
SSH into a specific container with automatic host key handling.
./ssh_container.py --prefix test 1
Options:
--prefix
: Prefix for container name (default: test)number
: Container number to SSH into (required)
Creates containers and registers them with a CheckMK instance.
Executes scripts across multiple containers.
Containers are named using the pattern: {prefix}{number:03d}
Example: test001
, test002
, etc.
- Python 3.6+
- Incus installed and configured
- SSH key pair for container access
- CheckMK instance (for monitoring features)
- Install Incus using the provided setup script:
sudo ./setup_incus.sh
- Ensure you have an SSH key pair:
ssh-keygen -t rsa -b 4096
- Install Python dependencies (if any required by your setup)
- Create 5 containers starting from ID 1:
./create_containers.py --count 5 --ssh-key ~/.ssh/id_rsa.pub
- Create 3 more containers starting from ID 6:
./create_containers.py --start 6 --count 3 --ssh-key ~/.ssh/id_rsa.pub
- SSH into container number 1:
./ssh_container.py 1
- Remove containers 1-5:
./remove_containers.py --count 5
Feel free to submit issues and enhancement requests!
MIT Licensed