Fedora server upgrade and KVM backup

I have a Fedora Server 36 running for the sole purpose of a KVM host. I’m running a few VMs and want to upgrade to Fedora Server 39.

In order not to lose any of the VMs I want to make a backup - good time to start a regular backup routine. Is it simply a case of backing up the VMs disk (i.e. .qcow2 file) or is there more to making a backup of a VM? I see there’s a virsh backup command as well.

I want to be extra sure these VMs are not affected by the system upgrade

Just backup the image file and the xml file

1 Like

To be fair, the difficulty of this task depends on the complexity of the specific setup that can generally involve hypervisor, storage, network, firewall, and other related configurations, but asking a question like this indicates that your setup is likely more or less trivial.

I have a shell script which shuts down my critical VMs and takes a backup. You can add it to a cron job or drop it into /etc/cron.daily or /etc/cron.weekly.

Have a look at linux - How can i check specific server running or not(using virsh commands), before I start | restart it? - Stack Overflow for the syntax I used for my environment. Basically, I issue a virsh stop of my VM, then once it’s actually stopped, I do a virsh dumpxml and then a cp of the image file to the image file with a date prepended to the name.