ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    how do I migrate my KVM settings to a new desktop

    IT Discussion
    kvm fedora migration desktop
    4
    10
    1.5k
    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.
    • JaredBuschJ
      JaredBusch
      last edited by JaredBusch

      Scenario:

      Fedora 25 + Cinnamon desktop (crashes when upgraded to 26 have not tried 27).
      512GB SSD + 4TB HDD
      Has KVM setup and single local Windows 10 VM with a bunch of in progress SQL development happening.
      VM is located in /home/kvm_store
      /home is mounted from the 4TB HDD

      New Desktop
      Fedora 27 + Cinnamon
      256GB m.2 SSD + existing 4TB HDD will be relocated here
      /home will remain mounted on the SSD
      /home/kvm_store will be mounted to the HDD

      User is the same. group ID was setup the same. what can I do to ensure that this VM continues to run?

      Where are the KVM settings stored so I can migrated them?
      Should I export the qcow2 and just set things up again?
      Can I just move the disk and mount things and hope it powers up?

      ObsolesceO 2 Replies Last reply Reply Quote 2
      • black3dynamiteB
        black3dynamite
        last edited by black3dynamite

        Not sure how to backup KVM Host settings but here's how I backed up my VM

        # Backup VM config and copy qcow2 image
        sudo virsh dumpxml vmname > /media/backup/vmname.xml
        sudo cp /home/user/libvirt/vmname.qcow2 /media/backup
        
        # Restore VM config and copy qcow2 image
        sudo cp /media/backup/vmname.qcow2 /home/user/libvirt
        sudo virsh define --file /media/backup/vmname.xml
        
        ObsolesceO JaredBuschJ 2 Replies Last reply Reply Quote 1
        • ObsolesceO
          Obsolesce @JaredBusch
          last edited by

          @jaredbusch said in how do I migrate my KVM settings to a new desktop:

          Scenario:

          Fedora 25 + Cinnamon desktop (crashes when upgraded to 26 have not tried 27).
          512GB SSD + 4TB HDD
          Has KVM setup and single local Windows 10 VM with a bunch of in progress SQL development happening.
          VM is located in /home/kvm_store
          /home is mounted from the 4TB HDD

          New Desktop
          Fedora 27 + Cinnamon
          256GB m.2 SSD + existing 4TB HDD will be relocated here
          /home will remain mounted on the SSD
          /home/kvm_store will be mounted to the HDD

          User is the same. group ID was setup the same. what can I do to ensure that this VM continues to run?

          Where are the KVM settings stored so I can migrated them?
          Should I export the qcow2 and just set things up again?
          Can I just move the disk and mount things and hope it powers up?

          I've reloaded a few times from scratch, and all I ever did was copied the .qcow2 or .img file, nothing more.

          Then reloaded, and copied back the virtual disks to where I wnat them... usually /home/uername/vms.

          All I did was recreated the virtual machines using existing virtual disk and merrily went on my way.

          If they don't boot, it's either because I forgot to change from IDE to SATA, or forgot to change from BIOS to UEFI. Other than that never had an issue.

          1 Reply Last reply Reply Quote 1
          • ObsolesceO
            Obsolesce @JaredBusch
            last edited by

            @jaredbusch said in how do I migrate my KVM settings to a new desktop:

            Can I just move the disk and mount things and hope it powers up?

            Yeah that's basically what I said above.

            Move your disks, reload, move them back... re-setup your VM using existing disk.

            1 Reply Last reply Reply Quote 1
            • ObsolesceO
              Obsolesce @black3dynamite
              last edited by

              @black3dynamite said in how do I migrate my KVM settings to a new desktop:

              Not sure how to backup KVM Host settings but here's how I backed up my VM

              # Backup VM config and copy qcow2 image
              sudo virsh vmname > /media/backup/vmname.xml
              cp /home/user/libvirt/vmname.qcow2 /media/backup
              
              # Restore VM config and copy qcow2 image
              cp /media/backup/vmname.qcow2 /home/user/libvirt
              sudo virsh define --file /media/backup/vmname.xml
              

              I'll try this next time I need to reload or something. Looks a little quicker than setting things back up again manually.

              black3dynamiteB 1 Reply Last reply Reply Quote 1
              • black3dynamiteB
                black3dynamite @Obsolesce
                last edited by black3dynamite

                @tim_g said in how do I migrate my KVM settings to a new desktop:

                I've updated my response with some corrections. To backup the VM config, you have to use sudo virsh dumpxml vmname and added sudo in front of cp.

                1 Reply Last reply Reply Quote 1
                • JaredBuschJ
                  JaredBusch
                  last edited by

                  That is kind of what I expected, but I had not done it yet.

                  1 Reply Last reply Reply Quote 0
                  • JaredBuschJ
                    JaredBusch @black3dynamite
                    last edited by

                    @black3dynamite said in how do I migrate my KVM settings to a new desktop:

                    Not sure how to backup KVM Host settings but here's how I backed up my VM

                    # Backup VM config and copy qcow2 image
                    sudo virsh dumpxml vmname > /media/backup/vmname.xml
                    sudo cp /home/user/libvirt/vmname.qcow2 /media/backup
                    
                    # Restore VM config and copy qcow2 image
                    sudo cp /media/backup/vmname.qcow2 /home/user/libvirt
                    sudo virsh define --file /media/backup/vmname.xml
                    

                    This was perfect.

                    I did not copy the qcow2 as I moved the actual drive to the machine. I did edit the XML to point the vdisk to the new location.

                    Imported the xml, booted the VM.

                    Perfection.

                    1 Reply Last reply Reply Quote 4
                    • FATeknollogeeF
                      FATeknollogee
                      last edited by

                      Can you "virsh dumpxml vmname" while the vm is running?

                      black3dynamiteB 1 Reply Last reply Reply Quote 0
                      • black3dynamiteB
                        black3dynamite @FATeknollogee
                        last edited by

                        @fateknollogee said in how do I migrate my KVM settings to a new desktop:

                        Can you "virsh dumpxml vmname" while the vm is running?

                        Yes.

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