Skip to main content

A Pulumi provider for Proxmox VE Python

Project description

Pulumi Proxmox Provider

License: MIT

Build pulumi provider docs

This repository contains a Pulumi Provider for managing Proxmox VE resources. It allows you to define and manage Proxmox VE resources using Pulumi's infrastructure-as-code approach. (Сurrently in early development stage - focused on LXC container management using)

[!WARNING] This is a learning project and experimental repository. The code is under active development and should not be used in production environments. APIs may change without notice.

Overview

Custom Pulumi provider for Proxmox VE written in Python. Main focus is on LXC containers with features missing in existing providers.

Why?

Existing Terraform/Pulumi providers have limitations that affect my workflow:

  • LXC disk expansion requires container recreation instead of using Proxmox API
  • Missing advanced LXC configuration options
  • Limited Proxmox API coverage

This provider is written in Python for easier development and customization.

🔗 Alternative Proxmox IaC Solutions

Terraform Providers

Pulumi Providers

📦 Features

Current Implementation

  • 🚧 In Development: Core LXC container management
  • 🚧 In Development: Enhanced disk operations

Planned Features

  • 📦 LXC Containers: Full lifecycle management
  • 💾 Disk Management: Dynamic expansion and configuration
  • 🌐 Networking: Advanced networking configuration
  • 🔧 Templates: Support for LXC templates
  • 📊 Monitoring: Resource usage and status monitoring

🛠️ Getting Started

Prerequisites

  • Python
  • Pulumi CLI
  • Access to a Proxmox VE cluster

Installation

Option 1: Install from PyPI (when published)

pip install pulumi-proxmox-provider

Option 2: Install from GitHub (current)

# Install directly from GitHub
pip install git+https://github.com/akmalovaa/pulumi-proxmox-provider.git

# Or clone and install in development mode
git clone https://github.com/akmalovaa/pulumi-proxmox-provider.git
cd pulumi-proxmox-provider
pip install -e .

Option 3: Using uv (recommended for development)

git clone https://github.com/akmalovaa/pulumi-proxmox-provider.git
cd pulumi-proxmox-provider
uv sync

Usage

# Example Python usage - see examples/example_lxc.py for complete example
import pulumi
from pulumi_proxmox_provider import LXCContainer, LXCContainerArgs

# Configuration
config = pulumi.Config("proxmox")

# Create LXC container
lxc = LXCContainer(
    "my-test-container",
    LXCContainerArgs(
        node=config.get("node", "pve"),
        vm_id=210,
        hostname="test-container",
        cores=2,
        memory=512,
        ostemplate="local:vztmpl/ubuntu-24.10-standard_24.10-1_amd64.tar.zst",
        password="secure-password",
        unprivileged=True,
        disks={
            "rootfs": "local-lvm:8",  # 8GB root filesystem
        },
        networks={
            "net0": "name=eth0,bridge=vmbr0,ip=dhcp",
        },
    ),
)

# Export container information
pulumi.export("container_id", lxc.vm_id)
pulumi.export("container_hostname", lxc.hostname)

For more examples, check the examples/ directory.

Resources

Development

uv pip install -e .
# or
uv pip install -e . --force-reinstall

Pulumi create stack and select it:

pulumi stack ls

Preview changes:

uv run pulumi preview --diff

Pre-hook verify manual:

uv run pre-commit run --all-files --hook-stage manual
# or commit disable hooks
git commit -m "Update pre-commit configuration to fixed versions" --no-verify

Logging example:

pulumi.info("message")
pulumi.info("message", resource)
pulumi.debug("hidden by default")
pulumi.warn("warning")
pulumi.error("fatal error")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pulumi_proxmox_provider-0.1.0.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pulumi_proxmox_provider-0.1.0-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file pulumi_proxmox_provider-0.1.0.tar.gz.

File metadata

File hashes

Hashes for pulumi_proxmox_provider-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6338c0305ebf22405a73462f8505f0eb4b2e45a153b1bdc295452fa83c2371ed
MD5 bc32704f2ee1e0e8a94d664f45e9112c
BLAKE2b-256 86607d4aa9eb17135a899f68c99658ddf33271b74e02bea45e9802c977e376a6

See more details on using hashes here.

File details

Details for the file pulumi_proxmox_provider-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pulumi_proxmox_provider-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 feac29087b31c80d8aebd00730bcdad79e4f4428a61667a241469ad28599aa6b
MD5 42315d0390d3e45a3fa839ff6f134c69
BLAKE2b-256 ab7b5b20ae4d6d484d29910fc4df88e4e3abcf31994af99e8a023f2c2809cd40

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page