コード例 #1
0
ファイル: vms.py プロジェクト: remiphilippe/vmware-pyvmomi
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
コード例 #2
0
ファイル: vms.py プロジェクト: remiphilippe/vmware-pyvmomi
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