
Greetings, I'd like to migrate my current libvirt config from one machine to another, what is the best way to do so? Thanks

On 11/29/21 17:37, daggs wrote:
Greetings,
I'd like to migrate my current libvirt config from one machine to another, what is the best way to do so?
Thanks
Do you mean domain/network/... XMLs or {libvirtd,qemu,...}.config files? For the former I suggest 'virsh dumpxml $dom > dom.xml' and copying over the file onto new machine and defining the domain again 'virsh define dom.xml' (s/dumpxml/net-dumpxml/ and s/define/net-define/ for networks and so on). If you run new enough libvirt there's even 'virsh migrate --offline' that encapsulates steps from above. For the latter just copy over the files onto new machine. In theory, copying over XMLs should work too, but we don't really like seeing users touching those behind libvirt's back as 'virsh define' does more than just saving the XML file. Michal

Greetings Michal,
Sent: Tuesday, November 30, 2021 at 10:28 AM From: "Michal Prívozník" <mprivozn@redhat.com> To: "daggs" <daggs@gmx.com>, libvirt-users@redhat.com Subject: Re: migrate libvirt config between machines
On 11/29/21 17:37, daggs wrote:
Greetings,
I'd like to migrate my current libvirt config from one machine to another, what is the best way to do so?
Thanks
Do you mean domain/network/... XMLs or {libvirtd,qemu,...}.config files?
For the former I suggest 'virsh dumpxml $dom > dom.xml' and copying over the file onto new machine and defining the domain again 'virsh define dom.xml' (s/dumpxml/net-dumpxml/ and s/define/net-define/ for networks and so on).
If you run new enough libvirt there's even 'virsh migrate --offline' that encapsulates steps from above.
For the latter just copy over the files onto new machine.
In theory, copying over XMLs should work too, but we don't really like seeing users touching those behind libvirt's back as 'virsh define' does more than just saving the XML file.
Michal
I meant both. the src machine runs libvirt 7.8.0, the dest runs 7.9.0 so virsh migrate --offline + copy /etc/libvirt? Thanks, Dagg

On Tue, Nov 30, 2021 at 09:28:36AM +0100, Michal Prívozník wrote:
On 11/29/21 17:37, daggs wrote:
Greetings,
I'd like to migrate my current libvirt config from one machine to another, what is the best way to do so?
Thanks
Do you mean domain/network/... XMLs or {libvirtd,qemu,...}.config files?
For the former I suggest 'virsh dumpxml $dom > dom.xml' and copying over the file onto new machine and defining the domain again 'virsh define dom.xml' (s/dumpxml/net-dumpxml/ and s/define/net-define/ for networks and so on).
If you run new enough libvirt there's even 'virsh migrate --offline' that encapsulates steps from above.
NB, i'm not sure this is clever enough to copy across the TPM state or the EDK variables state, if you're using such feature. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

Greetings Daniel,
Sent: Tuesday, November 30, 2021 at 2:11 PM From: "Daniel P. Berrangé" <berrange@redhat.com> To: "Michal Prívozník" <mprivozn@redhat.com> Cc: "daggs" <daggs@gmx.com>, libvirt-users@redhat.com Subject: Re: migrate libvirt config between machines
On Tue, Nov 30, 2021 at 09:28:36AM +0100, Michal Prívozník wrote:
On 11/29/21 17:37, daggs wrote:
Greetings,
I'd like to migrate my current libvirt config from one machine to another, what is the best way to do so?
Thanks
Do you mean domain/network/... XMLs or {libvirtd,qemu,...}.config files?
For the former I suggest 'virsh dumpxml $dom > dom.xml' and copying over the file onto new machine and defining the domain again 'virsh define dom.xml' (s/dumpxml/net-dumpxml/ and s/define/net-define/ for networks and so on).
If you run new enough libvirt there's even 'virsh migrate --offline' that encapsulates steps from above.
NB, i'm not sure this is clever enough to copy across the TPM state or the EDK variables state, if you're using such feature.
Regards, Daniel
it is the same system, different os, I'm trying to validate if the new os is better for what I need Thanks, Dagg
participants (3)
-
daggs
-
Daniel P. Berrangé
-
Michal Prívozník