Created
January 9, 2017 18:53
-
-
Save timogoebel/67ed5d62b02d2a125c07a0d96c249338 to your computer and use it in GitHub Desktop.
fog-vsphere debug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
gem 'fog' | |
gem 'fog-vsphere' | |
gem 'awesome_print' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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