2

I have 100 servers with RHEL that I would like to run VMware tools. I have written a Puppet-module that can install VMware tools, just using package {}:

package { 'vmware-tools-esx-nox':
    ensure => installed,
}

It would be nice to have a list of servers that do not have the vmware-tools package installed. How can Puppet help me find out what servers do not have VMware Tools installed?

ujjain
  • 3,963
  • 15
  • 50
  • 88

4 Answers4

2

If you have applied that module to all nodes, then the answer should be 'none'. The puppetmaster reporting will tell you as each server is brought into compliance.

The vSphere client will tell you which VMs have vmware tools installed NOW though.

Here's a sample in PowerShell (using VMWare's PowerCLI), listing VMs having no (or no current) tools installed:

get-VM | Get-View | `
   ? { $_.Guest.ToolsStatus -match "toolsNotInstalled" -or `
      $_.Guest.ToolsVersionStatus -ne "guestToolsCurrent" } | `
   select Name, `
      @{Name="Status"; Expression={$_.Guest.ToolsStatus}}, `
      @{Name="Version"; Expression={$_.Guest.ToolsVersionStatus}} | `
   format-table
fuero
  • 9,413
  • 1
  • 35
  • 40
AnotherHowie
  • 206
  • 3
  • 13
0

Yes, you can use Puppet for this... You can check files, or the service or installation bundle. The PowerCLI approach works, too, but it probably less helpful in your environment.

Another consideration is to use the VMware Operating System Specific Packages (OSPs).

See: How do I make sure VMware Tools is installed and running?

This allows you to manage the VMware tools packages with native RPMs and YUM, versus the clunky vSphere client approach. It's probably a good idea for an environment with the number of systems yours has.

ewwhite
  • 194,921
  • 91
  • 434
  • 799
0

I do realise that this could be construed as plugging my own solution, but I have actually written a Puppet module (PuppetForge) to control VMware Tools installations via the tarball archive distributed with vSphere/ESX, rather than using the OSP or open-vm-tools packages.

Once you're using the module (or any module for that matter), you can easily use the vSphere client to see which of your VMs doesn't have the tools configured and running.

Craig Watson
  • 9,370
  • 3
  • 30
  • 46
0

I decided to work with my own custom facts to analyze the current set-up on multiple servers. This data will be mined with PuppetDB and can provide beautiful reports.

/etc/puppet/modules/facter/lib/facter/extra_info.rb:

# vmware installed?
Facter.add("vmtools_installed") do
  setcode do
    File.exists?('/usr/bin/vmware-toolbox-cmd')
  end
end

# vmware-running?
Facter.add("vmtools_version") do
  setcode do
    Facter::Util::Resolution::exec('/usr/bin/vmware-toolbox-cmd -v')
  end
end

Another module called "VMTools" installs the VMWare Tools rpm-package (from RHN Satellite) if VMWare Tools is not installed. The same module will update VMWare Tools to the latest package if it's not running the latest version of VMware Tools.

ujjain
  • 3,963
  • 15
  • 50
  • 88