Beispiel #1
0
 def getAllNodes(self, quattor=False):
     """
     returns all the nodes in this cluster
     (workernodes and masters)
     does not return storage!
     """
     self.log.debug("selecting all nodes (minus storage)")
     nodes = CompositeNode()
     nodes.union(self.getWorkerNodes(quattor=quattor))
     nodes.union(self._getMasters())
     self.log.debug("selected worker and master nodes: %s" % nodes)
     return nodes
Beispiel #2
0
 def _getMasters(self):
     """
     returns the master(s) from this cluster as a list
     """
     # TODO: get these from vsc.quattor
     if not self.masters:
         masterids = self._getMasterNodeIds()
         masternodes = CompositeNode()
         for masterid in masterids:
             masternodes.add(self.masterNodeClass(masterid, self.name))
         self.masters = masternodes
     return self.masters
Beispiel #3
0
 def getStorageNodes(self):
     """
     returns all storage nodes in this cluster
     """
     # TODO: get these from vsc.quattor
     if not self.storagenodes:
         storagenodes = CompositeNode()
         storageids = self._getStorageNodeIds()
         for nodeid in storageids:
             node = self.storageNodeClass(nodeid, self.name)
             storagenodes.add(node)
         self.storagenodes = storagenodes
     return self.storagenodes
Beispiel #4
0
 def getWorkerNodes(self, quattor=False):
     """
     returns all workernodes in this cluster
     if quattor is specified, the quattor dir will be used to look up nodes
     instead of running pbsmon on the master.
     """
     # get my nodes
     # TODO: get these from vsc.quattor
     if not self.workernodes:
         workernodes = CompositeNode()
         workerids = self._getWorkerNodeIds(quattor=quattor)  # get ids
         master = self.getMaster()
         for nodeid in workerids:
             node = self.workerNodeClass(nodeid, self.name, master)
             workernodes.add(node)
         self.workernodes = workernodes
     return self.workernodes