[CentOS] How to upgrade CentOS 6.9 KVM host to 7.4.1708 and not re-install guests

Sun Jan 21 08:19:57 UTC 2018
Fabian Arrotin <arrfab at centos.org>

On 21/01/18 05:24, Paul R. Ganci wrote:
> I have a Windows 7 KVM guest running on a Centos 6.9 KVM host. I would
> like to upgrade the host system to CentOS 7.4.1708 without having to
> re-install from scratch the KVM guest. What procedure should I use to
> move the guest off the host system, upgrade the CentOS version and then
> move the KVM Guest back to the host? For example, Is there a recommended
> way to move the KVM Guest to a USB stick and then move it back to the
> upgraded host? Thank you for your help.
> 

Not enough details but yeah, that's doable with some easy steps (but
then also depends on what you have availble, etc ..)
- shutdown guests
- save all the .qcow2 files (assuming that you don't use raw devices for
backend disks, like for example lvm) from /var/lib/libvirt/images
(default location, but again, it depends on your config)
- export the .xml files used by libvirt to start the nodes
- reinstall the node (there is no way to upgrade from 6 to 7, and fresh
install is always better anyway)
- reconfigure new node with same network bridge (if any, depends on your
situation) and ensure libvirt, qemu-kvm (and deps) are installed/started
- import back .qcow2 files (in /var/lib/libvirt/images)
- "virsh define" against .xml files to configure the VMs on the nodes
- start the VMs

-- 
Fabian Arrotin
The CentOS Project | https://www.centos.org
gpg key: 56BEC54E | twitter: @arrfab

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://lists.centos.org/pipermail/centos/attachments/20180121/74d8dcb4/attachment-0005.sig>