<div dir="ltr">Facter essentially does a "tail -1" of the output of virt-what.<div><br>The facter people aren't responding to their own bug reports (in several weeks, at least), I don't know what the deal is. See, for instance, <a href="https://tickets.puppetlabs.com/browse/FACT-1170">https://tickets.puppetlabs.com/browse/FACT-1170</a><br><br>Rich has explained to me that virt-what must, on occasion, report multiple "facts'. However, TBMK, this order is not defined a priori -- merely by the current implementation. So Facter is essentially relying on an unreliable characteristic of this program.<br><br>Given facter's use case, it would probably be better if it did not use virt-what at all, or used a different fact structure (like they did with os/osfamily). If you want to hack facter, look for a file named "virtual.rb" within the facter hierarchy.<br><br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 11, 2016 at 3:18 PM, Matthew Gyurgyik <span dir="ltr"><<a href="mailto:gyurgyikms@ornl.gov" target="_blank">gyurgyikms@ornl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 16-04-09 08:00:25, Richard W.M. Jones wrote:<br>
> On Fri, Apr 01, 2016 at 01:25:57PM -0400, Matthew Gyurgyik wrote:<br>
> > Looking at <a href="http://virt-what.in" rel="noreferrer" target="_blank">virt-what.in</a> there does not appear to be any order in which<br>
> > facts are ordered/printed.<br>
> ><br>
> > I have a systemd-spawn container running on a vmware guest and receive<br>
> > the following output.<br>
> ><br>
> > -bash-4.2# virt-what<br>
> > vmware<br>
> > lxc<br>
> ><br>
> > However, it would appear that if I was running kvm with docker, lxc<br>
> > would be listed first followed by kvm.<br>
> ><br>
> > The reason I raise this question - I noticed facter[1] was returning<br>
> > vmware instead of lxc. I dug in the code and found out that facter is<br>
> > calling virt-what and is returning the first result.<br>
><br>
> This is facter being buggy ...<br>
><br>
> > If the hypevisor was printed first and then the container second I could<br>
> > submit a patch to parse the last line of output.<br>
><br>
> Basically there is no defined order of facts.  Facter should be fixed<br>
> so it follows the virt-what API, which is well-documented in the<br>
> manual.<br>
><br>
> Rich.<br>
><br>
> --<br>
> Richard Jones, Virtualization Group, Red Hat <a href="http://people.redhat.com/~rjones" rel="noreferrer" target="_blank">http://people.redhat.com/~rjones</a><br>
> Read my programming and virtualization blog: <a href="http://rwmj.wordpress.com" rel="noreferrer" target="_blank">http://rwmj.wordpress.com</a><br>
> virt-top is 'top' for virtual machines.  Tiny program with many<br>
> powerful monitoring features, net stats, disk stats, logging, etc.<br>
> <a href="http://people.redhat.com/~rjones/virt-top" rel="noreferrer" target="_blank">http://people.redhat.com/~rjones/virt-top</a><br>
><br>
<br>
</div></div>Thanks for the information. I'll follow up with the facter folks.<br>
<br>
Cheers,<br>
Matthew<br>
<div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
virt-tools-list mailing list<br>
<a href="mailto:virt-tools-list@redhat.com">virt-tools-list@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/virt-tools-list" rel="noreferrer" target="_blank">https://www.redhat.com/mailman/listinfo/virt-tools-list</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Otheus<div><a href="mailto:otheus.uibk@gmail.com" target="_blank">otheus.uibk@gmail.com</a></div><div><a href="mailto:otheus.shelling@uibk.ac.at" target="_blank">otheus.shelling@uibk.ac.at</a></div><div><br></div></div></div>
</div>