You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -8,9 +8,29 @@ How to migrate from VMware, KVM, etc. to XCP-ng.
8
8
9
9
This documentation will help you to make a migration to XCP-ng, from any most common other virtualization platform (VMware, KVM, etc.)
10
10
11
-
:::note
12
-
OVA import method will miss the information if the VM is running BIOS or UEFI mode. Double check your settings on your original system, and then enable (or not) UEFI on XCP-ng side for the destination VM. You can do so in VM advanced tab in Xen Orchestra.
13
-
:::
11
+
## 📋 Prerequisites
12
+
13
+
Before migrating your VMs, make sure to check the following:
14
+
15
+
### Uninstall Existing Guest Tools
16
+
17
+
To avoid conflicts with XCP-ng guest tools, uninstall any existing VM tools (such as VMware Tools or QEMU Guest Agent) from the VM.
18
+
19
+
### Install Xen Drivers
20
+
21
+
On some systems (especially RHEL-based and SLES distributions) Xen drivers are not installed by default. Migrating a VM without these drivers can prevent the OS from detecting disks and network interfaces.
22
+
23
+
Before shutting down the VM, install the drivers with:
Guest tools are essential for proper VM operation (especially on Windows). Be sure to install the XCP-ng guest tools after the migration.
32
+
33
+
See the [guest tools documentation](../vms/vms.md#%EF%B8%8F-guest-tools) for more details.
14
34
15
35
## 🇽 From XenServer
16
36
@@ -26,10 +46,6 @@ If you are running Xen on your usual distro (Debian, Ubuntu…), you are using `
26
46
27
47
Check [the README](https://github.com/xcp-ng/xen2xcp/blob/master/README.md) for usage instructions.
28
48
29
-
## 📦 From Virtualbox
30
-
31
-
Export your VM in OVA format, and use Xen Orchestra to import it. If you have an issue on VM boot, check the [VMware](#-from-vmware) section.
32
-
33
49
## 🇻 From VMware
34
50
35
51
:::warning
@@ -102,48 +118,6 @@ To do this:
102
118
103
119
Now, you can see the transfer progress in the **Task** view of the Xen Orchestra UI. As soon it's done, you can boot the VM directly!
104
120
105
-
### OVA
106
-
107
-
You can also export an OVA from VMware and import an OVA into Xen Orchestra.
108
-
109
-
An OVA is a big, single file using the standard Open Virtualization Format. The OVA contains an XML describing the metadata (VM name, description, etc.) and your disks in the VMDK format.
110
-
111
-
:::tip
112
-
To skip Windows activation if the system was already activated, collect info about the network cards used in the Windows VM (ipconfig /all) and use the same MAC address(es) when creating interfaces in XCP-ng.
113
-
:::
114
-
115
-
:::warning
116
-
117
-
-**Downtime**: The OVA can only be exported while the VM is off (except if you export a clone, but all blocks written after the clone won't be on the imported VM. If you can sync after, it's fine!). This can take a while, and your VMs won't be reachable until it's fully exported AND imported on destination.
118
-
-**Storage**: You need an intermediary storage where you can export then import the OVA file. If your VMs are small, it's OK.
119
-
-**Manual process**: Even if it's simple to do, it can be cumbersome if you have a lot of VMs to migrate.
120
-
:::
121
-
122
-
Importing a VMware Linux VM, you may encounter an error similar to this on boot:
123
-
124
-
`dracut-initqueue[227]: Warning: /dev/mapper/ol-root does not exist`
125
-
126
-
The fix for this is installing some xen drivers *before* exporting the VM from VMware:
[See here](https://unix.stackexchange.com/questions/278385/boot-problem-in-linux/496037#496037) for more details. Once the imported VM is properly booted, remove any VMware related tooling and be sure to install [Xen guest tools](../../vms).
131
-
132
-
### CloneZilla
133
-
134
-
An alternative to using OVA.
135
-
136
-
1. Insert a CloneZilla live CD in your existing VMware VM, and boot on it. In the meantime, you also have a VM on the destination with the right metadata (same name and disks), which you'll also boot with CloneZilla.
137
-
138
-
2. From the VM console, you can tell the source VM running CloneZilla to send all the blocks to the destination VM, also running CloneZilla.
139
-
140
-
3. As soon it's done, you can safely shut down the original VM and boot the copy on destination!
141
-
142
-
:::warning
143
-
-**Downtime**: Even if the downtime will be reduced compared to using OVA, you still need to run the export/import process while the VM is off.
144
-
-**Setup time**: Not complex, but various operations are needed until you can start the replication for one VM. If you have a lot of VMs, this can take some effort.
145
-
:::
146
-
147
121
### Local migration (same host)
148
122
149
123
:::tip
@@ -218,16 +192,7 @@ There's two options, both requiring to export your Hyper-V VM disk in VHD format
In the left menu, go for "Import" then "Disk". Select the destination SR, and then add your VHD file into it. Depending on the VHD file size, it might take some time. The upload progress can be tracked in another XO tab, in the "Task" menu.
224
-
225
-
When the disk is imported, you can:
226
-
227
-
4. Create a VM with the appropriate template, **without any disk in it**
228
-
5. Attach the previously imported disk (VM/Disk/Attach an existing disk)
229
-
6. Boot the VM
230
-
7. Install the tools
195
+
Then [import your VHD](../../installation/migrate-to-xcp-ng/#import-the-vhd)
231
196
232
197
### Alternative: direct VHD copy
233
198
@@ -262,54 +227,123 @@ As soon you did scan the SR, the new disk is visible in the SR/disk view. Don't
262
227
If you lost ability to extend migrated volume (opening journal failed: -2) You need to move disk to another storage, VM should be ON during moving process. This issue can occur when vhd files was directly copied to storage folder.
263
228
:::
264
229
265
-
## 🇰 From KVM (Libvirt)
230
+
## 🇰 From KVM (Libvirt, Proxmox and other)
266
231
267
-
Related forum thread: [https://xcp-ng.org/forum/topic/1465/migrating-from-kvm-to-xcp-ng](https://xcp-ng.org/forum/topic/1465/migrating-from-kvm-to-xcp-ng)
232
+
First, shut down the virtual machine. If you don’t already have the `qemu-img` command available, you can install it by installing the `qemu-utils` package on your computer or server.
268
233
269
-
_Due the fact I have only server here, I have setup a "buffer" machine on my desktop to backup and convert the VM image file._
234
+
Next, convert the QCOW2 disk to a VHD format using the following command:
270
235
271
-
* Install the dracut packages : yum install dracut-config-generic dracut-network
An OVA is a big, single file using the standard Open Virtualization Format. The OVA contains an XML describing the metadata (VM name, description, etc.) and your disks in the VMDK format.
282
249
283
-
* Shutdown the VM
250
+
:::tip
251
+
To skip Windows activation if the system was already activated, collect info about the network cards used in the Windows VM (ipconfig /all) and use the same MAC address(es) when creating interfaces in XCP-ng.
252
+
:::
284
253
285
-
* Use rsync to copy VM files to the "buffer" machine using `--sparse` flag.
254
+

286
255
287
-
* Convert the QCOW2 to VHD using QEMU-IMG :
256
+
:::warning
288
257
289
-
`qemu-img convert -O vpc myvm.qcow2 myvm.vhd`
258
+
-**Downtime**: The OVA can only be exported while the VM is off (except if you export a clone, but all blocks written after the clone won't be on the imported VM. If you can sync after, it's fine!). This can take a while, and your VMs won't be reachable until it's fully exported AND imported on destination.
259
+
-**Storage**: You need an intermediary storage where you can export then import the OVA file. If your VMs are small, it's OK.
260
+
-**Manual process**: Even if it's simple to do, it can be cumbersome if you have a lot of VMs to migrate.
261
+
:::
290
262
291
-
* Use rsync to copy the converted files (VHD) to your XCP-ng host.
292
263
293
-
* After the rsync operation, the VHD are not valid for the XAPI, so repair them :
264
+
:::note
265
+
OVA import method will miss the information if the VM is running BIOS or UEFI mode. Double check your settings on your original system, and then enable (or not) UEFI on XCP-ng side for the destination VM. You can do so in VM advanced tab in Xen Orchestra.
266
+
:::
294
267
295
-
`vhd-util repair -n myvm.vhd`
268
+
### CloneZilla
296
269
297
-
`vhd-util check -n myvm.vhd` should return `myvm.vhd is valid`
270
+
Clonezilla is a free and open-source disk imaging and cloning tool used for system backups, recovery, and deployment.
298
271
299
-
* For each VM, create a VDI on Xen Orchestra with the virtual size of your VHD + 1GB (i.e the virtual size of myvm is 21GB, so I create a VDI with a size of 22GB).
272
+
1. Insert a CloneZilla live CD in your existing VM, and boot on it. In the meantime, you also have a VM on the destination with the right metadata (same name and disks), which you'll also boot with CloneZilla.
300
273
301
-
* Get the UUID of the VDI (on Xen Orchestra or CLI) and use the CLI on the XCP-ng host to import the VHD content into the VDI :
274
+
2. From the VM console, you can tell the source VM running CloneZilla to send all the blocks to the destination VM, also running CloneZilla.
3. As soon it's done, you can safely shut down the original VM and boot the copy on destination!
304
277
305
-
* Once the import is done, create a virtual machine using XO or XCP-ng Center, delete the VM disk that has been created and attach your newly created VDI to the VM. Don't forget to set the VM boot mode to UEFI if your VMs was in UEFI mode.
278
+
:::warning
279
+
-**Downtime**: Even if the downtime will be reduced compared to using OVA, you still need to run the export/import process while the VM is off.
280
+
-**Setup time**: Not complex, but various operations are needed until you can start the replication for one VM. If you have a lot of VMs, this can take some effort.
281
+
:::
306
282
307
-
* Boot the VM and find a way to enter in the virtual UEFI of the VM. Here, I type the Escape and F9,F10,F11,F12 keys like crazy. Select Boot Manager, you should see this window :
* Select `UEFI QEMU HARDDISK`, the screen should be black for seconds and you should see the GRUB. Let the machine worked for minutes and you should see the prompt finally 👍
287
+
In the left menu, go for "Import" then "Disk". Select the destination SR, and then add your VHD file into it. Depending on the VHD file size, it might take some time. The upload progress can be tracked in another XO tab, in the "Task" menu.
312
288
313
-
* Install Guest Tools and reboot. The reboot shouldn't take long, you don't have to redo step 13, the OS seems to have repair the boot sequence by itself.
289
+

314
290
315
-
Done !
291
+
When the disk is imported, you can:
292
+
293
+
- Create a VM with the appropriate template, **without any disk in it**
294
+
- Attach the previously imported disk (VM/Disk/Attach an existing disk)
295
+
- Boot the VM
296
+
- Install the tools
297
+
298
+
### Via the CLI
299
+
300
+
You can transfer the VHD file directly to your XCP-ng storage repository (SR) using SCP:
The name of your VHD MUST BE an uuid (e.g. 44ad36fc-e9f1-4d74-9090-2d9bffddbee2.vhd).
308
+
309
+
You can generate one with the command `uuidgen` on Linux.
310
+
:::
311
+
312
+
You need to rescan the SR where you new VHD file is, so it can be detected. It will appear in the disk list, without a name or description though. You can use `xe sr-scan` or use the scan button on the storage in Xen Orchestra.
313
+
314
+
In Xen Orchestra, create a new VM without a disk, and make sure to uncheck the "Boot VM after creation" option under advanced settings. Then, go to the "Disks" tab, click on "Attach disk", select the VHD you just uploaded, and attach it.
315
+
316
+
317
+
## 🛠️ Troubleshooting
318
+
319
+
### My imported VM is not booting
320
+
321
+
- Check if the Boot firmware (in advanced setting) is on the correct type (BIOS or UEFI)
322
+
- Check if the boot disk is the first in the VM disk tab
0 commit comments