Upgrading the host

Laine Stump laine at redhat.com
Wed Feb 17 13:27:32 UTC 2021


On 2/17/21 3:11 AM, Michal Privoznik wrote:
> On 2/17/21 2:59 AM, Marcin Struzak wrote:
>> On 2/16/2021 1:02 AM, Erik Skultety wrote:
>>> [...]
>>> Needless to say, if you're backing up /etc/libvirt/<whatever> make sure
>>> libvirtd is down first, so that all the settings are properly dumped 
>>> by the
>>> daemon to the respective XMLs.
> 
> I'm not convinced this is the case - we go great lengths to make sure 
> XMLs are saved onto disk safely and as soon as possible. Not only 
> because users might kill libvirtd, it may also crash.
> 
> But doesn't hurt to shut the daemon off.
> 
>>>
>>> Erik
>>
>> Absolutely!  Not concerned about downtime here, just that after the 
>> upgrade everything comes back up like before.
>>
>> Speaking of settings dumped into XMLs, why are the files in 
>> /etc/libvirt/qemu ever so slightly different from a manual dump using 
>> virsh dumpxml & friends?  E.g., for a domain I have a section
>>
>> <resource>
>>    <partition>/machine</partition>
>> </resource>
>>
>> <alias ... /> entries for all devices, a tty attribute & <source ... 
>> /> for console, etc., in the manual dump only?
> 
> Because 'virsh dumpxml' prints so called live XML if guest is running; 
> or inactive XML if guest is not running. If the guest is running but you 
> want to print the inactive XML you can do 'virsh dumpxml --inactive'.

And by the way, if you're dumping the xml in order to redefine it later, 
you really should us "--inactive" because otherwise the result will be 
more than "slightly" different. In particular, if you have certain types 
of networks that are pools of hostdev or macvtap devices, the 
<interface> elements for those will be <interface type='hostdev|direct'> 
in the status output rather than the <interface type='network'> that you 
would need to properly re-define the domain.

> 
> The difference between live and inactive XML is that the former contains 
> runtime information (like CGroup placement, device aliases generated 
> when guest is created, domain ID, etc.). If you dump inactive XML then 
> the output should be the same as under /etc/libvirt.
> 
> Michal
> 




More information about the libvirt-users mailing list