def GetInstanceInfo(self, instance_name, hvparams=None):
    """Get instance properties.

    @type instance_name: string
    @param instance_name: the instance name
    @type hvparams: dict of strings
    @param hvparams: hvparams to be used with this instance

    @return: tuple of (name, id, memory, vcpus, stat, times)

    """
    file_name = self._InstanceFile(instance_name)
    if not os.path.exists(file_name):
      return None
    try:
      fh = open(file_name, "r")
      try:
        inst_id = fh.readline().strip()
        memory = utils.TryConvert(int, fh.readline().strip())
        vcpus = utils.TryConvert(int, fh.readline().strip())
        stat = hv_base.HvInstanceState.RUNNING
        times = 0
        return (instance_name, inst_id, memory, vcpus, stat, times)
      finally:
        fh.close()
    except __HOLE__, err:
      raise errors.HypervisorError("Failed to list instance %s: %s" %
                                   (instance_name, err))
dataset/ETHPy150Open ganeti/ganeti/lib/hypervisor/hv_fake.py/FakeHypervisor.GetInstanceInfo