def GetInstanceConsole(cluster, instance, primary_node, node_group):
  hyper = hypervisor.GetHypervisorClass(instance.hypervisor)
  # beparams and hvparams are passed separately, to avoid editing the
  # instance and then saving the defaults in the instance itself.
  hvparams = cluster.FillHV(instance)
  beparams = cluster.FillBE(instance)
  console = hyper.GetInstanceConsole(instance, primary_node, node_group,
                                     hvparams, beparams)

  assert console.instance == instance.name
  console.Validate()

  return console.ToDict()
Returns console information for an instance.
dataset/ETHPy150Open ganeti/ganeti/lib/cmdlib/instance_operation.py/GetInstanceConsole