diff --git a/changelog.md b/changelog.md index abf55a5..2ab03f8 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,10 @@ This page was created to track changes to versions of Python-ESXi-Utilities (esxi_utils). The changelog was created in v3.22.1 and only changes starting from that version are tracked here. +## 4.0.1 + +- Bugfix for "hard_stop" argument not actually stopping the VM. + ## 4.0.0 - Changes the default method of retrieving VirtualMachine objects from their list diff --git a/esxi_utils/vm/virtualmachine.py b/esxi_utils/vm/virtualmachine.py index bba5e67..62861e3 100644 --- a/esxi_utils/vm/virtualmachine.py +++ b/esxi_utils/vm/virtualmachine.py @@ -1200,7 +1200,9 @@ def power_off(self, idempotent: bool = False, hard_stop: bool = False): elif self.powered_off: return if hard_stop: - self._vim_vm.Stop() + self._vim_vm.TerminateVM() + # Since this is not a task, it is good to wait a bit for the VM to terminate + time.sleep(5) return self._client._wait_for_task(self._vim_vm.PowerOffVM_Task()) diff --git a/setup.cfg b/setup.cfg index 7f7e323..04f2f78 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = esxi-utils -version = 4.0.0 +version = 4.0.1 author = The MITRE Corporation description = A package that provides functions for interacting with an ESXi server and manipulating VMs/OVFs. long_description = file: README.md