def generate_password(self, vim_session, pool, instance_name):
    "Returns a VMRC Session.\n\n        Return string is of the form '<VM MOID>:<VMRC Ticket>'.\n\n        "
    vms = vim_session._call_method(vim_util, 'get_objects', 'VirtualMachine', ['name'])
    vm_ref = None
    for vm in vms:
        if (vm.propSet[0].val == instance_name):
            vm_ref = vm.obj
    if (vm_ref is None):
        raise exception.InstanceNotFound(instance_id=instance_name)
    virtual_machine_ticket = vim_session._call_method(vim_session._get_vim(), 'AcquireCloneTicket', vim_session._get_vim().get_service_content().sessionManager)
    json_data = jsonutils.dumps({'vm_id': str(vm_ref.value), 'username': virtual_machine_ticket, 'password': virtual_machine_ticket})
    return base64.b64encode(json_data)
Returns a VMRC Session.

Return string is of the form '<VM MOID>:<VMRC Ticket>'.
def generate_password(self, vim_session, pool, instance_name):
    "Returns a VMRC Session.\n\n        Return string is of the form '<VM MOID>:<VMRC Ticket>'.\n\n        "
    vms = vim_session._call_method(vim_util, 'get_objects', 'VirtualMachine', ['name'])
    vm_ref = None
    for vm in vms:
        if (vm.propSet[0].val == instance_name):
            vm_ref = vm.obj
    if (vm_ref is None):
        raise exception.InstanceNotFound(instance_id=instance_name)
    virtual_machine_ticket = vim_session._call_method(vim_session._get_vim(), 'AcquireCloneTicket', vim_session._get_vim().get_service_content().sessionManager)
    json_data = jsonutils.dumps({'vm_id': str(vm_ref.value), 'username': virtual_machine_ticket, 'password': virtual_machine_ticket})
    return base64.b64encode(json_data)