Terraform module which creates a proxmox vm.
module "proxmox_instance" {
source "../terraform-bpg-proxmox-vm
vm_name = "vm01"
vm_tags = ["proxmox", "terraform"]
nodename = pve-host01
vm_id = "1000"
cpu = {
cores = 2
type = "qemu64"
}
disk = {
datastore = "local-lvm"
image = "local:iso/jammy-server-cloudimg-amd64.img"
interface = virtio0
iothread = true
discard = on
size = 20
format = "raw"
}
memory = 2048
dns = ["8.8.8.8", "8.8.4.4"]
snippet = "local:snippets/snippets.yaml"
}
Name | Version |
---|---|
terraform | >= 0.13 |
proxmox | >= 0.68.0 |
Name | Version |
---|---|
proxmox | >= 0.68.0 |
vm_name
: Name of the vm instance.vm_description
: VM description.vm_tags
: VM tags.nodename
: Hostname where the vm is allocated.vm_id
: ID of the vm instance.cpu
: The CPU configuration.memory
: The memory configuration.agent
: The QEMU agent configuration.disk
: The disk configuration.dns
: The DNS configuration.ipv4
: The IPv4 configurationsnippet
: The identifier for a file containing custom user data.net_interface
: A network device.os_type
: The Operating System configuration.
vm_id
: ID of the vm instance.vm_name
: Name of the vm instance.vm_node_name
: Hostname where the vm is allocated.vm_ip_address
: IP address of the vm instance.
- To use this module you need to load a .env file (
source .env
) exporting the following variables with their respective values:
export PROXMOX_VE_ENDPOINT=''
export PROXMOX_VE_API_TOKEN=''
export PROXMOX_VE_SSH_AGENT=true
export PROXMOX_VE_SSH_USERNAME=''
- The provider does not use OS-specific SSH configuration files, such as
~/.ssh/config
. Instead, it uses the SSH protocol directly, and supports theSSH_AUTH_SOCK
environment variable (oragent_socket
argument) to connect to thessh-agent
. This allows the provider to use the SSH agent configured by the user, and to support multiple SSH agents running on the same machine. You can find more details on the SSH Agent here. The SSH agent authentication takes precedence over theprivate_key
andpassword
authentication.