Migrating virtual machines from vmware to proxmox can be a seamless process if done correctly.
Introduction: In this comprehensive guide, we’ll walk through the process of migrating a virtual machine (VM) from vmware to proxmox.
Prerequisites: Before proceeding with the migration, ensure you have the following prerequisites:
- Running proxmox ve server: Ensure you have a functional proxmox ve server set up with sufficient storage space and network connectivity.
- Powered-off vm in our case (vm1): The virtual machine named vm1 on your vmware ESXi server should be powered off before the migration process.
- SSH access to both the esxi and proxmox server: You need ssh access credentials for the ESXi server hosting vm1. SSH access enabled on both hosts.
- Basic familiarity with linux command line.
- VMware vSphere Client (optional): While not mandatory, it simplifies some steps as it provides a graphical interface for vm management.
- Additional Tips:
Ensure network connectivity between vmware and proxmox servers.
Make sure to allocate enough disk space on the proxmox server for the imported vms.
1. Prepare Proxmox Server
Ensure that your proxmox server is properly set up and accessible. Check and if missing install necessary packages like sshfs
, qemu
, and qemu-img
.
apt install sshfs qemu qemu-img
2. Mount VMware Storage on Proxmox
Mounting vmware datastore on proxmox server using SSHFS. Replace 10.10.10.100
with your vmware server’s IP address. First, we need to mount the vmware datastore on the proxmox host. This allows us to access the vm files.
mkdir /mnt/ssh/100
sshfs [email protected]:/vmfs/volumes/ /mnt/ssh/100
Another method is to download vm1 disk:
Using SCP (command-line):
- Open a terminal on your Proxmox VE server.
- Execute the following command,
- scp root@<ESXi_IP_Address>:/vmfs/volumes/<datastore_name>/vm1.vmdk vm1.vmdk
- replacing placeholders with your actual details:
scp [email protected]:/vmfs/volumes/SAS_Datastore/vm1.vmdk vm1.vmdk
Using VMware vSphere Client (GUI):
- Launch the vSphere Client and connect to your ESXi server.
- Locate vm1 in the inventory tree.
- Right-click on vm1 and select “Download as OVF template”.
- Choose “Disk only” format and provide a local download path on your Proxmox VE server (e.g., /mnt/vm-storage).
- Initiate the download.
3. Convert VMware VM Disk to Proxmox Compatible Format
We’ll convert the VMware VM disk to raw format using the 'qemu-img convert
‘ command.
- Open a terminal window on your Proxmox VE server.
- Use the
qemu-img
tool to convert the downloaded VMDK disk to raw format:
the basic command is
“`bash
qemu-img convert VM_Name/VM_Name-flat.vmdk -O raw vm_name.raw
“`
qemu-img convert /mnt/ssh/100/vmfs/volumes/vm1/vm1-flat.vmdk -O raw vm1.raw
4. Create New VM on Proxmox
Create new vm using web interface:
- Access the proxmox web interface (https://<proxmox_server_ip>:8006).
- Login with your administrative credentials.
- Navigate to “Datacenter” -> “Create VM”.
- Define vm name (e.g., vm1), id, and select an appropriate storage location for the virtual disk.
- Configure hardware settings like cpu cores, memory, and network interfaces according to vm1’s requirements.
- Click “Finish” to create the VM.
Using qm
command-line tool:
- Open a terminal on your proxmox ve server.
- Create the vm using the
qm create
command, specifying name, id, storage location, cpu cores, memory, and network bridge:
qm create <vm_id> --name vm1 --memory 1024 --net0 bridge=vmbr0 --storage local:<storage_location>/vm1 --ide0 <file_path>/vm1.raw
Replace ‘<vm_id>'
with the id of the vm in proxmox.
5. Import VM Disk into Proxmox and Attached to VM
Now, we import the converted disk into Proxmox using the 'qm importdisk'
command. We can use two methods:
Using Proxmox Web Interface:
- n the web interface, navigate to “Datacenter” -> “vm1” -> “Hard Disk”.
- Click “Create Hard Disk”.
- Select “local – lvm” type and browse to the
vm1.raw
file location. - Set the SCSI controller type (ide0, scsi0, etc.) to match your VM configuration.
- Click “Add” to attach the disk.
Using qm imporstdisk
command:
- Open a terminal on your Proxmox VE server.
- Attach the disk using the following command, replacing placeholders:
qm importdisk <vm_id> vm_name.raw local-lvm:<storage_location>/vm1 --format raw
Replace ‘<vm_id>'
with the id of the vm in proxmox.
6. Verify Migration and Start VM
After importing the disk, it’s essential to verify the migration by checking the status of the vm and start the vm from the proxmox web interface.
qm status <vm_id>
7. Configure VM:
- Boot Order: Ensure the newly attached disk is set as the primary boot device in the vm’s BIOS/UEFI settings.
- Network Card: Verify the assigned network interface matches your desired network configuration in proxmox.
- Additional Settings: Adjust any other vm settings like keyboard/mouse options, display resolution, etc. based on your requirements.
8. Start the VM:
- From the Proxmox interface or using the
qm start <vm_id>
command, power on the vm1 VM.
Additional Notes:
Guest OS Drivers:
- Depending on your guest OS, you might need to install additional drivers after booting the VM for proper functionality of network, storage, or other devices. Refer to your guest OS documentation for specific driver installation instructions.
- For windows vms, uninstall vmware tools before starting the vm on proxmox and install drivers compatible with the new virtualization environment (VirtIO drivers are recommended).
- For linux vms, you might need to update the kernel or install additional kernel modules related to network and storage devices.
Other Considerations:
- Firewall Rules: Ensure your proxmox firewall allows necessary network traffic for the migrated vm.
- Resource Availability: Verify your proxmox server has sufficient cpu, memory, and storage resources to accommodate the migrated vm effectively.
- Backup and Testing: It’s always advisable to back up your vm before migration and perform initial testing in a non-production environment to ensure a smooth transition.
Conclusion:
By following these steps, you can successfully migrate a vm from vmware to proxmox using command-line tools. Adjustments may be needed based on your specific environment and requirements.
Remember, migrating a vm can be a complex process depending on your specific environment and configuration. While the provided steps offer a general guideline, you might encounter additional requirements or challenges. Here are some helpful resources for further assistance:
- Proxmox VE Documentation: https://pve.proxmox.com/pve-docs/
- Proxmox VE Forum: https://forum.proxmox.com/
- Online Tutorials and Guides: Numerous online resources offer in-depth tutorials and guidance on migrating vms from vmware to proxmox. Explore these resources for more specific and advanced instructions.
If you need support and assistance in the migration process, feel free to contact us, we are at your disposal to help you successfully migrate your vm’s to proxmox!
Leave a Reply