Re: [virt-what] Should there be an order in which facts are printed?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Facter essentially does a "tail -1" of the output of virt-what.

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, https://tickets.puppetlabs.com/browse/FACT-1170

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.

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.



On Mon, Apr 11, 2016 at 3:18 PM, Matthew Gyurgyik <gyurgyikms@xxxxxxxx> wrote:
On 16-04-09 08:00:25, Richard W.M. Jones wrote:
> On Fri, Apr 01, 2016 at 01:25:57PM -0400, Matthew Gyurgyik wrote:
> > Looking at virt-what.in there does not appear to be any order in which
> > facts are ordered/printed.
> >
> > I have a systemd-spawn container running on a vmware guest and receive
> > the following output.
> >
> > -bash-4.2# virt-what
> > vmware
> > lxc
> >
> > However, it would appear that if I was running kvm with docker, lxc
> > would be listed first followed by kvm.
> >
> > The reason I raise this question - I noticed facter[1] was returning
> > vmware instead of lxc. I dug in the code and found out that facter is
> > calling virt-what and is returning the first result.
>
> This is facter being buggy ...
>
> > If the hypevisor was printed first and then the container second I could
> > submit a patch to parse the last line of output.
>
> Basically there is no defined order of facts.  Facter should be fixed
> so it follows the virt-what API, which is well-documented in the
> manual.
>
> Rich.
>
> --
> Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
> Read my programming and virtualization blog: http://rwmj.wordpress.com
> virt-top is 'top' for virtual machines.  Tiny program with many
> powerful monitoring features, net stats, disk stats, logging, etc.
> http://people.redhat.com/~rjones/virt-top
>

Thanks for the information. I'll follow up with the facter folks.

Cheers,
Matthew

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list



--
_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list

[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux