@staticmethod
  def ShutdownInstances(inst_running):
    names_running = set([i[0] for i in inst_running])
    if names_running:
      logging.info("Following instances should not be running,"
                   " shutting them down: %s", utils.CommaJoin(names_running))
      # this dictionary will collapse duplicate instance names (only
      # xen pvm/vhm) into a single key, which is fine
      i2h = dict(inst_running)
      for name in names_running:
        hv_name = i2h[name]
        hv = hypervisor.GetHypervisor(hv_name)
        hv.StopInstance(None, force=True, name=name)
Shutdown running instances.
dataset/ETHPy150Open ganeti/ganeti/lib/watcher/nodemaint.py/NodeMaintenance.ShutdownInstances