diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index 49e6fce..67772b7 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -27,7 +27,7 @@ jobs: token: ${{ steps.generate-token.outputs.token }} - name: Install Terraform ⛰️ - uses: hashicorp/setup-terraform@651471c36a6092792c552e8b1bef71e592b462d8 # v3 + uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3 - name: Run TFLint ✅ uses: terraform-linters/setup-tflint@19a52fbac37dacb22a09518e4ef6ee234f2d4987 # v4 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..39327c9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 The terraform-docs Authors. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/production/host_01/README.md b/production/host_01/README.md index 050892c..f421735 100644 --- a/production/host_01/README.md +++ b/production/host_01/README.md @@ -4,13 +4,13 @@ | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.6.0 | -| [esxi](#requirement\_esxi) | 1.10.3 | +| [proxmx](#requirement\_proxmx) | 3.0.1-rc4 | ## Providers | Name | Version | |------|---------| -| [esxi](#provider\_esxi) | 1.10.3 | +| [proxmox](#provider\_proxmox) | n/a | ## Modules @@ -20,60 +20,91 @@ No modules. | Name | Type | |------|------| -| esxi_guest.dc01 | resource | -| esxi_guest.media | resource | -| esxi_guest.veeam | resource | -| esxi_portgroup.production | resource | -| esxi_vswitch.production | resource | +| [proxmox_vm_qemu.dc01](https://registry.terraform.io/providers/hashicorp/proxmox/latest/docs/resources/vm_qemu) | resource | +| [proxmox_vm_qemu.media](https://registry.terraform.io/providers/hashicorp/proxmox/latest/docs/resources/vm_qemu) | resource | ## Inputs | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [dc01\_boot\_firmware](#input\_dc01\_boot\_firmware) | The firmware type for the guest VM | `string` | n/a | yes | -| [dc01\_disk\_store](#input\_dc01\_disk\_store) | The name of the data store where the guest VM will be created | `string` | n/a | yes | -| [dc01\_guest\_name](#input\_dc01\_guest\_name) | The name of the guest VM | `string` | n/a | yes | -| [dc01\_memsize](#input\_dc01\_memsize) | The amount of memory to allocate the guest VM in MB (1024 = 1GB) | `number` | n/a | yes | -| [dc01\_nic\_type](#input\_dc01\_nic\_type) | The type for the network interface | `string` | n/a | yes | -| [dc01\_notes](#input\_dc01\_notes) | Annotated notes to add to the guest VM | `string` | n/a | yes | -| [dc01\_numvcpus](#input\_dc01\_numvcpus) | The number of vCPUs to allocate to the guest VM | `number` | n/a | yes | -| [dc01\_power](#input\_dc01\_power) | Set the guest VM Power state | `string` | n/a | yes | -| [dc01\_resource\_pool\_name](#input\_dc01\_resource\_pool\_name) | The name of the Resource Pool for the guest VM | `string` | n/a | yes | -| [dc01\_virthwver](#input\_dc01\_virthwver) | The hardware version of the guest VM | `number` | n/a | yes | -| [dc01\_virtual\_network](#input\_dc01\_virtual\_network) | The virtual network for the network interface | `string` | n/a | yes | +| [dc01\_automatic\_reboot](#input\_dc01\_automatic\_reboot) | Automatically reboot the VM when parameter changes require this. If disabled the provider will emit a warning when the VM needs to be rebooted. | `bool` | n/a | yes | +| [dc01\_bios](#input\_dc01\_bios) | The BIOS to use, options are seabios or ovmf for UEFI | `string` | n/a | yes | +| [dc01\_boot](#input\_dc01\_boot) | The boot order for the VM. For example: order=scsi0;ide2;net0 | `string` | n/a | yes | +| [dc01\_bridge](#input\_dc01\_bridge) | Bridge to which the network device should be attached. The Proxmox VE standard bridge is called vmbr0. | `string` | n/a | yes | +| [dc01\_cores](#input\_dc01\_cores) | The number of CPU cores per CPU socket to allocate to the VM. | `int` | n/a | yes | +| [dc01\_cpu](#input\_dc01\_cpu) | The type of CPU to emulate in the Guest | `string` | n/a | yes | +| [dc01\_desc](#input\_dc01\_desc) | The description of the VM. Shows as the 'Notes' field in the Proxmox GUI | `string` | n/a | yes | +| [dc01\_disk\_size](#input\_dc01\_disk\_size) | The size of the created disk. Accepts K for kibibytes, M for mebibytes, G for gibibytes, T for tibibytes. When only a number is provided gibibytes is assumed. Required when type=disk and passthrough=false, Computed when type=disk and passthrough=true. | `string` | n/a | yes | +| [dc01\_disk\_storage](#input\_dc01\_disk\_storage) | Required when type=disk and passthrough=false. The name of the storage pool on which to store the disk. | `string` | n/a | yes | +| [dc01\_efi\_storage](#input\_dc01\_efi\_storage) | The name of the storage pool on which to store the disk. | `string` | n/a | yes | +| [dc01\_efitype](#input\_dc01\_efitype) | The type of efi disk device to add. Options: 2m, 4m | `string` | n/a | yes | +| [dc01\_force\_create](#input\_dc01\_force\_create) | If false, and a vm of the same name, on the same node exists, terraform will attempt to reconfigure that VM with these settings. Set to true to always create a new VM (note, the name of the VM must still be unique, otherwise an error will be produced.) | `bool` | n/a | yes | +| [dc01\_hotplug](#input\_dc01\_hotplug) | Comma delimited list of hotplug features to enable. Options: network, disk, cpu, memory, usb. Set to 0 to disable hotplug. | `string` | n/a | yes | +| [dc01\_memory](#input\_dc01\_memory) | The amount of memory to allocate to the VM in Megabytes. | `int` | n/a | yes | +| [dc01\_model](#input\_dc01\_model) | Network Card Model. The virtio model provides the best performance with very low CPU overhead. If your guest does not support this driver, it is usually best to use e1000. Options: e1000, e1000-82540em, e1000-82544gc, e1000-82545em, i82551, i82557b, i82559er, ne2k\_isa, ne2k\_pci, pcnet, rtl8139, virtio, vmxnet3. | `string` | n/a | yes | +| [dc01\_name](#input\_dc01\_name) | The name of the VM within Proxmox | `string` | n/a | yes | +| [dc01\_onboot](#input\_dc01\_onboot) | Whether to have the VM startup after the PVE node starts. | `bool` | n/a | yes | +| [dc01\_os\_type](#input\_dc01\_os\_type) | Which provisioning method to use, based on the OS type. Options: ubuntu, centos, cloud-init. | `string` | n/a | yes | +| [dc01\_protection](#input\_dc01\_protection) | Enable/disable the VM protection from being removed. The default value of false indicates the VM is removable. | `bool` | n/a | yes | +| [dc01\_qemu\_os](#input\_dc01\_qemu\_os) | The type of OS in the guest. Set properly to allow Proxmox to enable optimizations for the appropriate guest OS. It takes the value from the source template and ignore any changes to resource configuration parameter. | `string` | n/a | yes | +| [dc01\_scsihw](#input\_dc01\_scsihw) | The SCSI controller to emulate. Options: lsi, lsi53c810, megasas, pvscsi, virtio-scsi-pci, virtio-scsi-single. | `string` | n/a | yes | +| [dc01\_sockets](#input\_dc01\_sockets) | The number of CPU sockets to allocate to the VM. | `int` | n/a | yes | +| [dc01\_tablet](#input\_dc01\_tablet) | Enable/disable the USB tablet device. This device is usually needed to allow absolute mouse positioning with VNC. | `bool` | n/a | yes | +| [dc01\_target\_node](#input\_dc01\_target\_node) | The name of the Proxmox Node on which to place the VM. | `string` | n/a | yes | +| [dc01\_vm\_state](#input\_dc01\_vm\_state) | The desired state of the VM, options are running, stopped and started. Do note that started will only start the vm on creation and won't fully manage the power state unlike running and stopped do. | `string` | n/a | yes | | [esxi\_hostname](#input\_esxi\_hostname) | hostname for ESXI host | `string` | n/a | yes | | [esxi\_hostport](#input\_esxi\_hostport) | SSH port for ESXI host | `string` | n/a | yes | | [esxi\_hostssl](#input\_esxi\_hostssl) | SSL port for ESXI host | `string` | n/a | yes | | [esxi\_password](#input\_esxi\_password) | password for ESXI host | `string` | n/a | yes | | [esxi\_username](#input\_esxi\_username) | username for ESXI host | `string` | n/a | yes | -| [media\_boot\_firmware](#input\_media\_boot\_firmware) | The firmware type for the guest VM | `string` | n/a | yes | -| [media\_disk\_store](#input\_media\_disk\_store) | The name of the data store where the guest VM will be created | `string` | n/a | yes | -| [media\_guest\_name](#input\_media\_guest\_name) | The name of the guest VM | `string` | n/a | yes | -| [media\_memsize](#input\_media\_memsize) | The amount of memory to allocate the guest VM in MB (1024 = 1GB) | `number` | n/a | yes | -| [media\_nic\_type](#input\_media\_nic\_type) | The type for the network interface | `string` | n/a | yes | -| [media\_notes](#input\_media\_notes) | Annotated notes to add to the guest VM | `string` | n/a | yes | -| [media\_numvcpus](#input\_media\_numvcpus) | The number of vCPUs to allocate to the guest VM | `number` | n/a | yes | -| [media\_power](#input\_media\_power) | Set the guest VM Power state | `string` | n/a | yes | -| [media\_resource\_pool\_name](#input\_media\_resource\_pool\_name) | The name of the Resource Pool for the guest VM | `string` | n/a | yes | -| [media\_virthwver](#input\_media\_virthwver) | The hardware version of the guest VM | `number` | n/a | yes | -| [media\_virtual\_disk\_id](#input\_media\_virtual\_disk\_id) | The id of the virtual disk | `string` | n/a | yes | -| [media\_virtual\_disk\_slot](#input\_media\_virtual\_disk\_slot) | The slot for the virtual disk | `string` | n/a | yes | -| [media\_virtual\_network](#input\_media\_virtual\_network) | The virtual network for the network interface | `string` | n/a | yes | -| [port\_group\_name](#input\_port\_group\_name) | The name of the Port Group | `string` | n/a | yes | -| [port\_group\_vlan](#input\_port\_group\_vlan) | The VLAN ID for the Port Group | `number` | n/a | yes | -| [uplink\_name](#input\_uplink\_name) | The name of the vSwitch uplink | `string` | n/a | yes | -| [veeam\_boot\_firmware](#input\_veeam\_boot\_firmware) | The firmware type for the guest VM | `string` | n/a | yes | -| [veeam\_disk\_store](#input\_veeam\_disk\_store) | The name of the data store where the guest VM will be created | `string` | n/a | yes | -| [veeam\_guest\_name](#input\_veeam\_guest\_name) | The name of the guest VM | `string` | n/a | yes | -| [veeam\_memsize](#input\_veeam\_memsize) | The amount of memory to allocate the guest VM in MB (1024 = 1GB) | `number` | n/a | yes | -| [veeam\_nic\_type](#input\_veeam\_nic\_type) | The type for the network interface | `string` | n/a | yes | -| [veeam\_notes](#input\_veeam\_notes) | Annotated notes to add to the guest VM | `string` | n/a | yes | -| [veeam\_numvcpus](#input\_veeam\_numvcpus) | The number of vCPUs to allocate to the guest VM | `number` | n/a | yes | -| [veeam\_power](#input\_veeam\_power) | Set the guest VM Power state | `string` | n/a | yes | -| [veeam\_resource\_pool\_name](#input\_veeam\_resource\_pool\_name) | The name of the Resource Pool for the guest VM | `string` | n/a | yes | -| [veeam\_virthwver](#input\_veeam\_virthwver) | The hardware version of the guest VM | `number` | n/a | yes | -| [veeam\_virtual\_network](#input\_veeam\_virtual\_network) | The virtual network for the network interface | `string` | n/a | yes | -| [vswitch\_name](#input\_vswitch\_name) | The name of the vSwitch | `string` | n/a | yes | +| [media\_automatic\_reboot](#input\_media\_automatic\_reboot) | Automatically reboot the VM when parameter changes require this. If disabled the provider will emit a warning when the VM needs to be rebooted. | `bool` | n/a | yes | +| [media\_bios](#input\_media\_bios) | The BIOS to use, options are seabios or ovmf for UEFI | `string` | n/a | yes | +| [media\_boot](#input\_media\_boot) | The boot order for the VM. For example: order=scsi0;ide2;net0 | `string` | n/a | yes | +| [media\_bridge](#input\_media\_bridge) | Bridge to which the network device should be attached. The Proxmox VE standard bridge is called vmbr0. | `string` | n/a | yes | +| [media\_cores](#input\_media\_cores) | The number of CPU cores per CPU socket to allocate to the VM. | `int` | n/a | yes | +| [media\_cpu](#input\_media\_cpu) | The type of CPU to emulate in the Guest | `string` | n/a | yes | +| [media\_desc](#input\_media\_desc) | The description of the VM. Shows as the 'Notes' field in the Proxmox GUI | `string` | n/a | yes | +| [media\_disk\_size](#input\_media\_disk\_size) | The size of the created disk. Accepts K for kibibytes, M for mebibytes, G for gibibytes, T for tibibytes. When only a number is provided gibibytes is assumed. Required when type=disk and passthrough=false, Computed when type=disk and passthrough=true. | `string` | n/a | yes | +| [media\_disk\_storage](#input\_media\_disk\_storage) | Required when type=disk and passthrough=false. The name of the storage pool on which to store the disk. | `string` | n/a | yes | +| [media\_force\_create](#input\_media\_force\_create) | If false, and a vm of the same name, on the same node exists, terraform will attempt to reconfigure that VM with these settings. Set to true to always create a new VM (note, the name of the VM must still be unique, otherwise an error will be produced.) | `bool` | n/a | yes | +| [media\_hotplug](#input\_media\_hotplug) | Comma delimited list of hotplug features to enable. Options: network, disk, cpu, memory, usb. Set to 0 to disable hotplug. | `string` | n/a | yes | +| [media\_memory](#input\_media\_memory) | The amount of memory to allocate to the VM in Megabytes. | `int` | n/a | yes | +| [media\_model](#input\_media\_model) | Network Card Model. The virtio model provides the best performance with very low CPU overhead. If your guest does not support this driver, it is usually best to use e1000. Options: e1000, e1000-82540em, e1000-82544gc, e1000-82545em, i82551, i82557b, i82559er, ne2k\_isa, ne2k\_pci, pcnet, rtl8139, virtio, vmxnet3. | `string` | n/a | yes | +| [media\_name](#input\_media\_name) | The name of the VM within Proxmox | `string` | n/a | yes | +| [media\_onboot](#input\_media\_onboot) | Whether to have the VM startup after the PVE node starts. | `bool` | n/a | yes | +| [media\_os\_type](#input\_media\_os\_type) | Which provisioning method to use, based on the OS type. Options: ubuntu, centos, cloud-init. | `string` | n/a | yes | +| [media\_protection](#input\_media\_protection) | Enable/disable the VM protection from being removed. The default value of false indicates the VM is removable. | `bool` | n/a | yes | +| [media\_qemu\_os](#input\_media\_qemu\_os) | The type of OS in the guest. Set properly to allow Proxmox to enable optimizations for the appropriate guest OS. It takes the value from the source template and ignore any changes to resource configuration parameter. | `string` | n/a | yes | +| [media\_scsihw](#input\_media\_scsihw) | The SCSI controller to emulate. Options: lsi, lsi53c810, megasas, pvscsi, virtio-scsi-pci, virtio-scsi-single. | `string` | n/a | yes | +| [media\_sockets](#input\_media\_sockets) | The number of CPU sockets to allocate to the VM. | `int` | n/a | yes | +| [media\_tablet](#input\_media\_tablet) | Enable/disable the USB tablet device. This device is usually needed to allow absolute mouse positioning with VNC. | `bool` | n/a | yes | +| [media\_target\_node](#input\_media\_target\_node) | The name of the Proxmox Node on which to place the VM. | `string` | n/a | yes | +| [media\_vm\_state](#input\_media\_vm\_state) | The desired state of the VM, options are running, stopped and started. Do note that started will only start the vm on creation and won't fully manage the power state unlike running and stopped do. | `string` | n/a | yes | +| [veeam\_automatic\_reboot](#input\_veeam\_automatic\_reboot) | Automatically reboot the VM when parameter changes require this. If disabled the provider will emit a warning when the VM needs to be rebooted. | `bool` | n/a | yes | +| [veeam\_bios](#input\_veeam\_bios) | The BIOS to use, options are seabios or ovmf for UEFI | `string` | n/a | yes | +| [veeam\_boot](#input\_veeam\_boot) | The boot order for the VM. For example: order=scsi0;ide2;net0 | `string` | n/a | yes | +| [veeam\_bridge](#input\_veeam\_bridge) | Bridge to which the network device should be attached. The Proxmox VE standard bridge is called vmbr0. | `string` | n/a | yes | +| [veeam\_cores](#input\_veeam\_cores) | The number of CPU cores per CPU socket to allocate to the VM. | `int` | n/a | yes | +| [veeam\_cpu](#input\_veeam\_cpu) | The type of CPU to emulate in the Guest | `string` | n/a | yes | +| [veeam\_desc](#input\_veeam\_desc) | The description of the VM. Shows as the 'Notes' field in the Proxmox GUI | `string` | n/a | yes | +| [veeam\_disk\_size](#input\_veeam\_disk\_size) | The size of the created disk. Accepts K for kibibytes, M for mebibytes, G for gibibytes, T for tibibytes. When only a number is provided gibibytes is assumed. Required when type=disk and passthrough=false, Computed when type=disk and passthrough=true. | `string` | n/a | yes | +| [veeam\_disk\_storage](#input\_veeam\_disk\_storage) | Required when type=disk and passthrough=false. The name of the storage pool on which to store the disk. | `string` | n/a | yes | +| [veeam\_efi\_storage](#input\_veeam\_efi\_storage) | The name of the storage pool on which to store the disk. | `string` | n/a | yes | +| [veeam\_efitype](#input\_veeam\_efitype) | The type of efi disk device to add. Options: 2m, 4m | `string` | n/a | yes | +| [veeam\_force\_create](#input\_veeam\_force\_create) | If false, and a vm of the same name, on the same node exists, terraform will attempt to reconfigure that VM with these settings. Set to true to always create a new VM (note, the name of the VM must still be unique, otherwise an error will be produced.) | `bool` | n/a | yes | +| [veeam\_hotplug](#input\_veeam\_hotplug) | Comma delimited list of hotplug features to enable. Options: network, disk, cpu, memory, usb. Set to 0 to disable hotplug. | `string` | n/a | yes | +| [veeam\_memory](#input\_veeam\_memory) | The amount of memory to allocate to the VM in Megabytes. | `int` | n/a | yes | +| [veeam\_model](#input\_veeam\_model) | Network Card Model. The virtio model provides the best performance with very low CPU overhead. If your guest does not support this driver, it is usually best to use e1000. Options: e1000, e1000-82540em, e1000-82544gc, e1000-82545em, i82551, i82557b, i82559er, ne2k\_isa, ne2k\_pci, pcnet, rtl8139, virtio, vmxnet3. | `string` | n/a | yes | +| [veeam\_name](#input\_veeam\_name) | The name of the VM within Proxmox | `string` | n/a | yes | +| [veeam\_onboot](#input\_veeam\_onboot) | Whether to have the VM startup after the PVE node starts. | `bool` | n/a | yes | +| [veeam\_os\_type](#input\_veeam\_os\_type) | Which provisioning method to use, based on the OS type. Options: ubuntu, centos, cloud-init. | `string` | n/a | yes | +| [veeam\_protection](#input\_veeam\_protection) | Enable/disable the VM protection from being removed. The default value of false indicates the VM is removable. | `bool` | n/a | yes | +| [veeam\_qemu\_os](#input\_veeam\_qemu\_os) | The type of OS in the guest. Set properly to allow Proxmox to enable optimizations for the appropriate guest OS. It takes the value from the source template and ignore any changes to resource configuration parameter. | `string` | n/a | yes | +| [veeam\_scsihw](#input\_veeam\_scsihw) | The SCSI controller to emulate. Options: lsi, lsi53c810, megasas, pvscsi, virtio-scsi-pci, virtio-scsi-single. | `string` | n/a | yes | +| [veeam\_sockets](#input\_veeam\_sockets) | The number of CPU sockets to allocate to the VM. | `int` | n/a | yes | +| [veeam\_tablet](#input\_veeam\_tablet) | Enable/disable the USB tablet device. This device is usually needed to allow absolute mouse positioning with VNC. | `bool` | n/a | yes | +| [veeam\_target\_node](#input\_veeam\_target\_node) | The name of the Proxmox Node on which to place the VM. | `string` | n/a | yes | +| [veeam\_vm\_state](#input\_veeam\_vm\_state) | The desired state of the VM, options are running, stopped and started. Do note that started will only start the vm on creation and won't fully manage the power state unlike running and stopped do. | `string` | n/a | yes | ## Outputs diff --git a/production/host_01/providers.tf b/production/host_01/providers.tf index 73e5d93..0639b08 100644 --- a/production/host_01/providers.tf +++ b/production/host_01/providers.tf @@ -18,7 +18,7 @@ terraform { } provider "proxmox" { - pm_api_url = "https://prod-host-01.binarybraids.com:8006/api2/json" - pm_user = "terraform@pve" + pm_api_url = "https://prod-host-01.binarybraids.com:8006/api2/json" + pm_user = "terraform@pve" pm_password = "#{PROD_01_HOST_TERRAFORM_PASSWORD}#" } \ No newline at end of file diff --git a/production/host_01/terraform.tfvars b/production/host_01/terraform.tfvars index cd99bae..27f2fbf 100644 --- a/production/host_01/terraform.tfvars +++ b/production/host_01/terraform.tfvars @@ -1,51 +1,51 @@ #Domain Controller -dc01_name = "vm-prod-dc-01" -dc01_desc = "Domain Controller" -dc01_automatic_reboot = true -dc01_bios = "ovmf" -dc01_boot = "order=sata0;sata1" -dc01_cores = 1 -dc01_sockets = 2 -dc01_cpu = "host" -dc01_force_create = false -dc01_hotplug = "disk,network,usb" -dc01_memory = 2048 -dc01_onboot = true -dc01_vm_state = "running" -dc01_os_type = "Microsoft Windows 11/2022/2025" -dc01_qemu_os = "l26" -dc01_scsihw = "lsi" -dc01_protection = false -dc01_tablet = true -dc01_target_node = "prod-host-01.binarybraids.com" -dc01_efitype = "4m" -dc01_efi_storage = "VM-240GB-SSD" -dc01_disk_size = "75G" -dc01_disk_storage = "VM-240GB-SSD" -dc01_bridge = "vmbr0" -dc01_model = "virtio" +dc01_name = "vm-prod-dc-01" +dc01_desc = "Domain Controller" +dc01_automatic_reboot = true +dc01_bios = "ovmf" +dc01_boot = "order=sata0;sata1" +dc01_cores = 1 +dc01_sockets = 2 +dc01_cpu = "host" +dc01_force_create = false +dc01_hotplug = "disk,network,usb" +dc01_memory = 2048 +dc01_onboot = true +dc01_vm_state = "running" +dc01_os_type = "Microsoft Windows 11/2022/2025" +dc01_qemu_os = "l26" +dc01_scsihw = "lsi" +dc01_protection = false +dc01_tablet = true +dc01_target_node = "prod-host-01.binarybraids.com" +dc01_efitype = "4m" +dc01_efi_storage = "VM-240GB-SSD" +dc01_disk_size = "75G" +dc01_disk_storage = "VM-240GB-SSD" +dc01_bridge = "vmbr0" +dc01_model = "virtio" # File Server -media_name = "vm-prod-fs-01" -media_desc = "File Server" -media_automatic_reboot = true -media_bios = "seabios" -media_boot = "order=sata0" -media_cores = 2 -media_sockets = 2 -media_cpu = "host" -media_force_create = false -media_hotplug = "disk,network,usb" -media_memory = 1024 -media_onboot = true -media_vm_state = "running" -media_os_type = "Linux 6.x - 2.6 Kernel" -media_qemu_os = "l26" -media_scsihw = "lsi" -media_protection = false -media_tablet = true -media_target_node = "prod-host-01.binarybraids.com" -media_disk_size = "20G" -media_disk_storage = "VM-240GB-SSD" -media_bridge = "vmbr0" -media_model = "virtio" \ No newline at end of file +media_name = "vm-prod-fs-01" +media_desc = "File Server" +media_automatic_reboot = true +media_bios = "seabios" +media_boot = "order=sata0" +media_cores = 2 +media_sockets = 2 +media_cpu = "host" +media_force_create = false +media_hotplug = "disk,network,usb" +media_memory = 1024 +media_onboot = true +media_vm_state = "running" +media_os_type = "Linux 6.x - 2.6 Kernel" +media_qemu_os = "l26" +media_scsihw = "lsi" +media_protection = false +media_tablet = true +media_target_node = "prod-host-01.binarybraids.com" +media_disk_size = "20G" +media_disk_storage = "VM-240GB-SSD" +media_bridge = "vmbr0" +media_model = "virtio" \ No newline at end of file diff --git a/production/host_01/virtual_machines.tf b/production/host_01/virtual_machines.tf index 2270635..65b7bfb 100644 --- a/production/host_01/virtual_machines.tf +++ b/production/host_01/virtual_machines.tf @@ -2,25 +2,25 @@ ## Domain Controller resource "proxmox_vm_qemu" "dc01" { - name = var.dc01_name - desc = var.dc01_desc - automatic_reboot = var.dc01_automatic_reboot - bios = var.dc01_bios - boot = var.dc01_boot - cores = var.dc01_cores - sockets = var.dc01_sockets - cpu = var.dc01_cpu - force_create = var.dc01_force_create - hotplug = var.dc01_hotplug - memory = var.dc01_memory - onboot = var.dc01_onboot - vm_state = var.dc01_vm_state - os_type = var.dc01_os_type - qemu_os = var.dc01_qemu_os - scsihw = var.dc01_scsihw - protection = var.dc01_protection - tablet = var.dc01_tablet - target_node = var.dc01_target_node + name = var.dc01_name + desc = var.dc01_desc + automatic_reboot = var.dc01_automatic_reboot + bios = var.dc01_bios + boot = var.dc01_boot + cores = var.dc01_cores + sockets = var.dc01_sockets + cpu = var.dc01_cpu + force_create = var.dc01_force_create + hotplug = var.dc01_hotplug + memory = var.dc01_memory + onboot = var.dc01_onboot + vm_state = var.dc01_vm_state + os_type = var.dc01_os_type + qemu_os = var.dc01_qemu_os + scsihw = var.dc01_scsihw + protection = var.dc01_protection + tablet = var.dc01_tablet + target_node = var.dc01_target_node efidisk { efitype = var.dc01_efitype @@ -31,60 +31,60 @@ resource "proxmox_vm_qemu" "dc01" { sata { sata0 { disk { - size = var.dc01_disk_size - storage = var.dc01_disk_storage + size = var.dc01_disk_size + storage = var.dc01_disk_storage } } } } network { - bridge = var.dc01_bridge - model = var.dc01_model + bridge = var.dc01_bridge + model = var.dc01_model } } # Media Server resource "proxmox_vm_qemu" "media" { - name = var.media_name - desc = var.media_desc - automatic_reboot = var.media_automatic_reboot - bios = var.media_bios - boot = var.media_boot - cores = var.media_cores - sockets = var.media_sockets - cpu = var.media_cpu - force_create = var.media_force_create - hotplug = var.media_hotplug - memory = var.media_memory - onboot = var.media_onboot - vm_state = var.media_vm_state - os_type = var.media_os_type - qemu_os = var.media_qemu_os - scsihw = var.media_scsihw - protection = var.media_protection - tablet = var.media_tablet - target_node = var.media_target_node + name = var.media_name + desc = var.media_desc + automatic_reboot = var.media_automatic_reboot + bios = var.media_bios + boot = var.media_boot + cores = var.media_cores + sockets = var.media_sockets + cpu = var.media_cpu + force_create = var.media_force_create + hotplug = var.media_hotplug + memory = var.media_memory + onboot = var.media_onboot + vm_state = var.media_vm_state + os_type = var.media_os_type + qemu_os = var.media_qemu_os + scsihw = var.media_scsihw + protection = var.media_protection + tablet = var.media_tablet + target_node = var.media_target_node disks { sata { sata0 { disk { - backup = var.media_disk_backup - cache = var.media_disk_cache - discard = var.media_disk_discard - emulatessd = var.media_disk_emulatessd - size = var.media_disk_size - storage = var.media_disk_storage + backup = var.media_disk_backup + cache = var.media_disk_cache + discard = var.media_disk_discard + emulatessd = var.media_disk_emulatessd + size = var.media_disk_size + storage = var.media_disk_storage } } } } network { - bridge = var.media_bridge - firewall = var.media_firewall - model = var.media_model + bridge = var.media_bridge + firewall = var.media_firewall + model = var.media_model } } diff --git a/production/host_02/README.md b/production/host_02/README.md index 574fe33..c249970 100644 --- a/production/host_02/README.md +++ b/production/host_02/README.md @@ -4,13 +4,14 @@ | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.6.0 | -| [esxi](#requirement\_esxi) | 1.10.3 | +| [proxmx](#requirement\_proxmx) | 3.0.1-rc4 | ## Providers | Name | Version | |------|---------| | [esxi](#provider\_esxi) | 1.10.3 | +| [proxmox](#provider\_proxmox) | n/a | ## Modules @@ -20,62 +21,66 @@ No modules. | Name | Type | |------|------| -| esxi_guest.ansible | resource | -| esxi_guest.ca | resource | -| esxi_guest.dc02 | resource | -| esxi_guest.docker | resource | -| esxi_portgroup.production | resource | -| esxi_vswitch.production | resource | +| [esxi_portgroup.production](https://registry.terraform.io/providers/hashicorp/esxi/latest/docs/resources/portgroup) | resource | +| [esxi_vswitch.production](https://registry.terraform.io/providers/hashicorp/esxi/latest/docs/resources/vswitch) | resource | +| [proxmox_vm_qemu.dc01](https://registry.terraform.io/providers/hashicorp/proxmox/latest/docs/resources/vm_qemu) | resource | +| [proxmox_vm_qemu.docker](https://registry.terraform.io/providers/hashicorp/proxmox/latest/docs/resources/vm_qemu) | resource | +| [proxmox_vm_qemu.veeam](https://registry.terraform.io/providers/hashicorp/proxmox/latest/docs/resources/vm_qemu) | resource | ## Inputs | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [ansible\_boot\_firmware](#input\_ansible\_boot\_firmware) | The firmware type for the guest VM | `string` | n/a | yes | -| [ansible\_disk\_store](#input\_ansible\_disk\_store) | The name of the data store where the guest VM will be created | `string` | n/a | yes | -| [ansible\_guest\_name](#input\_ansible\_guest\_name) | The name of the guest VM | `string` | n/a | yes | -| [ansible\_memsize](#input\_ansible\_memsize) | The amount of memory to allocate the guest VM in MB (1024 = 1GB) | `number` | n/a | yes | -| [ansible\_nic\_type](#input\_ansible\_nic\_type) | The type for the network interface | `string` | n/a | yes | -| [ansible\_notes](#input\_ansible\_notes) | Annotated notes to add to the guest VM | `string` | n/a | yes | -| [ansible\_numvcpus](#input\_ansible\_numvcpus) | The number of vCPUs to allocate to the guest VM | `number` | n/a | yes | -| [ansible\_power](#input\_ansible\_power) | Set the guest VM Power state | `string` | n/a | yes | -| [ansible\_resource\_pool\_name](#input\_ansible\_resource\_pool\_name) | The name of the Resource Pool for the guest VM | `string` | n/a | yes | -| [ansible\_virthwver](#input\_ansible\_virthwver) | The hardware version of the guest VM | `number` | n/a | yes | -| [ansible\_virtual\_network](#input\_ansible\_virtual\_network) | The virtual network for the network interface | `string` | n/a | yes | -| [ca\_boot\_firmware](#input\_ca\_boot\_firmware) | The firmware type for the guest VM | `string` | n/a | yes | -| [ca\_disk\_store](#input\_ca\_disk\_store) | The name of the data store where the guest VM will be created | `string` | n/a | yes | -| [ca\_guest\_name](#input\_ca\_guest\_name) | The name of the guest VM | `string` | n/a | yes | -| [ca\_memsize](#input\_ca\_memsize) | The amount of memory to allocate the guest VM in MB (1024 = 1GB) | `number` | n/a | yes | -| [ca\_nic\_type](#input\_ca\_nic\_type) | The type for the network interface | `string` | n/a | yes | -| [ca\_notes](#input\_ca\_notes) | Annotated notes to add to the guest VM | `string` | n/a | yes | -| [ca\_numvcpus](#input\_ca\_numvcpus) | The number of vCPUs to allocate to the guest VM | `number` | n/a | yes | -| [ca\_power](#input\_ca\_power) | Set the guest VM Power state | `string` | n/a | yes | -| [ca\_resource\_pool\_name](#input\_ca\_resource\_pool\_name) | The name of the Resource Pool for the guest VM | `string` | n/a | yes | -| [ca\_virthwver](#input\_ca\_virthwver) | The hardware version of the guest VM | `number` | n/a | yes | -| [ca\_virtual\_network](#input\_ca\_virtual\_network) | The virtual network for the network interface | `string` | n/a | yes | -| [dc02\_boot\_firmware](#input\_dc02\_boot\_firmware) | The firmware type for the guest VM | `string` | n/a | yes | -| [dc02\_disk\_store](#input\_dc02\_disk\_store) | The name of the data store where the guest VM will be created | `string` | n/a | yes | -| [dc02\_guest\_name](#input\_dc02\_guest\_name) | The name of the guest VM | `string` | n/a | yes | -| [dc02\_memsize](#input\_dc02\_memsize) | The amount of memory to allocate the guest VM in MB (1024 = 1GB) | `number` | n/a | yes | -| [dc02\_nic\_type](#input\_dc02\_nic\_type) | The type for the network interface | `string` | n/a | yes | -| [dc02\_notes](#input\_dc02\_notes) | Annotated notes to add to the guest VM | `string` | n/a | yes | -| [dc02\_numvcpus](#input\_dc02\_numvcpus) | The number of vCPUs to allocate to the guest VM | `number` | n/a | yes | -| [dc02\_power](#input\_dc02\_power) | Set the guest VM Power state | `string` | n/a | yes | -| [dc02\_resource\_pool\_name](#input\_dc02\_resource\_pool\_name) | The name of the Resource Pool for the guest VM | `string` | n/a | yes | -| [dc02\_virthwver](#input\_dc02\_virthwver) | The hardware version of the guest VM | `number` | n/a | yes | -| [dc02\_virtual\_network](#input\_dc02\_virtual\_network) | The virtual network for the network interface | `string` | n/a | yes | -| [docker\_boot\_firmware](#input\_docker\_boot\_firmware) | The firmware type for the guest VM | `string` | n/a | yes | -| [docker\_clone\_from\_vm](#input\_docker\_clone\_from\_vm) | The source VM to clone | `string` | n/a | yes | -| [docker\_disk\_store](#input\_docker\_disk\_store) | The name of the data store where the guest VM will be created | `string` | n/a | yes | -| [docker\_guest\_name](#input\_docker\_guest\_name) | The name of the guest VM | `string` | n/a | yes | -| [docker\_memsize](#input\_docker\_memsize) | The amount of memory to allocate the guest VM in MB (1024 = 1GB) | `number` | n/a | yes | -| [docker\_nic\_type](#input\_docker\_nic\_type) | The type for the network interface | `string` | n/a | yes | -| [docker\_notes](#input\_docker\_notes) | Annotated notes to add to the guest VM | `string` | n/a | yes | -| [docker\_numvcpus](#input\_docker\_numvcpus) | The number of vCPUs to allocate to the guest VM | `number` | n/a | yes | -| [docker\_power](#input\_docker\_power) | Set the guest VM Power state | `string` | n/a | yes | -| [docker\_resource\_pool\_name](#input\_docker\_resource\_pool\_name) | The name of the Resource Pool for the guest VM | `string` | n/a | yes | -| [docker\_virthwver](#input\_docker\_virthwver) | The hardware version of the guest VM | `number` | n/a | yes | -| [docker\_virtual\_network](#input\_docker\_virtual\_network) | The virtual network for the network interface | `string` | n/a | yes | +| [dc02\_automatic\_reboot](#input\_dc02\_automatic\_reboot) | Automatically reboot the VM when parameter changes require this. If disabled the provider will emit a warning when the VM needs to be rebooted. | `bool` | n/a | yes | +| [dc02\_bios](#input\_dc02\_bios) | The BIOS to use, options are seabios or ovmf for UEFI | `string` | n/a | yes | +| [dc02\_boot](#input\_dc02\_boot) | The boot order for the VM. For example: order=scsi0;ide2;net0 | `string` | n/a | yes | +| [dc02\_bridge](#input\_dc02\_bridge) | Bridge to which the network device should be attached. The Proxmox VE standard bridge is called vmbr0. | `string` | n/a | yes | +| [dc02\_cores](#input\_dc02\_cores) | The number of CPU cores per CPU socket to allocate to the VM. | `int` | n/a | yes | +| [dc02\_cpu](#input\_dc02\_cpu) | The type of CPU to emulate in the Guest | `string` | n/a | yes | +| [dc02\_desc](#input\_dc02\_desc) | The description of the VM. Shows as the 'Notes' field in the Proxmox GUI | `string` | n/a | yes | +| [dc02\_disk\_size](#input\_dc02\_disk\_size) | The size of the created disk. Accepts K for kibibytes, M for mebibytes, G for gibibytes, T for tibibytes. When only a number is provided gibibytes is assumed. Required when type=disk and passthrough=false, Computed when type=disk and passthrough=true. | `string` | n/a | yes | +| [dc02\_disk\_storage](#input\_dc02\_disk\_storage) | Required when type=disk and passthrough=false. The name of the storage pool on which to store the disk. | `string` | n/a | yes | +| [dc02\_efi\_storage](#input\_dc02\_efi\_storage) | The name of the storage pool on which to store the disk. | `string` | n/a | yes | +| [dc02\_efitype](#input\_dc02\_efitype) | The type of efi disk device to add. Options: 2m, 4m | `string` | n/a | yes | +| [dc02\_force\_create](#input\_dc02\_force\_create) | If false, and a vm of the same name, on the same node exists, terraform will attempt to reconfigure that VM with these settings. Set to true to always create a new VM (note, the name of the VM must still be unique, otherwise an error will be produced.) | `bool` | n/a | yes | +| [dc02\_hotplug](#input\_dc02\_hotplug) | Comma delimited list of hotplug features to enable. Options: network, disk, cpu, memory, usb. Set to 0 to disable hotplug. | `string` | n/a | yes | +| [dc02\_memory](#input\_dc02\_memory) | The amount of memory to allocate to the VM in Megabytes. | `int` | n/a | yes | +| [dc02\_model](#input\_dc02\_model) | Network Card Model. The virtio model provides the best performance with very low CPU overhead. If your guest does not support this driver, it is usually best to use e1000. Options: e1000, e1000-82540em, e1000-82544gc, e1000-82545em, i82551, i82557b, i82559er, ne2k\_isa, ne2k\_pci, pcnet, rtl8139, virtio, vmxnet3. | `string` | n/a | yes | +| [dc02\_name](#input\_dc02\_name) | The name of the VM within Proxmox | `string` | n/a | yes | +| [dc02\_onboot](#input\_dc02\_onboot) | Whether to have the VM startup after the PVE node starts. | `bool` | n/a | yes | +| [dc02\_os\_type](#input\_dc02\_os\_type) | Which provisioning method to use, based on the OS type. Options: ubuntu, centos, cloud-init. | `string` | n/a | yes | +| [dc02\_protection](#input\_dc02\_protection) | Enable/disable the VM protection from being removed. The default value of false indicates the VM is removable. | `bool` | n/a | yes | +| [dc02\_qemu\_os](#input\_dc02\_qemu\_os) | The type of OS in the guest. Set properly to allow Proxmox to enable optimizations for the appropriate guest OS. It takes the value from the source template and ignore any changes to resource configuration parameter. | `string` | n/a | yes | +| [dc02\_scsihw](#input\_dc02\_scsihw) | The SCSI controller to emulate. Options: lsi, lsi53c810, megasas, pvscsi, virtio-scsi-pci, virtio-scsi-single. | `string` | n/a | yes | +| [dc02\_sockets](#input\_dc02\_sockets) | The number of CPU sockets to allocate to the VM. | `int` | n/a | yes | +| [dc02\_tablet](#input\_dc02\_tablet) | Enable/disable the USB tablet device. This device is usually needed to allow absolute mouse positioning with VNC. | `bool` | n/a | yes | +| [dc02\_target\_node](#input\_dc02\_target\_node) | The name of the Proxmox Node on which to place the VM. | `string` | n/a | yes | +| [dc02\_vm\_state](#input\_dc02\_vm\_state) | The desired state of the VM, options are running, stopped and started. Do note that started will only start the vm on creation and won't fully manage the power state unlike running and stopped do. | `string` | n/a | yes | +| [docker\_automatic\_reboot](#input\_docker\_automatic\_reboot) | Automatically reboot the VM when parameter changes require this. If disabled the provider will emit a warning when the VM needs to be rebooted. | `bool` | n/a | yes | +| [docker\_bios](#input\_docker\_bios) | The BIOS to use, options are seabios or ovmf for UEFI | `string` | n/a | yes | +| [docker\_boot](#input\_docker\_boot) | The boot order for the VM. For example: order=scsi0;ide2;net0 | `string` | n/a | yes | +| [docker\_bridge](#input\_docker\_bridge) | Bridge to which the network device should be attached. The Proxmox VE standard bridge is called vmbr0. | `string` | n/a | yes | +| [docker\_cores](#input\_docker\_cores) | The number of CPU cores per CPU socket to allocate to the VM. | `int` | n/a | yes | +| [docker\_cpu](#input\_docker\_cpu) | The type of CPU to emulate in the Guest | `string` | n/a | yes | +| [docker\_desc](#input\_docker\_desc) | The description of the VM. Shows as the 'Notes' field in the Proxmox GUI | `string` | n/a | yes | +| [docker\_disk\_size](#input\_docker\_disk\_size) | The size of the created disk. Accepts K for kibibytes, M for mebibytes, G for gibibytes, T for tibibytes. When only a number is provided gibibytes is assumed. Required when type=disk and passthrough=false, Computed when type=disk and passthrough=true. | `string` | n/a | yes | +| [docker\_disk\_storage](#input\_docker\_disk\_storage) | Required when type=disk and passthrough=false. The name of the storage pool on which to store the disk. | `string` | n/a | yes | +| [docker\_efi\_storage](#input\_docker\_efi\_storage) | The name of the storage pool on which to store the disk. | `string` | n/a | yes | +| [docker\_efitype](#input\_docker\_efitype) | The type of efi disk device to add. Options: 2m, 4m | `string` | n/a | yes | +| [docker\_force\_create](#input\_docker\_force\_create) | If false, and a vm of the same name, on the same node exists, terraform will attempt to reconfigure that VM with these settings. Set to true to always create a new VM (note, the name of the VM must still be unique, otherwise an error will be produced.) | `bool` | n/a | yes | +| [docker\_hotplug](#input\_docker\_hotplug) | Comma delimited list of hotplug features to enable. Options: network, disk, cpu, memory, usb. Set to 0 to disable hotplug. | `string` | n/a | yes | +| [docker\_memory](#input\_docker\_memory) | The amount of memory to allocate to the VM in Megabytes. | `int` | n/a | yes | +| [docker\_model](#input\_docker\_model) | Network Card Model. The virtio model provides the best performance with very low CPU overhead. If your guest does not support this driver, it is usually best to use e1000. Options: e1000, e1000-82540em, e1000-82544gc, e1000-82545em, i82551, i82557b, i82559er, ne2k\_isa, ne2k\_pci, pcnet, rtl8139, virtio, vmxnet3. | `string` | n/a | yes | +| [docker\_name](#input\_docker\_name) | The name of the VM within Proxmox | `string` | n/a | yes | +| [docker\_onboot](#input\_docker\_onboot) | Whether to have the VM startup after the PVE node starts. | `bool` | n/a | yes | +| [docker\_os\_type](#input\_docker\_os\_type) | Which provisioning method to use, based on the OS type. Options: ubuntu, centos, cloud-init. | `string` | n/a | yes | +| [docker\_protection](#input\_docker\_protection) | Enable/disable the VM protection from being removed. The default value of false indicates the VM is removable. | `bool` | n/a | yes | +| [docker\_qemu\_os](#input\_docker\_qemu\_os) | The type of OS in the guest. Set properly to allow Proxmox to enable optimizations for the appropriate guest OS. It takes the value from the source template and ignore any changes to resource configuration parameter. | `string` | n/a | yes | +| [docker\_scsihw](#input\_docker\_scsihw) | The SCSI controller to emulate. Options: lsi, lsi53c810, megasas, pvscsi, virtio-scsi-pci, virtio-scsi-single. | `string` | n/a | yes | +| [docker\_sockets](#input\_docker\_sockets) | The number of CPU sockets to allocate to the VM. | `int` | n/a | yes | +| [docker\_tablet](#input\_docker\_tablet) | Enable/disable the USB tablet device. This device is usually needed to allow absolute mouse positioning with VNC. | `bool` | n/a | yes | +| [docker\_target\_node](#input\_docker\_target\_node) | The name of the Proxmox Node on which to place the VM. | `string` | n/a | yes | +| [docker\_vm\_state](#input\_docker\_vm\_state) | The desired state of the VM, options are running, stopped and started. Do note that started will only start the vm on creation and won't fully manage the power state unlike running and stopped do. | `string` | n/a | yes | | [esxi\_hostname](#input\_esxi\_hostname) | hostname for ESXI host | `string` | n/a | yes | | [esxi\_hostport](#input\_esxi\_hostport) | SSH port for ESXI host | `string` | n/a | yes | | [esxi\_hostssl](#input\_esxi\_hostssl) | SSL port for ESXI host | `string` | n/a | yes | @@ -84,6 +89,31 @@ No modules. | [port\_group\_name](#input\_port\_group\_name) | The name of the Port Group | `string` | n/a | yes | | [port\_group\_vlan](#input\_port\_group\_vlan) | The VLAN ID for the Port Group | `number` | n/a | yes | | [uplink\_name](#input\_uplink\_name) | The name of the vSwitch uplink | `string` | n/a | yes | +| [veeam\_automatic\_reboot](#input\_veeam\_automatic\_reboot) | Automatically reboot the VM when parameter changes require this. If disabled the provider will emit a warning when the VM needs to be rebooted. | `bool` | n/a | yes | +| [veeam\_bios](#input\_veeam\_bios) | The BIOS to use, options are seabios or ovmf for UEFI | `string` | n/a | yes | +| [veeam\_boot](#input\_veeam\_boot) | The boot order for the VM. For example: order=scsi0;ide2;net0 | `string` | n/a | yes | +| [veeam\_bridge](#input\_veeam\_bridge) | Bridge to which the network device should be attached. The Proxmox VE standard bridge is called vmbr0. | `string` | n/a | yes | +| [veeam\_cores](#input\_veeam\_cores) | The number of CPU cores per CPU socket to allocate to the VM. | `int` | n/a | yes | +| [veeam\_cpu](#input\_veeam\_cpu) | The type of CPU to emulate in the Guest | `string` | n/a | yes | +| [veeam\_desc](#input\_veeam\_desc) | The description of the VM. Shows as the 'Notes' field in the Proxmox GUI | `string` | n/a | yes | +| [veeam\_disk\_size](#input\_veeam\_disk\_size) | The size of the created disk. Accepts K for kibibytes, M for mebibytes, G for gibibytes, T for tibibytes. When only a number is provided gibibytes is assumed. Required when type=disk and passthrough=false, Computed when type=disk and passthrough=true. | `string` | n/a | yes | +| [veeam\_disk\_storage](#input\_veeam\_disk\_storage) | Required when type=disk and passthrough=false. The name of the storage pool on which to store the disk. | `string` | n/a | yes | +| [veeam\_efi\_storage](#input\_veeam\_efi\_storage) | The name of the storage pool on which to store the disk. | `string` | n/a | yes | +| [veeam\_efitype](#input\_veeam\_efitype) | The type of efi disk device to add. Options: 2m, 4m | `string` | n/a | yes | +| [veeam\_force\_create](#input\_veeam\_force\_create) | If false, and a vm of the same name, on the same node exists, terraform will attempt to reconfigure that VM with these settings. Set to true to always create a new VM (note, the name of the VM must still be unique, otherwise an error will be produced.) | `bool` | n/a | yes | +| [veeam\_hotplug](#input\_veeam\_hotplug) | Comma delimited list of hotplug features to enable. Options: network, disk, cpu, memory, usb. Set to 0 to disable hotplug. | `string` | n/a | yes | +| [veeam\_memory](#input\_veeam\_memory) | The amount of memory to allocate to the VM in Megabytes. | `int` | n/a | yes | +| [veeam\_model](#input\_veeam\_model) | Network Card Model. The virtio model provides the best performance with very low CPU overhead. If your guest does not support this driver, it is usually best to use e1000. Options: e1000, e1000-82540em, e1000-82544gc, e1000-82545em, i82551, i82557b, i82559er, ne2k\_isa, ne2k\_pci, pcnet, rtl8139, virtio, vmxnet3. | `string` | n/a | yes | +| [veeam\_name](#input\_veeam\_name) | The name of the VM within Proxmox | `string` | n/a | yes | +| [veeam\_onboot](#input\_veeam\_onboot) | Whether to have the VM startup after the PVE node starts. | `bool` | n/a | yes | +| [veeam\_os\_type](#input\_veeam\_os\_type) | Which provisioning method to use, based on the OS type. Options: ubuntu, centos, cloud-init. | `string` | n/a | yes | +| [veeam\_protection](#input\_veeam\_protection) | Enable/disable the VM protection from being removed. The default value of false indicates the VM is removable. | `bool` | n/a | yes | +| [veeam\_qemu\_os](#input\_veeam\_qemu\_os) | The type of OS in the guest. Set properly to allow Proxmox to enable optimizations for the appropriate guest OS. It takes the value from the source template and ignore any changes to resource configuration parameter. | `string` | n/a | yes | +| [veeam\_scsihw](#input\_veeam\_scsihw) | The SCSI controller to emulate. Options: lsi, lsi53c810, megasas, pvscsi, virtio-scsi-pci, virtio-scsi-single. | `string` | n/a | yes | +| [veeam\_sockets](#input\_veeam\_sockets) | The number of CPU sockets to allocate to the VM. | `int` | n/a | yes | +| [veeam\_tablet](#input\_veeam\_tablet) | Enable/disable the USB tablet device. This device is usually needed to allow absolute mouse positioning with VNC. | `bool` | n/a | yes | +| [veeam\_target\_node](#input\_veeam\_target\_node) | The name of the Proxmox Node on which to place the VM. | `string` | n/a | yes | +| [veeam\_vm\_state](#input\_veeam\_vm\_state) | The desired state of the VM, options are running, stopped and started. Do note that started will only start the vm on creation and won't fully manage the power state unlike running and stopped do. | `string` | n/a | yes | | [vswitch\_name](#input\_vswitch\_name) | The name of the vSwitch | `string` | n/a | yes | ## Outputs diff --git a/production/host_02/providers.tf b/production/host_02/providers.tf index 35da1fe..2e45f5e 100644 --- a/production/host_02/providers.tf +++ b/production/host_02/providers.tf @@ -18,7 +18,7 @@ terraform { } provider "proxmox" { - pm_api_url = "https://prod-host-02.binarybraids.com:8006/api2/json" - pm_user = "terraform@pve" + pm_api_url = "https://prod-host-02.binarybraids.com:8006/api2/json" + pm_user = "terraform@pve" pm_password = "#{PROD_02_HOST_TERRAFORM_PASSWORD}#" } \ No newline at end of file diff --git a/production/host_02/terraform.tfvars b/production/host_02/terraform.tfvars index 636b57b..f323d12 100644 --- a/production/host_02/terraform.tfvars +++ b/production/host_02/terraform.tfvars @@ -1,80 +1,80 @@ #Domain Controller -dc02_name = "vm-prod-dc-02" -dc02_desc = "Domain Controller" -dc02_automatic_reboot = true -dc02_bios = "ovmf" -dc02_boot = "order=sata0;sata1" -dc02_cores = 1 -dc02_sockets = 2 -dc02_cpu = "host" -dc02_force_create = false -dc02_hotplug = "disk,network,usb" -dc02_memory = 2048 -dc02_onboot = true -dc02_vm_state = "running" -dc02_os_type = "Microsoft Windows 11/2022/2025" -dc02_qemu_os = "l26" -dc02_scsihw = "lsi" -dc02_protection = false -dc02_tablet = true -dc02_target_node = "prod-host-02.binarybraids.com" -dc02_efitype = "4m" -dc02_efi_storage = "VM-240GB-SSD" -dc02_disk_size = "75G" -dc02_disk_storage = "VM-240GB-SSD" -dc02_bridge = "vmbr0" -dc02_model = "virtio" +dc02_name = "vm-prod-dc-02" +dc02_desc = "Domain Controller" +dc02_automatic_reboot = true +dc02_bios = "ovmf" +dc02_boot = "order=sata0;sata1" +dc02_cores = 1 +dc02_sockets = 2 +dc02_cpu = "host" +dc02_force_create = false +dc02_hotplug = "disk,network,usb" +dc02_memory = 2048 +dc02_onboot = true +dc02_vm_state = "running" +dc02_os_type = "Microsoft Windows 11/2022/2025" +dc02_qemu_os = "l26" +dc02_scsihw = "lsi" +dc02_protection = false +dc02_tablet = true +dc02_target_node = "prod-host-02.binarybraids.com" +dc02_efitype = "4m" +dc02_efi_storage = "VM-240GB-SSD" +dc02_disk_size = "75G" +dc02_disk_storage = "VM-240GB-SSD" +dc02_bridge = "vmbr0" +dc02_model = "virtio" # Docker Host -docker_name = "vm-prod-dkr-01" -docker_desc = "Docker Host" -docker_automatic_reboot = true -docker_bios = "ovmf" -docker_boot = "order=sata0;scsi0" -docker_cores = 1 -docker_sockets = 4 -docker_cpu = "host" -docker_force_create = false -docker_hotplug = "disk,network,usb" -docker_memory = 4096 -docker_onboot = true -docker_vm_state = "running" -docker_os_type = "Linux 6.x - 2.6 Kernel" -docker_qemu_os = "l26" -docker_scsihw = "lsi" -docker_protection = false -docker_tablet = true -docker_target_node = "prod-host-02.binarybraids.com" -docker_efitype = "4m" -docker_efi_storage = "VM-240GB-SSD" -docker_disk_size = "40G" -docker_disk_storage = "VM-240GB-SSD" -docker_bridge = "vmbr0" -docker_model = "virtio" +docker_name = "vm-prod-dkr-01" +docker_desc = "Docker Host" +docker_automatic_reboot = true +docker_bios = "ovmf" +docker_boot = "order=sata0;scsi0" +docker_cores = 1 +docker_sockets = 4 +docker_cpu = "host" +docker_force_create = false +docker_hotplug = "disk,network,usb" +docker_memory = 4096 +docker_onboot = true +docker_vm_state = "running" +docker_os_type = "Linux 6.x - 2.6 Kernel" +docker_qemu_os = "l26" +docker_scsihw = "lsi" +docker_protection = false +docker_tablet = true +docker_target_node = "prod-host-02.binarybraids.com" +docker_efitype = "4m" +docker_efi_storage = "VM-240GB-SSD" +docker_disk_size = "40G" +docker_disk_storage = "VM-240GB-SSD" +docker_bridge = "vmbr0" +docker_model = "virtio" #Veeam Server -veeam_name = "vm-prod-bkp-01" -veeam_desc = "Veeam Server" -veeam_automatic_reboot = true -veeam_bios = "ovmf" -veeam_boot = "order=sata0;sata1" -veeam_cores = 1 -veeam_sockets = 3 -veeam_cpu = "host" -veeam_force_create = false -veeam_hotplug = "disk,network,usb" -veeam_memory = 5120 -veeam_onboot = true -veeam_vm_state = "running" -veeam_os_type = "Microsoft Windows 11/2022/2025" -veeam_qemu_os = "l26" -veeam_scsihw = "lsi" -veeam_protection = false -veeam_tablet = true -veeam_target_node = "prod-host-02.binarybraids.com" -veeam_efitype = "4m" -veeam_efi_storage = "VM-240GB-SSD" -veeam_disk_size = "75G" -veeam_disk_storage = "VM-240GB-SSD" -veeam_bridge = "vmbr0" -veeam_model = "virtio" \ No newline at end of file +veeam_name = "vm-prod-bkp-01" +veeam_desc = "Veeam Server" +veeam_automatic_reboot = true +veeam_bios = "ovmf" +veeam_boot = "order=sata0;sata1" +veeam_cores = 1 +veeam_sockets = 3 +veeam_cpu = "host" +veeam_force_create = false +veeam_hotplug = "disk,network,usb" +veeam_memory = 5120 +veeam_onboot = true +veeam_vm_state = "running" +veeam_os_type = "Microsoft Windows 11/2022/2025" +veeam_qemu_os = "l26" +veeam_scsihw = "lsi" +veeam_protection = false +veeam_tablet = true +veeam_target_node = "prod-host-02.binarybraids.com" +veeam_efitype = "4m" +veeam_efi_storage = "VM-240GB-SSD" +veeam_disk_size = "75G" +veeam_disk_storage = "VM-240GB-SSD" +veeam_bridge = "vmbr0" +veeam_model = "virtio" \ No newline at end of file diff --git a/production/host_02/virtual_machines.tf b/production/host_02/virtual_machines.tf index 27f54b4..b651084 100644 --- a/production/host_02/virtual_machines.tf +++ b/production/host_02/virtual_machines.tf @@ -4,25 +4,25 @@ ## Domain Controller resource "proxmox_vm_qemu" "dc01" { - name = var.dc01_name - desc = var.dc01_desc - automatic_reboot = var.dc01_automatic_reboot - bios = var.dc01_bios - boot = var.dc01_boot - cores = var.dc01_cores - sockets = var.dc01_sockets - cpu = var.dc01_cpu - force_create = var.dc01_force_create - hotplug = var.dc01_hotplug - memory = var.dc01_memory - onboot = var.dc01_onboot - vm_state = var.dc01_vm_state - os_type = var.dc01_os_type - qemu_os = var.dc01_qemu_os - scsihw = var.dc01_scsihw - protection = var.dc01_protection - tablet = var.dc01_tablet - target_node = var.dc01_target_node + name = var.dc01_name + desc = var.dc01_desc + automatic_reboot = var.dc01_automatic_reboot + bios = var.dc01_bios + boot = var.dc01_boot + cores = var.dc01_cores + sockets = var.dc01_sockets + cpu = var.dc01_cpu + force_create = var.dc01_force_create + hotplug = var.dc01_hotplug + memory = var.dc01_memory + onboot = var.dc01_onboot + vm_state = var.dc01_vm_state + os_type = var.dc01_os_type + qemu_os = var.dc01_qemu_os + scsihw = var.dc01_scsihw + protection = var.dc01_protection + tablet = var.dc01_tablet + target_node = var.dc01_target_node efidisk { efitype = var.dc01_efitype @@ -33,40 +33,40 @@ resource "proxmox_vm_qemu" "dc01" { sata { sata0 { disk { - size = var.dc01_disk_size - storage = var.dc01_disk_storage + size = var.dc01_disk_size + storage = var.dc01_disk_storage } } } } network { - bridge = var.dc01_bridge - model = var.dc01_model + bridge = var.dc01_bridge + model = var.dc01_model } } ## Veeam Server resource "proxmox_vm_qemu" "veeam" { - name = var.veeam_name - desc = var.veeam_desc - automatic_reboot = var.veeam_automatic_reboot - bios = var.veeam_bios - boot = var.veeam_boot - cores = var.veeam_cores - sockets = var.veeam_sockets - cpu = var.veeam_cpu - force_create = var.veeam_force_create - hotplug = var.veeam_hotplug - memory = var.veeam_memory - onboot = var.veeam_onboot - vm_state = var.veeam_vm_state - os_type = var.veeam_os_type - qemu_os = var.veeam_qemu_os - scsihw = var.veeam_scsihw - protection = var.veeam_protection - tablet = var.veeam_tablet - target_node = var.veeam_target_node + name = var.veeam_name + desc = var.veeam_desc + automatic_reboot = var.veeam_automatic_reboot + bios = var.veeam_bios + boot = var.veeam_boot + cores = var.veeam_cores + sockets = var.veeam_sockets + cpu = var.veeam_cpu + force_create = var.veeam_force_create + hotplug = var.veeam_hotplug + memory = var.veeam_memory + onboot = var.veeam_onboot + vm_state = var.veeam_vm_state + os_type = var.veeam_os_type + qemu_os = var.veeam_qemu_os + scsihw = var.veeam_scsihw + protection = var.veeam_protection + tablet = var.veeam_tablet + target_node = var.veeam_target_node efidisk { efitype = var.veeam_efitype @@ -77,45 +77,45 @@ resource "proxmox_vm_qemu" "veeam" { sata { sata0 { disk { - backup = var.veeam_disk_backup - cache = var.veeam_disk_cache - discard = var.veeam_disk_discard - emulatessd = var.veeam_disk_emulatessd - size = var.veeam_disk_size - storage = var.veeam_disk_storage + backup = var.veeam_disk_backup + cache = var.veeam_disk_cache + discard = var.veeam_disk_discard + emulatessd = var.veeam_disk_emulatessd + size = var.veeam_disk_size + storage = var.veeam_disk_storage } } } } network { - bridge = var.veeam_bridge - firewall = var.veeam_firewall - model = var.veeam_model + bridge = var.veeam_bridge + firewall = var.veeam_firewall + model = var.veeam_model } } # Docker Host resource "proxmox_vm_qemu" "docker" { - name = var.docker_name - desc = var.docker_desc - automatic_reboot = var.docker_automatic_reboot - bios = var.docker_bios - boot = var.docker_boot - cores = var.docker_cores - sockets = var.docker_sockets - cpu = var.docker_cpu - force_create = var.docker_force_create - hotplug = var.docker_hotplug - memory = var.docker_memory - onboot = var.docker_onboot - vm_state = var.docker_vm_state - os_type = var.docker_os_type - qemu_os = var.docker_qemu_os - scsihw = var.docker_scsihw - protection = var.docker_protection - tablet = var.docker_tablet - target_node = var.docker_target_node + name = var.docker_name + desc = var.docker_desc + automatic_reboot = var.docker_automatic_reboot + bios = var.docker_bios + boot = var.docker_boot + cores = var.docker_cores + sockets = var.docker_sockets + cpu = var.docker_cpu + force_create = var.docker_force_create + hotplug = var.docker_hotplug + memory = var.docker_memory + onboot = var.docker_onboot + vm_state = var.docker_vm_state + os_type = var.docker_os_type + qemu_os = var.docker_qemu_os + scsihw = var.docker_scsihw + protection = var.docker_protection + tablet = var.docker_tablet + target_node = var.docker_target_node efidisk { efitype = var.docker_efitype @@ -126,21 +126,21 @@ resource "proxmox_vm_qemu" "docker" { sata { sata0 { disk { - backup = var.docker_disk_backup - cache = var.docker_disk_cache - discard = var.docker_disk_discard - emulatessd = var.docker_disk_emulatessd - size = var.docker_disk_size - storage = var.docker_disk_storage + backup = var.docker_disk_backup + cache = var.docker_disk_cache + discard = var.docker_disk_discard + emulatessd = var.docker_disk_emulatessd + size = var.docker_disk_size + storage = var.docker_disk_storage } } } } network { - bridge = var.docker_bridge - firewall = var.docker_firewall - model = var.docker_model + bridge = var.docker_bridge + firewall = var.docker_firewall + model = var.docker_model } } diff --git a/terraform-docs.tar.gz b/terraform-docs.tar.gz new file mode 100644 index 0000000..45f9b04 Binary files /dev/null and b/terraform-docs.tar.gz differ