New Import Wizard Available for Migrating VMware ESXi Based Virtual Machines

I am trying to connect an EXSi host version 8.0.3 in a VMWare cluster. I am connecting directly to the host, but when I try to import it, I get the following error:

create storage failed: Skipping vCLS agent VM: vCLS-4c4c4544-0058-5410-8057-c3c04f485132 'NoneType' object has no attribute 'files' (500)

I am running pve-exsi-import-tools 7.2.4. Looking at the python script, it has been updated to ignore the vCLS items based on this

with connect_to_esxi_host(connection_args) as connection:
data = {}
for vm in list_vms(connection):
# drop vCLS machines
if is_vcls_agent_vm(vm):
print(f"Skipping vCLS agent VM: {vm.name}", file=sys.stderr)
continue
# drop vms with empty datastore
if is_diskless_vm(vm):
print(f"Skipping diskless VM: {vm.name}", file=sys.stderr)
continue
try:
fetch_and_update_vm_data(vm, data)
except Exception as err:
print(
f"Failed to get info for VM {vm.name}: {err}",
file=sys.stderr,
)

json.dump(data, sys.stdout, indent=2, default=json_dump_helper)

I am working on a production environment and can not remove Retreat at this time. Is that the only option I have right now? Proxmox cannot directly access the datastore on the VMware host, as it can not read the LUN.
 
I am trying to connect an EXSi host version 8.0.3 in a VMWare cluster. I am connecting directly to the host, but when I try to import it, I get the following error:

create storage failed: Skipping vCLS agent VM: vCLS-4c4c4544-0058-5410-8057-c3c04f485132 'NoneType' object has no attribute 'files' (500)

I had that error until I ran
apt install --reinstall pve-esxi-import-tools=0.7.2

To roll it back to an older version.
 
Hi sdigeso,

I assume you are running Proxmox VE 8.x -- is this correct?

The fixes for the behaviour you describe have been applied in v 1.0.1 of pve-esxi-import-tools in Proxmox VE 9.x, but have not been backported to Proxmox VE 8.x yet:
Diff:
@@ -142,7 +142,7 @@ def json_dump_helper(obj: Any) -> Any:
     Raises:
         TypeError: If the conversion of the object is not supported.
     """
-    if dataclasses.is_dataclass(obj):
+    if dataclasses.is_dataclass(obj) and not isinstance(obj, type):
         return dataclasses.asdict(obj)
 
     raise TypeError(
@@ -279,14 +279,23 @@ def main():
     with connect_to_esxi_host(connection_args) as connection:
         data = {}
         for vm in list_vms(connection):
-            # drop vCLS machines
-            if is_vcls_agent_vm(vm):
-                print(f"Skipping vCLS agent VM: {vm.name}", file=sys.stderr)
-                continue
-            # drop vms with empty datastore
-            if is_diskless_vm(vm):
-                print(f"Skipping diskless VM: {vm.name}", file=sys.stderr)
+            # If figuring out any of this fails, we just skip...
+            try:
+                # drop vCLS machines
+                if is_vcls_agent_vm(vm):
+                    print(f"Skipping vCLS agent VM: {vm.name}", file=sys.stderr)
+                    continue
+                # drop vms with empty datastore
+                if is_diskless_vm(vm):
+                    print(f"Skipping diskless VM: {vm.name}", file=sys.stderr)
+                    continue
+            except Exception as err:
+                print(
+                    f"Unexpected error trying to look at VM {vm.name}: {err}",
+                    file=sys.stderr,
+                )
                 continue
+
             try:
                 fetch_and_update_vm_data(vm, data)
             except Exception as err:

You could try applying the changes to the script at `/usr/libexec/pve-esxi-import-tools/listvms.py` by moving the checks for vCLS and VMs with empty_datastore into the `try:` section. You'll most likely not need the first change mentioned in the diff, but it won't bother if you apply it too.

If it -- for some reason -- does not help you can easily revert the changes by running `apt install --reinstall pve-esxi-import-tools`.

Downgrading to 0.7.2 will most likely not help in your case, as 0.7.2 can not handle vCLS machines from newer ESXI-8-clusters (as their disks are not stored on datastores anymore, but on the local ESXI filesystem).

I hope this helps.
 
  • Like
Reactions: mariol
Hi sdigeso,

I assume you are running Proxmox VE 8.x -- is this correct?

The fixes for the behaviour you describe have been applied in v 1.0.1 of pve-esxi-import-tools in Proxmox VE 9.x, but have not been backported to Proxmox VE 8.x yet:
Diff:
@@ -142,7 +142,7 @@ def json_dump_helper(obj: Any) -> Any:
     Raises:
         TypeError: If the conversion of the object is not supported.
     """
