Skip to content
home@dennisPersonal Website of Dennis Plöger
  • Home
  • Blog
  • Artist
  • Impressum
  • Datenschutzerklärung

vm2host for vSphere 4

1. Februar 2012

I recently twittered about a neat little new script of mine called hostForVm, which tells you on which host a specific vm runs or which vms run on a specific host. Done using [[http://www.python.org|python]],[[https://fedorahosted.org/suds|suds]] and the [[http://communities.vmware.com/community/vmtn/developer/forums/managementapi|vSphere Web SDK]].

The script is available at github:

[[https://github.com/dploeger/hostForVm]]

One thing to note: If you use the script to work against a vSphere 4-vCenter Server, be sure to do a nasty patching of suds, as vSphere 4 expects all types to be NOT prefixed with :type, which suds (naturally) does.

To patch that functionality out of suds (and make suds useless for the rest of your installation :-(), change the Following around line #90 of /suds/mx/typer.py:


xta = ':'.join((NS.xsins[0], 'type'))
node.addPrefix(NS.xsins[0], NS.xsins[1])
if ns is None:

to


xta = ':'.join((NS.xsins[0], 'type'))
xta = None
node.addPrefix(NS.xsins[0], NS.xsins[1])
if ns is None:

(add xta = None)

This is sad, but fixed in vSphere 5. So upgrade to vSphere 5 if you’re bothered by it.

Neueste Beiträge

  • Making Puppet host reports in Foreman available in Grafana
  • Introducing Handler Inspector
  • Github Action for the Godot Asset library
  • Announcing EgoVenture
  • The third installment of my learning project

Schlagwörter

administration apache blog configuration configuration management development dhcp disclaimer django documentation dokuwiki extension footer hammerspoon java javascript jslint keyboard lbows linux log migration milter news php plugin printer python rest rhino server shortcut skd soap social ssh survey twitter ubuntu vmware website window management zimbra zimlet zimlets

Meta

  • Anmelden
  • Eintrags-Feed
  • Kommentar-Feed
  • WordPress.org

Neueste Beiträge

  • Making Puppet host reports in Foreman available in Grafana
  • Introducing Handler Inspector
  • Github Action for the Godot Asset library
  • Announcing EgoVenture
  • The third installment of my learning project

Schlagwörter

administration apache blog configuration configuration management development dhcp disclaimer django documentation dokuwiki extension footer hammerspoon java javascript jslint keyboard lbows linux log migration milter news php plugin printer python rest rhino server shortcut skd soap social ssh survey twitter ubuntu vmware website window management zimbra zimlet zimlets

Meta

  • Anmelden
  • Eintrags-Feed
  • Kommentar-Feed
  • WordPress.org

Copyright (c) Dennis Plöger | Theme by ThemeinProgress | Proudly powered by WordPress

Zum Ändern Ihrer Datenschutzeinstellung, z.B. Erteilung oder Widerruf von Einwilligungen, klicken Sie hier: Einstellungen