def generate_password(self, vim_session, pool, instance_name):
        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 = json.dumps({'vm_id': vm_ds_path_name,
                    'username': username,
                    'password': password})
        return base64.b64encode(json_data)
Returns VMRC Connection credentials.
dataset/ETHPy150Open nii-cloud/dodai-compute/nova/console/vmrc.py/VMRCConsole.generate_password