-    if dataclasses.is_dataclass(obj):
+    if dataclasses.is_dataclass(obj) and not isinstance(obj, type):
         return dataclasses.asdict(obj)
 
     raise TypeError(
@@ -279,14 +279,23 @@ def main():
     with connect_to_esxi_host(connection_args) as connection:
         data = {}
         for vm in list_vms(connection):
-            # drop vCLS machines
-            if is_vcls_agent_vm(vm):
-                print(f"Skipping vCLS agent VM: {vm.name}", file=sys.stderr)
-                continue
-            # drop vms with empty datastore
-            if is_diskless_vm(vm):
-                print(f"Skipping diskless VM: {vm.name}", file=sys.stderr)
+            # If figuring out any of this fails, we just skip...
+            try:
+                # drop vCLS machines
+                if is_vcls_agent_vm(vm):
+                    print(f"Skipping vCLS agent VM: {vm.name}", file=sys.stderr)
+                    continue
+                # drop vms with empty datastore
+                if is_diskless_vm(vm):
+                    print(f"Skipping diskless VM: {vm.name}", file=sys.stderr)
+                    continue
+            except Exception as err:
+                print(
+                    f"Unexpected error trying to look at VM {vm.name}: {err}",
+                    file=sys.stderr,
+                )
                 continue
+
             try:
                 fetch_and_update_vm_data(vm, data)
             except Exception as err:

You could try applying the changes to the script at `/usr/libexec/pve-esxi-import-tools/listvms.py` by moving the checks for vCLS and VMs with empty_datastore into the `try:` section. You'll most likely not need the first change mentioned in the diff, but it won't bother if you apply it too.

If it -- for some reason -- does not help you can easily revert the changes by running `apt install --reinstall pve-esxi-import-tools`.

Downgrading to 0.7.2 will most likely not help in your case, as 0.7.2 can not handle vCLS machines from newer ESXI-8-clusters (as their disks are not stored on datastores anymore, but on the local ESXI filesystem).

I hope this helps.
Daniel,
You are correct. I was running Proxmox 8.4.11. I will update to 9 and test again. Thank you for your response
 
Thanks for this great feature - import VMs from ESXI to PVE.

Backgroud - I have a VM in ESXI 6.7 with Thin provisioned mode hard disk - 1T. The actually VM disk vmdk file is 70G.
Question - When I import the VM via PVE 8.4 WebGUI, seems it import 1T data from ESXI to PVE, it take a lot of time. Does this is an expected behavior?
Any solution to impor the actually VM size - 70G?
 
Does your PVE storage support thin provisioning?
Did you check the size of the disk after import?

For our migrations we had long migrations time, but the end result were always correctly thin provisioned. IDK if this is an error in the ESXi API or the handling on PVE's side, but it works - as long as your PVE storage supports thin provisioning.

You can use clonezilla to speed up the migrations.
 
Does your PVE storage support thin provisioning?
Did you check the size of the disk after import?

For our migrations we had long migrations time, but the end result were always correctly thin provisioned. IDK if this is an error in the ESXi API or the handling on PVE's side, but it works - as long as your PVE storage supports thin provisioning.

You can use clonezilla to speed up the migrations.
Yes.
 
Migrated my old 2 nodes vmware essential plus vm's (20 vm) to new 3 nodes proxmox 9 + ceph.
Obviously, I had to do it on a day when I could shut down the VMs, but apart from that, everything worked perfectly.
Thank you, thank you, thank you !!! :D:D:D:D:D