[pve-devel] [PATCH esxi-import-tools 1/2] listvms: add check for vCLS test whether vm configuration is present

Daniel Kral d.kral at proxmox.com
Fri Apr 11 17:06:33 CEST 2025


It seems that on older ESXi installations, e.g. ESXi 6.7 [0], there are
virtual machines, which do not expose a config property for some VMs.
Therefore, test whether the config is available before checking if the
current entry is a vCLS VM.

[0] https://forum.proxmox.com/threads/164900/

Signed-off-by: Daniel Kral <d.kral at proxmox.com>
---
 listvms.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/listvms.py b/listvms.py
index 89ddfb2..bd0adcf 100755
--- a/listvms.py
+++ b/listvms.py
@@ -266,9 +266,11 @@ def main():
         data = {}
         for vm in list_vms(connection):
             # drop vCLS machines
-            vCLS = any(cfg.key == "HDCS.agent"
-                       and cfg.value.lower() == "true"
-                       for cfg in vm.config.extraConfig)
+            vCLS = vm.config is not None and any(
+                cfg.key == "HDCS.agent"
+                and cfg.value.lower() == "true"
+                for cfg in vm.config.extraConfig
+            )
             if vCLS:
                 continue
             # drop vms with empty datastore

base-commit: e6f497ea7668e6956ec4461837cf613a0736e684
-- 
2.39.5





More information about the pve-devel mailing list