Introduction

Proxmox offers an offline migration functionality to move virtual machines (VMs) between cluster nodes. This is useful when you need to:

  • Transfer VMs to a different physical server for maintenance or upgrades
  • Balance resource allocation across your cluster
  • Consolidate storage

Here’s a breakdown of offline migration in Proxmox:

Protect Your Data with BDRSuite

Cost-Effective Backup Solution for VMs, Servers, Endpoints, Cloud VMs & SaaS applications. Supports On-Premise, Remote, Hybrid and Cloud Backup, including Disaster Recovery, Ransomware Defense & more!

Process

1.Preparation: Shutdown the VM you want to migrate. This ensures data consistency during the transfer.
2. Migration Command: Use the ‘qm migrate’ command on the source node, specifying the target node and the VM ID.

Benefits:

  • No downtime: Since the VM is shutdown during migration, there’s no service interruption for users
  • Flexibility: You can migrate VMs to different storage configurations on the target node

Things to Consider:

Storage Requirements: The target node needs enough space to store a complete copy of the VM’s data.
Configuration Updates: After migration, you might need to update VM/container configurations and storage paths to reflect the new location.

Additional Points:

  • Proxmox uses a similar mechanism as replication for ZFS-based volumes during offline migration
  • Encryption at the storage layer (e.g., LVM-thin on top of dmcrypt) shouldn’t hinder the process

This blog outlines the steps involved in performing an offline migration of a virtual machine (VM) from a source Proxmox host (proxmoxhost) to a destination host (proxmoxhostnode2). This method is particularly useful when the VM needs to be moved for maintenance, upgrades, or to balance resource allocation across your Proxmox cluster.

Download Banner

Offline Migration: We’ll be focusing on the offline migration approach, which is ideal when the VM is already powered off. Even if you choose to migrate a running VM through the wizard, it will automatically switch to offline mode for the transfer.

The next section of this blog will provide a step-by-step guide for performing the offline migration process.

How Offline migration differs from backup and restore of VM in Proxmox ?

Both offline migration and backup and restore achieve similar goals of moving a VM to a different location in Proxmox, but they go about it in fundamentally different ways:

Offline Migration

  • Process: Involves copying the entire VM’s data (disks, configuration files) from the source node to the destination node. The VM remains shutdown during the process
  • Downtime: No downtime for users since the VM is already off
  • Benefits: Faster than restore from backup, good for balancing resource allocation or moving VMs for maintenance
  • Drawbacks: Requires enough storage space on the target node for a complete VM copy. Might require configuration updates on the destination node after migration

Backup and Restore:

  • Process: Creates a compressed archive of the VM’s data (including configuration files) on the source node. This backup is then transferred to a storage location (local, remote, Proxmox Backup Server). Finally, the backup is restored on the destination node, creating a new VM instance
  • Downtime: The VM experiences downtime while the restore process is ongoing. The restore time depends on the VM size and storage speed

    Benefits: Creates a point-in-time copy of the VM for disaster recovery or rollback purposes. More flexible storage options for backups

    Drawbacks: Slower than offline migration due to the compression and decompression steps. Requires additional storage space for backups

Here’s a table summarizing the key differences:

Feature Offline Migration Backup and Restore
Process Copy VM data Create & Restore Backup
VM State Powered Off Any
Downtime No Yes (during restore)
Speed Faster Slower
Storage on Target Required (full copy) Not Required
Use Case Resource Balancing, Maintenance Disaster Recovery, Rollback

In essence, choose:

  • Offline Migration: When speed and zero downtime are crucial (e.g., moving VMs for maintenance)
  • Backup and Restore: When data protection and rollback capability are the primary concerns

Open the Proxmox VE web interface and login to the source cluster node. Locate the virtual machine (VM) you intend to migrate and confirm that it is shut down. Right-click the VM and select “Migrate” from the context menu.

Guide for Offline Migration

Destination Selection: Within the newly opened migration menu, choose the target Proxmox node where you want to migrate the VM. Confirm your selection and initiate the migration process by clicking “Migrate.”

Guide for Offline Migration

Migration Progress: A task viewer window will appear, displaying the progress of the offline migration from the source host (proxmoxhost) to the destination host (proxmoxhostnode2). This window will provide real-time updates until the migration is complete, as shown in the included image.

Guide for Offline Migration

Verifying an offline migrated VM on the destination Proxmox host node by starting it.

Turning on the VM is a common way to verify a successful migration. If the VM boots up successfully and operates as expected, it indicates a successful migration. You can verify it by logged into the OS.

Here are some additional points to consider:

  • Before turning on the VM: It’s recommended to review the VM configuration on the destination node to ensure it reflects the desired settings (e.g., CPU, memory allocation, network configuration)
  • Potential Issues: There might be cases where the VM doesn’t boot after migration. This could be due to hardware differences between the source and destination nodes, driver compatibility issues, or incomplete migration data. Troubleshooting might be necessary in such cases
  • Alternatives for Verification: While turning on the VM is a common approach, there might be other verification methods depending on your specific needs. For instance, you could verify the integrity of the migrated disk files before attempting to boot the VM.

Guide for Offline Migration

Conclusion

In conclusion, knowing about Proxmox offline VM migration is essential in ensuring seamless transitions of virtual machines with minimal downtime and optimal efficiency for users of all levels. By following the detailed step-by-step guide provided in this article, users can confidently navigate the migration process and leverage Proxmox’s versatile features to enhance their virtualization environment. Embracing best practices for offline VM migration not only streamlines operations but also empowers individuals and organizations to maximize the potential of their virtual infrastructure.

Read More:
Proxmox Virtualization Series: Proxmox VM Migration: A Step-by-Step Guide for Online Migration – Part 12

Follow our Twitter and Facebook feeds for new releases, updates, insightful posts and more.

Rate this post