Skip to content

graysievert-lab/terraform-modules-proxmox_vm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Proxmox VM out of cloud image

This module creates and launches a Pproxmox VM from a qcow2 cloud image. The module expects the operational bpg/proxmox provider. See variables.tf, outputs.tf and examples folder for description of input/output variables and usage.

Requirements

Name Version
proxmox >=0.66.2

Providers

Name Version
proxmox >=0.66.2

Modules

No modules.

Resources

Name Type
proxmox_virtual_environment_vm.vm resource

Inputs

Name Description Type Default Required
cloudinit
VM cloud-init config:
meta_config_file: (optional) Cloud-init user config
user_config_file: (optional) Cloud-init vendor config
vendor_config_file: (optional) Cloud-init meta config
network_config_file: (optional) Cloud-init meta config (overrides ipv4)
ipv4: (optional) ip v4 cloud-init network configuration object.
address: CIDR or "dhcp"
gateway: (optional) IP address, must be omitted when "dhcp" is used
namesevers: (optional) list of IP addresses (e.g. ["1.1.1.1", "8.8.8.8"]),
if not set proxmox default is used
domain: (optional) search domain (e.g. "lan"),
if not set proxmox default is used
[NOTE] If set, ipv4 object will produce cloud-init Networking Config Version 1.
If Networking Config Version 2 (or/and complex configuration) is required,
then use network_config_file instead
object({
meta_config_file = optional(string)
user_config_file = optional(string)
vendor_config_file = optional(string)
network_config_file = optional(string)
ipv4 = optional(object({
address = string # (e.g. "192.168.2.2/24" or "dhcp")
gateway = optional(string) # must be omitted when dhcp is used as the address
nameservers = optional(list(string)) # (e.g. ["1.1.1.1", "8.8.8.8"])
domain = optional(string) # search domain(e.g. "lan")
}))
})
{
"ipv4": {
"address": "dhcp",
"domain": null,
"gateway": null,
"nameservers": null
},
"meta_config_file": null,
"user_config_file": null,
"vendor_config_file": null
}
no
hardware
VM hardware config:
mem_dedicated_mb: max memory
mem_floating_mb: min memory
cpu_sockets: No of CPU sockets
cpu_cores: No of CPU cores
disk_size_gb: size of VM disk
object({
mem_dedicated_mb = number
mem_floating_mb = number
cpu_sockets = number
cpu_cores = number
disk_size_gb = number
})
{
"cpu_cores": 2,
"cpu_sockets": 1,
"disk_size_gb": 15,
"mem_dedicated_mb": 2048,
"mem_floating_mb": 1024
}
no
metadata
VM essential info:
node_name: The name of the node to assign the virtual machine to.
datastore_id: default is "local-zfs"
image: path to a cloud image in a format storage:content/imagefile
agent: The QEMU agent configuration. True/False
description: The virtual machine description.
name: The virtual machine name.
pool_id: The identifier for a pool to assign the virtual machine to.
tags: A list of tags of the VM.
vm_id: The VM identifier.
object({
node_name = string
datastore_id = string
image = string
agent = optional(bool)
description = optional(string)
name = optional(string)
pool_id = optional(string)
tags = optional(list(string))
vm_id = optional(number)
})
{
"agent": false,
"datastore_id": "local-zfs",
"description": null,
"image": "local:iso/Rocky-9-GenericCloud-Base.latest.x86_64.qcow2.img",
"name": null,
"node_name": null,
"pool_id": null,
"tags": [],
"vm_id": null
}
no

Outputs

Name Description
ipv4_addresses IP v4 addresses
ipv6_addresses IP v6 addresses
mac_addresses MAC addresses
vm_id VM ID

About

Terraform module to simplify creation of VMs on Lab's Proxmox cluster

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages