Directly import ESXi VMs to Proxmox from shared NFS?

basti23

New Member
Jun 6, 2024
4
1
3
Hi,
I have my ESXi VMs stored on an NFS storage which my Proxmox Nodes are also capable of accessing. Yet, I can not seem to find a way of importing these VMs directly.

root@node1:/# qm import 177 /mnt/pve/NFS-storage/test_vm/test_vm.vmx --storage Ceph-StoragePool
unable to parse volume ID '/mnt/pve/NFS-storage/test_vm/test_vm.vmx'


Why is this? I am giving the exact location of where the VM is running on ESXi. What ist the volume ID supposed to be? I can't find any further information online for the kind of argument that the command is expecting.

I do not want to use the Proxmox UI ESXi import feature because it is slow (due to ESXi) and difficult to automate.
 
You need to use the .vmdk not the .vmx - have you tried that?
 
Hi,

root@node1:/# qm import 177 /mnt/pve/NFS-storage/test_vm/test_vm.vmx --storage Ceph-StoragePool
unable to parse volume ID '/mnt/pve/NFS-storage/test_vm/test_vm.vmx'
you probably want the command qm disk import :)

E.g.
Code:
# qm disk import 100 /mnt/test.vmdk local-lvm
importing disk 'test.vmdk' to VM 100 ...
transferred 0.0 B of 16.0 GiB (0.00%)
transferred 16.0 GiB of 16.0 GiB (100.00%)
unused0: successfully imported disk 'local-lvm:vm-100-disk-2'
 
  • Like
Reactions: jsterr
Thanks, I know about "qm disk import", but actually I want to import the entire VM based on the VMX-file, just like the ESXi import function in the UI. According to this brief explanation from "qm help", "qm import" is the correct command for that:

USAGE: qm import <vmid> <source> --storage <string> [OPTIONS]

Import a foreign virtual guest from a supported import source, such as an
ESXi storage.

<vmid> <integer> (100 - 999999999)
The (unique) ID of the VM.

<source> <string>
The import source volume id.
 
  • Like
Reactions: Johannes S
Eventually, this is how I decided to migrate my VMs:
1. Use ESXi Import (in UI or "qm import" in CLI) for importing the VM configuration without the disks.
2. Import the disks from the shared NFS using "qm disk import" at a speed of about 3 Gbit/s.

Works perfectly. It would be nice though if there was a function to import VMs based on a VMX-file just like "qm importovf" does it for OVF-files from the local filesystem rather than API-based ESXi import.