Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(vm): add support for watchdog #1556

Merged
merged 1 commit into from
Sep 30, 2024
Merged

feat(vm): add support for watchdog #1556

merged 1 commit into from
Sep 30, 2024

Conversation

bpg
Copy link
Owner

@bpg bpg commented Sep 30, 2024

Contributor's Note

  • I have added / updated documentation in /docs for any user-facing features or additions.
  • I have added / updated acceptance tests in /fwprovider/tests for any new or updated resources / data sources.
  • I have ran make example to verify that the change works as expected.

Proof of Work

Example of a VM config with default watchdog type:

resource "proxmox_virtual_environment_vm" "test_vm" {
  node_name = "pve"
  name      = "watchdog-test"
  started   = false

  watchdog {
    enabled = true
    action  = "reset"
  }
}
❯ tofu apply -auto-approve

OpenTofu used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  + create

OpenTofu will perform the following actions:

  # proxmox_virtual_environment_vm.test_vm will be created
  + resource "proxmox_virtual_environment_vm" "test_vm" {
      + acpi                    = true
      + bios                    = "seabios"
      + id                      = (known after apply)
      + ipv4_addresses          = (known after apply)
      + ipv6_addresses          = (known after apply)
      + keyboard_layout         = "en-us"
      + mac_addresses           = (known after apply)
      + migrate                 = false
      + name                    = "watchdog-test"
      + network_interface_names = (known after apply)
      + node_name               = "pve"
      + on_boot                 = true
      + protection              = false
      + reboot                  = false
      + scsi_hardware           = "virtio-scsi-pci"
      + started                 = false
      + stop_on_destroy         = false
      + tablet_device           = true
      + template                = false
      + timeout_clone           = 1800
      + timeout_create          = 1800
      + timeout_migrate         = 1800
      + timeout_move_disk       = 1800
      + timeout_reboot          = 1800
      + timeout_shutdown_vm     = 1800
      + timeout_start_vm        = 1800
      + timeout_stop_vm         = 300
      + vm_id                   = (known after apply)

      + watchdog {
          + action  = "reset"
          + enabled = true
          + model   = "i6300esb"
        }
    }

Plan: 1 to add, 0 to change, 0 to destroy.
proxmox_virtual_environment_vm.test_vm: Creating...
proxmox_virtual_environment_vm.test_vm: Creation complete after 0s [id=100]

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
root@pve:~# qm config 100
acpi: 1
agent: enabled=0,fstrim_cloned_disks=0,type=virtio
balloon: 0
bios: seabios
boot: order=net0
cores: 1
cpu: cputype=qemu64
cpuunits: 1024
keyboard: en-us
memory: 512
meta: creation-qemu=9.0.2,ctime=1727706507
name: watchdog-test
numa: 0
onboot: 1
ostype: other
protection: 0
scsihw: virtio-scsi-pci
smbios1: uuid=080f7493-0a5e-4ea1-a188-c69db49a6ab3
sockets: 1
tablet: 1
template: 0
vga: memory=16,type=std
vmgenid: 41838675-f047-462e-b8c0-1825d1f81dbb
watchdog: model=i6300esb,action=reset

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Closes #1508

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
Copy link

@mergify mergify bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 LGTM! beep boop

@bpg bpg merged commit d226b59 into main Sep 30, 2024
9 checks passed
@bpg bpg deleted the add-watchdog branch September 30, 2024 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for hardware watchdog timers (watchdog:)
1 participant