def generate_password(self, vim_session, pool, instance_name):
    "Returns VMRC Connection credentials.\n\n        Return string is of the form '<VM PATH>:<ESX Username>@<ESX Password>'.\n\n        "
    (username, password) = (pool['username'], pool['password'])
    vms = vim_session._call_method(vim_util, 'get_objects', 'VirtualMachine', ['name', 'config.files.vmPathName'])
    vm_ds_path_name = None
    vm_ref = None
    for vm in vms:
        vm_name = None
        ds_path_name = None
        for prop in vm.propSet:
            if (prop.name == 'name'):
                vm_name = prop.val
            elif (prop.name == 'config.files.vmPathName'):
                ds_path_name = prop.val
        if (vm_name == instance_name):
            vm_ref = vm.obj
            vm_ds_path_name = ds_path_name
            break
    if (vm_ref is None):
        raise exception.InstanceNotFound(instance_id=instance_name)
    json_data = jsonutils.dumps({'vm_id': vm_ds_path_name, 'username': username, 'password': password})
    return base64.b64encode(json_data)
Returns VMRC Connection credentials.

Return string is of the form '<VM PATH>:<ESX Username>@<ESX Password>'.
def generate_password(self, vim_session, pool, instance_name):
    "Returns VMRC Connection credentials.\n\n        Return string is of the form '<VM PATH>:<ESX Username>@<ESX Password>'.\n\n        "
    (username, password) = (pool['username'], pool['password'])
    vms = vim_session._call_method(vim_util, 'get_objects', 'VirtualMachine', ['name', 'config.files.vmPathName'])
    vm_ds_path_name = None
    vm_ref = None
    for vm in vms:
        vm_name = None
        ds_path_name = None
        for prop in vm.propSet:
            if (prop.name == 'name'):
                vm_name = prop.val
            elif (prop.name == 'config.files.vmPathName'):
                ds_path_name = prop.val
        if (vm_name == instance_name):
            vm_ref = vm.obj
            vm_ds_path_name = ds_path_name
            break
    if (vm_ref is None):
        raise exception.InstanceNotFound(instance_id=instance_name)
    json_data = jsonutils.dumps({'vm_id': vm_ds_path_name, 'username': username, 'password': password})
    return base64.b64encode(json_data)