@classmethod
  def GetInstanceConsole(cls, instance, primary_node, # pylint: disable=W0221
                         node_group, hvparams, beparams, root_dir=None):
    if root_dir is None:
      root_dir = cls._InstanceDir(instance.name)
      if not os.path.ismount(root_dir):
        raise HypervisorError("Instance %s is not running" % instance.name)

    ndparams = node_group.FillND(primary_node)
    return objects.InstanceConsole(instance=instance.name,
                                   kind=constants.CONS_SSH,
                                   host=primary_node.name,
                                   port=ndparams.get(constants.ND_SSH_PORT),
                                   user=constants.SSH_CONSOLE_USER,
                                   command=["chroot", root_dir])
Return information for connecting to the console of an instance.
dataset/ETHPy150Open ganeti/ganeti/lib/hypervisor/hv_chroot.py/ChrootManager.GetInstanceConsole