Skip to content

Instantly share code, notes, and snippets.

@joshcoen
joshcoen / getorphanedvms
Last active August 29, 2015 14:00
Find virtual machines on datastores not registered in the vCenter Inventory
from optparse import OptionParser, make_option
from pyVim.connect import SmartConnect, Disconnect
from pyVmomi import vim, vmodl
import argparse
import atexit
import sys
import urllib2, urlparse, base64
vmxPath = []
dsVM = {}