Skip to content

Instantly share code, notes, and snippets.

@timogoebel
Created January 9, 2017 18:53
Show Gist options
  • Save timogoebel/67ed5d62b02d2a125c07a0d96c249338 to your computer and use it in GitHub Desktop.
Save timogoebel/67ed5d62b02d2a125c07a0d96c249338 to your computer and use it in GitHub Desktop.
fog-vsphere debug
Script to collect some debug information for:
http://projects.theforeman.org/issues/17883
How to use?
1. check out this repo
2. bundle install
3. bundle exec ./test_cluster.rb
4. Provide the debug output
source 'https://rubygems.org'
gem 'fog'
gem 'fog-vsphere'
gem 'awesome_print'
#!/usr/bin/env ruby
require 'fog'
require 'awesome_print'
client = ::Fog::Compute.new(
:provider => 'vsphere',
:vsphere_username => 'USERNAME',
:vsphere_password => 'PASSWORD',
:vsphere_server => 'SERVER',
:vsphere_expected_pubkey_hash => 'PUBKEY-Hash', # value is printed if left empty
)
datacenter = 'DATACENTER'
cluster = 'Lomaco (Figeac)/Cluster Clients'
puts "List all datacenters:"
ap client.datacenters.all
puts "Show datacenter #{datacenter}:"
dc = client.datacenters.get(datacenter)
ap dc
puts "List all clusters:"
ap dc.clusters.all
puts "Show cluster #{cluster}:"
cl = dc.clusters.get(cluster)
ap cl
puts "List resource pools for cluster #{cluster}:"
ap cl.resource_pools.all(:accessible => true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment