diff --git a/CHANGELOG.md b/CHANGELOG.md index 97e2b2a..7aceeb5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Update `proxmox` provider to `3.0.1-rc4`. +- Refactor disks implementation for upstream provider. + ## [1.8.0] - 2023-04-03 ### Added diff --git a/instance.tf b/instance.tf index bec6999..5f12aa1 100644 --- a/instance.tf +++ b/instance.tf @@ -9,7 +9,7 @@ resource "proxmox_vm_qemu" "proxmox_instance" { pxe = var.pxe_boot boot = var.boot onboot = var.onboot - oncreate = var.oncreate + vm_state = var.vm_state agent = var.qemu_agent @@ -37,14 +37,17 @@ resource "proxmox_vm_qemu" "proxmox_instance" { dynamic "disk" { for_each = var.disks content { - type = disk.value.type - storage = disk.value.storage - size = disk.value.size + discard = disk.value.discard + emulatessd = disk.value.emulatessd + iothread = disk.value.iothread + size = disk.value.size + slot = disk.value.slot + storage = disk.value.storage + type = disk.value.type } } os_type = var.pxe_boot == true ? null : var.os_type cicustom = var.pxe_boot == true ? null : var.cicustom # example: "user=${local.citemplate_storage}:${local.snippet_dir}/user-${local.snippet_file_base},network=${local.citemplate_storage}:${local.snippet_dir}/network-${local.snippet_file_base}" - cloudinit_cdrom_storage = var.pxe_boot == true ? null : var.cloudinit_cdrom_storage } diff --git a/variables.tf b/variables.tf index bccfd8e..5f5ea51 100644 --- a/variables.tf +++ b/variables.tf @@ -103,10 +103,10 @@ variable "onboot" { type = bool } -variable "oncreate" { - default = null - description = "Whether to have the VM startup after the VM is created." - type = bool +variable "vm_state" { + default = "running" + description = "Desired power state of the VM." + type = string } variable "network_interfaces" { @@ -120,13 +120,23 @@ variable "network_interfaces" { } variable "disks" { - default = null description = "List of objects representing additional disks." type = list(object({ - type = string - storage = string - size = string + slot = string + size = string + storage = string + emulatessd = bool + iothread = bool + discard = bool })) + default = [{ + slot = "scsi0" + size = "20G" + storage = "local-lvm" + emulatessd = false + iothread = false + discard = false + }] } variable "os_type" { @@ -140,9 +150,3 @@ variable "cicustom" { description = "Path(s) to cloud-init config files (ignored when pxe_boot is true)." type = string } - -variable "cloudinit_cdrom_storage" { - default = null - description = "Name of the storage to create the cloud-init image in (e.g. local-lvm)." - type = string -} diff --git a/versions.tf b/versions.tf index 54b7164..0511eb5 100644 --- a/versions.tf +++ b/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { proxmox = { source = "Telmate/proxmox" - version = ">= 2.9.14" + version = ">= 3.0.1-rc4" } } }