def get_vm_by_ip(ip): si = get_vmware() # http://pubs.vmware.com/vsphere-55/topic/com.vmware.wssdk.apiref.doc/vim.SearchIndex.html search_index = si.content.searchIndex vm = search_index.FindByIp(None, ip, True) print_vm_details(vm) return vm
def get_vm_by_path(path): si = get_vmware() # http://pubs.vmware.com/vsphere-55/topic/com.vmware.wssdk.apiref.doc/vim.SearchIndex.html search_index = si.content.searchIndex vm = search_index.FindByInventoryPath(path) print_vm_details(vm) return vm