Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions esxi_utils/vm/virtualmachine.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import ssl
import re
import os
import datetime

if typing.TYPE_CHECKING:
from esxi_utils.client import ESXiClient
Expand Down Expand Up @@ -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:
"""
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading