A Quick Guide to Migrating VMs from Proxmox
Migrating a virtual machine (VM) within a cluster can help balance workloads and ensure optimal resource usage. Here’s a brief guide to help you navigate the process smoothly.
Prerequisites
Before you begin the migration, ensure you have the following:
- Existing Cluster: You need to have a functional cluster set up with at least two nodes.
- Consistent Storage Names: The VM must have the same disk name across all nodes. If the disk names differ, the migration will fail.
- Backup: Ensure that you have a recent backup of the VM. This will safeguard your data in case anything goes wrong during the migration process.
- Resource Availability: Check that the target node has sufficient resources (CPU, RAM, and storage) to accommodate the migrated VM.
Migrate Virtual Machine
To start, right-click your virtual machine and hit Migrate

You will be prompted with an option to migrate, select your target storage and select Migrate

This will take some time depending on how big your VM is

Start VM
After migration, validate the process by starting up the VM. The original VM on the source node will no longer be visible and will appear on the new node instead.
Validation

Other items you may want to verify are:
- Verify VM Configuration: Double-check the VM settings (CPU, memory, network configurations, etc.) to ensure they match the desired specifications and requirements.
- Test VM Functionality: Conduct thorough VM testing to ensure all applications and services run smoothly. Verify that any necessary network connections are intact.
- Clean-Up Resources: If the migration was successful and the original VM no longer needs to remain in its previous location, you can remove it from the source node to free up resources. However, ensure that you have backups in case you need to revert.
- Monitor Performance: Keep an eye on the VM’s performance for a few days after migration. Check for any unusual behaviour or resource usage that could indicate issues.
- Backup the VM: After confirming everything is running well, perform a new backup of the migrated VM to ensure you have the latest state saved.
- Review Networking: If there were any IP address changes or network configuration updates, ensure that all connected services and users are informed and updated.
Common Issues You May Encounter
Issue 1: Storage Name Mismatch
If the storage names on the source and destination nodes do not match, the migration will fail. It’s essential to verify that the storage configurations are identical on both nodes before attempting to migrate.

Issue 2: Corrupted Storage
Corruption within the VM’s storage can complicate the migration process. In such cases, you may encounter errors similar to the one below:

Troubleshooting storage corruption can be challenging, so it's advisable to perform regular backups and check the integrity of your VM’s storage before initiating a migration.
Troubleshooting
Disk Issues: From the Shell, you can run zpool status if using ZFS. With this command, you can see if the vms are corrupted. As shown below, one of my VMS has issues with the data which is unrepairable at this stage for me hence why I am trying to migrate these off the disks.
root@proxmicro:~# zpool status -v
pool: vm-storage
state: ONLINE
status: One or more devices has experienced an error resulting in data
corruption. Applications may be affected.
action: Restore the file in question if possible. Otherwise restore the
entire pool from backup.
see: https://openzfs.github.io/openzfs-docs/msg/ZFS-8000-8A
scan: scrub repaired 0B in 00:20:13 with 2 errors on Fri Nov 1 01:38:13 2024
config:
NAME STATE READ WRITE CKSUM
vm-storage ONLINE 0 0 0
ata-CT500MX500SSD1_2246E68696D4 ONLINE 0 0 28
errors: Permanent errors have been detected in the following files:
vm-storage/vm-111-disk-1:<0x1>
vm-storage/vm-111-disk-1@backup:<0x1>
vm-storage/vm-107-disk-0:<0x1>

Possible Solutions: Run this command which may/maynot fix your errors.
zpool scrub vm-storage
I will continue to update this article with new insights, tips, and best practices for VM migration and troubleshooting
Found this article useful? Why not buy Phi a coffee to show your appreciation?