Migrate from XenServer to XCP-ng

XenServer based, Community Powered.

Objective

This article describes how to proceed in order to convert your Citrix© XenServer infrastructure into a XCP-ng infrastructure.

All of this, without losing ANY settings (SR, VMs, networks) from your existing XenServer infrastructure!

Most import rule

Always upgrade the pool master first. Always. Otherwise, you’ll have issues.

Note: before upgrading, also think to eject all CD inserted in your VMs. This can be done with xe vm-cd-eject --multiple.

Migration process

XCP-NG installation follows roughly the same workflow than a XenServer installation. Therefore, the migration procedure will be very similar to an upgrade procedure in XenServer.

  • Download the XCP-ng ISO from this page
  • Put this ISO on a CD or a USB-key and start the installation procedure in your XenServer infrastructure
    You can use this:

dd if=XCP-ng_7.4.1.iso of=/dev/sdX bs=8M status=progress oflag=direct

You can also burn a real CD or use a Windows program to create a bootable USB key from an ISO file.

  • Follow the instruction on the screen to start the migration of your infrastructure from XenServer to XCP-ng.

install screen xcp-ng

  • Eventually, you will reach a screen proposing you to upgrade your XenServer 7.X to XCP-ng

  • Once the installation process is complete, reboot your host.

  • XCP-ng will boot

And it’s done, you have succesfully migrated from XenServer to XCP-ng. Everything will be as it was before, in your XenServer infrastructure. SRs, VMs, network configuration, everything is kept during the migration to XCP-ng!

Migration from XenServer 6.X

XenServer 7 introduced a new (and better) partition scheme. Therefore, if you want to migrate from a XenServer 6 version you have two possibilities.

  • You can keep the old partition model
  • you can “upgrade” it to the new scheme

As it’s (obvioulsy) a better partition scheme, we strongly recommend you to upgrade to this scheme and not to keep the old one, but it’s your call.

WARNING: using the new partition scheme will REMOVE the content of your local SR.

Using the new partition

In order to migrate using the new partition scheme, you need to run this command on your host before launching the migration process.

$ touch /var/preserve/safe2upgrade

Check that you are using GPT partitioning and not MBR and doublecheck that you don’t have any VDI attach to your local SR. Any remaining VDI will be removed.

Then, you can follow the standard migration procedure describe before.

Migrating your XenServer Pool to XCP-ng without downtime

Here is how to proceed in order to migrate without having downtime in your infrastructure.

  1. Live migrate your VMs from the pool master to other hosts
  2. Upgrade your pool master
  3. Live migrate VMs from another host to your pool master
  4. Upgrade the host
  5. Repeat until all hosts are migrated

Alternate method: remote upgrade

If you do not have access to your server or remote KVM in order to upgrade using the interactive ISO installer, you can initiate an automatic reboot and upgrade process using the following procedure:

Unpack/extract the XCP-NG ISO to a folder on a webserver. Then get the UUID of your host by running the below command:

xe host-list

Using that host UUID, as well as the URL to the folder hosting the unpacked XCP-NG ISO, run the following command to test access:

xe host-call-plugin plugin=prepare_host_upgrade.py host-uuid=750d9176-6468-4a08-8647-77a64c09093e fn=testUrl args:url=http://<ip-address>/xcp-ng/unpackedexample/

The returned output must be true to continue.

Now tell the host to automatically boot to the ISO and upgrade itself on next reboot (using the UUID and URL from before):

xe host-call-plugin plugin=prepare_host_upgrade.py host-uuid=750d9176-6468-4a08-8647-77a64c09093e fn=main args:url=http://<ip-address>/xcp-ng/unpackedexample/

The output should also be true. It has created a temporary entry in the grub bootloader which will automatically load the upgrade ISO on the next boot. It then automatically runs the XCP-NG upgrade with no user intervention required. It will also backup your existing XenServer dom0 install to the secondary backup partition, just like the normal upgrade.

To start the process, just tell the host to reboot. It is best to watch the progress by using KVM if it’s available, but if not, it should proceed fine and boot into upgraded XCP-NG in 10 to 20 minutes.

XCP-ng administration tool

Two options:

  • Xen Orchestra (complete web admin tool)
  • XCP-ng Center

See the download section for more details!

16 Responses

  1. john says:

    Might be worth mentioning that you’d need to replace XenCenter with XCP-ng Center. You should probably also make it clearer that migrating your partition format to the new scheme means you will lose any VM’s stored on that server..

  2. Narcís says:

    Hi,
    As you mention the upgrade process from XS 6.x, it would be great to specify from which XS (7 I guess) versions you can upgrade from following your instructions.
    Hope it helps to other people.

  3. Dee Siminiuk says:

    I upgraded my XS 7.2 pool master to XCP-ng 7.4.1 from a bootable USB flash drive, no issues at all (2 servers total in the pool).
    But then I wasn’t able to migrate VMs from the 2nd server back to the pool master. An error about CPU Features. I had to shut the VMs down and then I was able to start them on the pool master.
    When I attempted to upgrade the 2nd server, the installer asked me to choose NIC to access the repository, even though I selected local media as the repository. I don’t think that question was asked on the pool master upgrade. I found that odd.

    But otherwise I’m up and running. THANK YOU!

  4. Mark Roddy says:

    Just a head’s up: on upgrade your windows vms may fail to boot until you attach the guest-tools.iso to each of them. The error message “This operation cannot be performed because the specified virtual disk could not be found”. Is totally unhelpful. Google eventually solved this problem 🙂

    • olivierlambert says:

      What do you mean by “upgrading”? Rebooting your Windows VMs after migrated from XS to XCP-ng? Did you activated the “automated Windows update driver” process to get the tools from there?

      • Mark Roddy says:

        I upgraded from citrix 7.2 to ng 7.4 by installing the iso on the servers. After the server upgrade only my linux vms would boot. The windows vms failed with the cryptic error until I mounted the tools is on each vm’s dvd drive.

  5. Boyejo Ayo says:

    I’m trying to migrate from XenServer 7.5 but was not given the option to upgrade, it says a version that cannot be upgraded is detected.

    Please help.

  6. Ringo says:

    hi guys, thanks for the nice blog post!
    Ive tried the "Alternate method: remote upgrade" way, worked good so far, the server came back, if I connect via HTTP to his IP, I can see the normal xcp-ng site, where you can download the xcp-ng centre etc. but I cant log in anymore with the root password. xen orchestra has the same problem and from there it worked before, did you ever had this situation?
    cheers, Ringo

  7. Guys very good job, migrate 3 online server remotely without any problem.

    Thank you for this great job

    We cannot participate on kickstarter , it seems closed ??

    MS

  8. kju says:

    can i upgrade from XS 6.x to XCP-ng 7.5?

Leave a Reply

Your email address will not be published. Required fields are marked *