Attaching an exported VHD to a VM in XCP-ng

Hi everyone. I want to attach a VHD of an exported VM from Proxmox to a VM in XCP-ng. After digging around, the best solution to migrate the VMs from Proxmox to XCP-ng was to convert the qcow2 to vhd using qemu-convert and attach them to a VM in XCP-ng. However, I can’t figure out how I can do that. Can this be done with XCP-ng Center or can it be done only with Xen Orchestra?

Not something that I have tried, might want to ask in the XCP-NG forum Home | XCP-ng forum

This is my method for moving between hypervisors https://youtu.be/wSTk9BLwF5k

Is this still current?

1 Like

Yes, that is another way to get that done.

My XCP-ng’s local storage is lvm. Since I’m moving the VMs from Proxmox to XCP-ng and lvm was being used in Proxmox, I thought it would be better to do it like that. How would I go about restoring the vhd for lvm type storage?

I have no idea which is why I did it with EXT.

Yeah I installed XCP-ng on my other hard drive and used EXT. I figured that would be simpler and it was. However, now that I’ve gotten the VHD(using a Ubuntu 19.10 for testing and used Ubuntu 18.04 template because I couldn’t see 19.10). The vhd-util check said that the vhd is valid and I was able to link it however, the imported Ubuntu VM doesn’t boot up and just gets stuck in the booting process.

Bringing this back. I’m getting ready to try to move old aging AD physical servers over to new XCP-NG VM and probably going to try disk2vhd first. Question is about generating the uuid, can I do this in Windows, or should it really be done from one of the XCP-NG hosts? In powershell the following gives me a “unique” id, but reading a little farther it says this is really only unique within that Windows machine:

powershell -Command "[guid]::NewGuid().ToString()"

I also plan to just copy the renamed vhd to my NFS share once I get it set up. Still lots to do, the servers went in the rack yesterday and I need to get them connected and get the new Truenas installed.

It would be easier to use a cloning utility or do this:

Do the clones work when the source is a Windows AD? I’ve had trouble with this is the past, but it has been more than 10 years since I tried using Clonezilla to move an AD around.

Last time I tried moving a physical to virtual I tried to use Windows Server Backup which works fine in physical to physical, but it was giving me permission errors on the USB drive where the image was stored.

If you have it in VHD format then you’ll need to follow these steps to get in on xcp-ng. Use the Hyper-v section.

Just following up on this… With later versions of XO you can just import the VHD from the XO options as indicated by the red arrow. The VHD was 46GB in size and took about an hour to import over a 1 gigabit connection through my PFSense (using it as a router and gateway).

I haven’t attached this to a VM yet, and probably won’t because I already know it won’t function. The main application sees that it went from a physical machine to something with different serial numbers, and panics locking services out. It’s a licensing thing I need to work out with the manufacturer.

I previously imported this same disk (and destroyed it) by renaming the file to a UUID and copying it into place because this indicated import tool wasn’t working (storage permission issue). Now that the permissions are worked out, this might be a way for other people to use disk2vhd to move physical to virtual. I have 3 other servers I need to try this on and see what happens, going to be up to the applications and services that are running on each to see if they work.

For reference the file system is on a Truenas server and NFS. The XCP servers are LVM. This XO was running the Ronivay image you can install from the host command line, I didn’t try on my standalone Debian 11 computer running the from sources build (same and the image anyway).

Maybe something have recently changed within a year. I used disk2vhd and it wouldn’t let me import the vhd via the GUI at all. I had to follow the instructions I posted earlier.

I’m on the latest XO from sources and I think I remember them working on this in the last 6+ months, I seem to recall reading it in an email from them and a blog post.

I’m just starting a semester, so moving one of my DC or really any server is going to be a challenge. I may try moving the server that has my virus scanner and shoutcast host, seems that should be a pretty vanilla thing to move.