XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Xen

    Scheduled Pinned Locked Moved Migrate to XCP-ng
    13 Posts 3 Posters 795 Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      hintalo68
      last edited by

      Hi Everybody

      I have some virtual machine on debian Xen server. The DomU machine disks defined on lvm volume. Are there any way to migrate these VM to xcp-ng ?
      I have find a script, but it didnt work for me.

      https://unix.stackexchange.com/questions/66142/xen-migrating-lvm-based-machines-from-xen-opensource-to-xen-cloud-platform

      Thank
      Zoltan

      1 Reply Last reply Reply Quote 0
      • olivierlambertO Offline
        olivierlambert Vates 🪐 Co-Founder CEO
        last edited by

        Hi!

        Have you read our official documentation first? https://docs.xcp-ng.org/installation/migrate-to-xcp-ng/#-from-xen-on-linux

        H 1 Reply Last reply Reply Quote 0
        • H Offline
          hintalo68 @olivierlambert
          last edited by

          @olivierlambert
          Hi
          Yes, I have read, and tried. The import was successfully, but the new VM stop during the boot, and I got initram prompt.

          1 Reply Last reply Reply Quote 0
          • olivierlambertO Offline
            olivierlambert Vates 🪐 Co-Founder CEO
            last edited by

            That's pretty much scarce information. Is your VM PV or HVM?

            H 2 Replies Last reply Reply Quote 0
            • H Offline
              hintalo68 @olivierlambert
              last edited by

              @olivierlambert

              Hi

              I use PVM guest, that run on LVM volume.

              Here is my xen.cfg file

              kernel = '/boot/vmlinuz-5.10.0-28-amd64'
              extra = 'elevator=noop'
              ramdisk = '/boot/initrd.img-5.10.0-28-amd64'

              vcpus = '1'
              memory = '4096'

              Disk device(s).

              Physical volumes

              root = '/dev/xvda2 ro'
              disk = [
              'phy:/dev/xenvol/sl2601,xvda2,w',
              'phy:/dev/xenvol/sl2601_swap,xvda1,w',
              ]

              1 Reply Last reply Reply Quote 0
              • H Offline
                hintalo68 @olivierlambert
                last edited by

                @olivierlambert

                Hi

                In the original configuration the root disk is xvda2 and a swap xvda1.
                After the migration under xcp-ng has created two disks.
                xvda for the root and xvdb for the swap.
                Booting stop at this moment.

                Gave up waiting for root file system device. Common problems:

                • Boot args (cat /proc/cmdline)
                  • Check rootdelay= (did the system wait long enough?)
                • Missing modules (cat /proc/modules; ls /dev)
                  ALERT! /dev/xvda2 does not exist. Dropping to a shell!
                  (initramfs) [ 249.512144] random: crng init done

                Do you have any id , how can solve this problem ?
                Thanks.

                H 1 Reply Last reply Reply Quote 0
                • olivierlambertO Offline
                  olivierlambert Vates 🪐 Co-Founder CEO
                  last edited by

                  Rebuild your initrd correctly and fstab to use the right drive numbering. Also, PV is deprecated, you should transform your VM in HVM mode 🙂 (install grub in the bootloader)

                  1 Reply Last reply Reply Quote 0
                  • H Offline
                    hintalo68 @hintalo68
                    last edited by

                    @hintalo68

                    I add extra parameter on advanced tab.
                    PV args root=/dev/xvda ro

                    The VM has started . Nice.
                    Modified the fstab, and grub menu.lst with correct drive.
                    After that I have tried install grub in to the bootloader. It was not success.
                    I have got this.


                    Searching for GRUB installation directory ... found: /boot/grub
                    WARNING: tempfile is deprecated; consider using mktemp instead.
                    WARNING: tempfile is deprecated; consider using mktemp instead.
                    The file /boot/grub/stage1 not read correctly.

                    Fdisk said that is not correct partition table.
                    root@sl1802:~# fdisk /dev/xvda

                    Welcome to fdisk (util-linux 2.36.1).
                    Changes will remain in memory only, until you decide to write them.
                    Be careful before using the write command.

                    The device contains 'ext4' signature and it will be removed by a write command. See fdisk(8) man page and --wipe option for more details.

                    Device does not contain a recognized partition table.
                    Created a new DOS disklabel with disk identifier 0x5df197a4.


                    H 1 Reply Last reply Reply Quote 0
                    • olivierlambertO Offline
                      olivierlambert Vates 🪐 Co-Founder CEO
                      last edited by

                      Ok so just to check: now you have a working PV guest, right?

                      1 Reply Last reply Reply Quote 0
                      • H Offline
                        hintalo68 @hintalo68
                        last edited by

                        @hintalo68

                        Yes. It works, but I can not convert to HVM until I can not install grub, righ ?

                        1 Reply Last reply Reply Quote 0
                        • olivierlambertO Offline
                          olivierlambert Vates 🪐 Co-Founder CEO
                          last edited by

                          Yes, that's correct. At least, you can boot the VM, which is already better 🙂

                          To install Grub on the main drive: grub-install /dev/xvda. If that doesn't work, check https://bugs.archlinux.org/task/30241

                          H 1 Reply Last reply Reply Quote 0
                          • H Offline
                            hintalo68 @olivierlambert
                            last edited by

                            @olivierlambert

                            I have tried this, but not work.

                            root@sl1802:~# grub-install /dev/xvda
                            Searching for GRUB installation directory ... found: /boot/grub
                            WARNING: tempfile is deprecated; consider using mktemp instead.
                            WARNING: tempfile is deprecated; consider using mktemp instead.
                            The file /boot/grub/stage1 not read correctly.

                            1 Reply Last reply Reply Quote 0
                            • andrewperryA Offline
                              andrewperry
                              last edited by andrewperry

                              I have been migrating VMs from Xen on Debian 11/12 using the python2 script this past week and it worked best if I had ensured the VMs were booting on Debian using pygrub as the bootloader rather than the specified kernel from the Dom0.

                              Then all I had to do after running the script was go into Xen Orchestra and change the "PV args" for the VM under "Advanced" to "root=/dev/xvda ro" (instead of "root=/dev/xvda2 ro" from the imported config), edit the "Network" config to match the MAC addresses used by the VM before, and mount the tools disk.

                              The VM will then boot and I can edit the /etc/fstab file to use xvda and xvdb for the boot disk and swap respectively (instead of xvda2 and xvda1 that Debian had been using).

                              I edited my VM's /etc/network/interfaces (because we have standardised on having the internal network as the first ethernet port rather than the second), then mounted the tools and ran 'sudo /mnt/Linux/install.sh' before rebooting. It is a pretty quick process once you've done a dozen or so!!

                              I tried updating the script to use python3 but as I am not a python developer I decided it was safer to build python2.7 from sources to run on Debian 12, since unfortunately python 2 is no longer available from packages on Debian 12.

                              Thanks for sharing your experience here, which I thought I would just add to as it may help others migrating to xcp-ng over coming months/years. All I can say is, "Do it!". The sooner the better!

                              Once I have all the VM migrated in PV mode, I will then work on moving to HVM.

                              1 Reply Last reply Reply Quote 0
                              • First post
                                Last post