Migrating from ESXi 6 to ProxmoxVE 8 with NFS Data store?

Socialoutcast

New Member
May 13, 2024
2
2
3
So I am in need of migrating my entire ESXi stack to ProxmoxVE. Sadly, I cannot afford a second server, so I cannot do the live migration tool. Another major issue I have is I store around 9TB of data for some servers on a NAS using NFS that I cannot lose. Is there a way to migrate all the data and VM to proxmox? I don't really care if it's hard, I want to get away from ESXi if possible. I have been searching, but I am also new to Proxmox, so I am not entirely sure if what I have found will work. Any help is greatly appreciated.
 
  • Like
Reactions: Der Harry
I never used the ESXi migration tool - and I probably never will :)

So here is my (manual) approach:
- shutdown all ESXi vms
- remove autostart in ESXi
- double check that VMs are down and that there is no autocheck
- copy the VMs e.g. ".../datastore1/things" from ESXi to "somewhere" e.g. a NAS
- create checksums
- verify checksums :)
- install proxmox

I am refering to the following things:

https://pve.proxmox.com/wiki/Migrate_to_Proxmox_VE#Manual_Migration


Here some garbage I enter on the CLI - this is pretty advanced stuff. We imported many many VMs in this approach.

You need to change basically everything.


Bash:
# Create the VM without a Disk

export VMID=11100
VMNAME=Win2016Server
STORAGE=local
MEMORY=32768
CORES=2
SOCKETS=4

## This is a Win2016 server
#
## os type is "win 10"
## machine is "default"

qm stop ${VMID} || true
qm destroy ${VMID} --destroy-unreferenced-disks 1 --purge 1 || true
qm create ${VMID} --name ${VMNAME} --ostype win10
qm set ${VMID} --memory ${MEMORY} --sockets ${SOCKETS} --cores ${CORES} --cpu host
qm set ${VMID} --agent enabled=1,fstrim_cloned_disks=1
qm set ${VMID} --machine pc-q35-8.1
qm set ${VMID} --bios ovmf
qm set ${VMID} -efidisk0 ${STORAGE}:1,format=qcow2,efitype=4m,pre-enrolled-keys=1
qm set ${VMID} --scsihw virtio-scsi-single
qm set ${VMID} -ide1 local:iso/virtio-win.iso,media=cdrom
#qm set ${VMID} -ide2 local:iso/systemrescue-11.00-amd64.iso,media=cdrom
#qm config ${VMID}

Bash:
# import the Disk from VM

VMID=11100
DISK_NUMBER=1
VMDK=/nfs/esxi-imports/Win2016Server/Win2016Server.vmdk
COW_DIR=/var/lib/vz/images/${VMID}
COW_FILE=${COW_DIR}/vm-${VMID}-disk-${DISK_NUMBER}.qcow2

mkdir -p "${COW_DIR}"
qemu-img convert -f vmdk "${VMDK}" -O qcow2 "${COW_FILE}"

echo disk is at: ${COW_FILE}
qm set ${VMID} -ide0 ${COW_FILE},ssd=1,discard=on
qm set ${VMID} --boot order=ide0

- start the VM after import (we have no network)
- install the drivers from the virt-io.win.iso
- stop the VM

Bash:
export VMID=11100

qm set ${VMID} --vga virtio
qm set ${VMID} --delete ide1
#qm set ${VMID} --delete ide2

# you need to change the mac address
qm set ${VMID} --net0 virtio=ab:cd:ef:01:02:03,bridge=vmbr0,firewall=1

Now the machine has propper drivers and can go to the internet.
 
  • Like
Reactions: Socialoutcast
I never used the ESXi migration tool - and I probably never will :)

So here is my (manual) approach:
- shutdown all ESXi vms
- remove autostart in ESXi
- double check that VMs are down and that there is no autocheck
- copy the VMs e.g. ".../datastore1/things" from ESXi to "somewhere" e.g. a NAS
- create checksums
- verify checksums :)
- install proxmox

I am refering to the following things:

https://pve.proxmox.com/wiki/Migrate_to_Proxmox_VE#Manual_Migration


Here some garbage I enter on the CLI - this is pretty advanced stuff. We imported many many VMs in this approach.

You need to change basically everything.


Bash:
# Create the VM without a Disk

export VMID=11100
VMNAME=Win2016Server
STORAGE=local
MEMORY=32768
CORES=2
SOCKETS=4

## This is a Win2016 server
#
## os type is "win 10"
## machine is "default"

qm stop ${VMID} || true
qm destroy ${VMID} --destroy-unreferenced-disks 1 --purge 1 || true
qm create ${VMID} --name ${VMNAME} --ostype win10
qm set ${VMID} --memory ${MEMORY} --sockets ${SOCKETS} --cores ${CORES} --cpu host
qm set ${VMID} --agent enabled=1,fstrim_cloned_disks=1
qm set ${VMID} --machine pc-q35-8.1
qm set ${VMID} --bios ovmf
qm set ${VMID} -efidisk0 ${STORAGE}:1,format=qcow2,efitype=4m,pre-enrolled-keys=1
qm set ${VMID} --scsihw virtio-scsi-single
qm set ${VMID} -ide1 local:iso/virtio-win.iso,media=cdrom
#qm set ${VMID} -ide2 local:iso/systemrescue-11.00-amd64.iso,media=cdrom
#qm config ${VMID}

Bash:
# import the Disk from VM

VMID=11100
DISK_NUMBER=1
VMDK=/nfs/esxi-imports/Win2016Server/Win2016Server.vmdk
COW_DIR=/var/lib/vz/images/${VMID}
COW_FILE=${COW_DIR}/vm-${VMID}-disk-${DISK_NUMBER}.qcow2

mkdir -p "${COW_DIR}"
qemu-img convert -f vmdk "${VMDK}" -O qcow2 "${COW_FILE}"

echo disk is at: ${COW_FILE}
qm set ${VMID} -ide0 ${COW_FILE},ssd=1,discard=on
qm set ${VMID} --boot order=ide0

- start the VM after import (we have no network)
- install the drivers from the virt-io.win.iso
- stop the VM

Bash:
export VMID=11100

qm set ${VMID} --vga virtio
qm set ${VMID} --delete ide1
#qm set ${VMID} --delete ide2

# you need to change the mac address
qm set ${VMID} --net0 virtio=ab:cd:ef:01:02:03,bridge=vmbr0,firewall=1

Now the machine has propper drivers and can go to the internet.
Thank you this will help a lot. I was really concerned about losing all my data.
 
  • Like
Reactions: Der Harry

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!