On Sat, Aug 31, 2024 at 01:36:52AM +0200, Jérôme Charaoui wrote: > If you look at the virt-what resolver [0], it's just matching for > strings in the output. If the output of virt-what contains both > 'xen-hvm' and 'xen-dom0' then 'xenhvm' is going to be used because > 'xen-hvm' will match first. It's possible we might want to actually > match for 'xen-dom0' *first*, but this all depends on virt-what's full > output. > > Would it be possible to share here what virt-what is outputting both on > dom0 and domU?
Here is a fresh transcript from a bookworm dom0: -------------------------------------------------- # virt-what --version 1.25 # virt-what xen xen-hvm # facter virtual xenhvm # apt-get purge virt-what Reading package lists... Done Building dependency tree... Done Reading state information... Done The following packages will be REMOVED: virt-what* 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. After this operation, 50.2 kB disk space will be freed. Do you want to continue? [Y/n] (Reading database ... 87238 files and directories currently installed.) Removing virt-what (1.25-1) ... Processing triggers for man-db (2.11.2-2) ... # facter virtual xen0 ------------------------------------------------- So no, the output of virt-what does not contain "xen-dom0" at all. In a (PVH) bookworm domU: ------------------------------------------------- # virt-what --version 1.25 # virt-what xen xen-domU # facter virtual xen # apt-get purge virt-what Reading package lists... Done Building dependency tree... Done Reading state information... Done The following packages will be REMOVED: virt-what* 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. After this operation, 50.2 kB disk space will be freed. Do you want to continue? [Y/n] (Reading database ... 84955 files and directories currently installed.) Removing virt-what (1.25-1) ... Processing triggers for man-db (2.11.2-2) ... # facter virtual xenu -------------------------------------------------------- I also think it's wrong for the fact value to depend on whether virt-what is installed. (In a guest, I get "xenu" if virt-what is absent, "xen" if it is present. This adds unnecessary complexity to Puppet manifests.) As far as I'm concerned facter should not use virt-what. I achieve this on my systems by removing virt-what (I had to re-add it manually in order to produce the test output above).

