Queries the virtual machine config file and returns
    vim.host.DatastoreBrowser.SearchResults object on success None on failure

    name
        Name of the virtual machine

    datacenter
        Datacenter name

    datastore
        Datastore where the virtual machine files are stored

    service_instance
        Service instance (vim.ServiceInstance) of the vCenter.
        Default is None.

def get_vm_config_file(name, datacenter, placement, datastore,
                       service_instance=None):
    '''
    Queries the virtual machine config file and returns
    vim.host.DatastoreBrowser.SearchResults object on success None on failure

    name
        Name of the virtual machine

    datacenter
        Datacenter name

    datastore
        Datastore where the virtual machine files are stored

    service_instance
        Service instance (vim.ServiceInstance) of the vCenter.
        Default is None.
    '''

    browser_spec = vim.host.DatastoreBrowser.SearchSpec()
    directory = name
    browser_spec.query = [vim.host.DatastoreBrowser.VmConfigQuery()]
    datacenter_object = salt.utils.vmware.get_datacenter(service_instance,
                                                         datacenter)
    if 'cluster' in placement:
        container_object = salt.utils.vmware.get_cluster(datacenter_object,
                                                         placement['cluster'])
    else:
        container_objects = salt.utils.vmware.get_hosts(
            service_instance,
            datacenter_name=datacenter,
            host_names=[placement['host']])
        if not container_objects:
            raise salt.exceptions.VMwareObjectRetrievalError(
                'ESXi host named \'{0}\' wasn\'t '
                'found.'.format(placement['host']))
        container_object = container_objects[0]

    # list of vim.host.DatastoreBrowser.SearchResults objects
    files = salt.utils.vmware.get_datastore_files(service_instance,
                                                  directory,
                                                  [datastore],
                                                  container_object,
                                                  browser_spec)
    if files and len(files[0].file) > 1:
        raise salt.exceptions.VMwareMultipleObjectsError(
            'Multiple configuration files found in '
            'the same virtual machine folder')
    elif files and files[0].file:
        return files[0]
    else:
        return None