diff --git a/esxi_utils/vm/virtualmachine.py b/esxi_utils/vm/virtualmachine.py index c407649..fc84e39 100644 --- a/esxi_utils/vm/virtualmachine.py +++ b/esxi_utils/vm/virtualmachine.py @@ -23,6 +23,7 @@ import ssl import re import os +import datetime if typing.TYPE_CHECKING: from esxi_utils.client import ESXiClient @@ -752,6 +753,20 @@ def powered_off(self) -> bool: """ return self._vim_vm.runtime.powerState == pyVmomi.vim.VirtualMachine.PowerState.poweredOff + @property + def runtimeConnected(self) -> bool: + """ + Whether the VM is currently runtime connected + """ + return str(self._vim_vm.runtime.connectionState).lower() == 'connected' + + @property + def bootTime(self) -> datetime.datetime: + """ + The time the VM was booted + """ + return self._vim_vm.runtime.bootTime + @property def vcpus(self) -> int: """ diff --git a/setup.cfg b/setup.cfg index 5066f8b..ac6cec9 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = esxi-utils -version = 3.22.1 +version = 3.23.0 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