0
0
mirror of https://github.com/bpg/terraform-provider-proxmox.git synced 2025-07-02 03:22:59 +00:00
terraform-provider-proxmox/proxmoxtf
Emmanuel Benoît 148a9e0c9c
fix(vm): fixed startup / shutdown behaviour on HA clusters (#508)
* fix(vm): wait for VMs to actually stop when sending a shutdown command

Due to how a Proxmox cluster reacts to a VM shutdown command when
running in HA mode, the VM might still be running when the shutdown API
calls returns. This commit adds a loop that actively waits for the VM's
status to change to "stopped" (while also accounting for the shutdown
timeout) after the call's return.

* chore(refactoring): extracted VM state change wait loop into a separate function

* fix(vm): wait for VMs to actually start after requesting it from the cluster

This commit forces the plugin to wait for a VM to actually run after
requesting it to be started. This avoids problems with Proxmox's High
Availability mode, where a start request may not be immediately honoured
by the cluster.

* fix: linter errors

* fix: use `vmAPI.WaitForVMState`

---------

Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2023-08-20 20:07:37 -04:00
..
datasource feat(core): migrate version datasource to TF plugin framework (#440) 2023-07-29 02:10:02 +00:00
provider feat(core): migrate version datasource to TF plugin framework (#440) 2023-07-29 02:10:02 +00:00
resource fix(vm): fixed startup / shutdown behaviour on HA clusters (#508) 2023-08-20 20:07:37 -04:00
structure chore: cleanup resource validators & utility code (#438) 2023-07-20 19:58:19 -04:00
test chore: cleanup resource validators & utility code (#438) 2023-07-20 19:58:19 -04:00
config.go feat: API client cleanup and refactoring (#323) 2023-05-26 01:32:51 +00:00