Ejemplo n.º 1
0
 def find_biggest_pool_and_lss(self, excluded_lss):
     # pools are ordered by capacity
     for pool_id, pool in self._storage_pools.items():
         lss = self._find_lss(pool['node'], excluded_lss)
         if lss:
             return pool_id, lss
     msg = _("All LSS/LCU IDs for configured pools are exhausted.")
     raise restclient.LssIDExhaustError(message=msg)
Ejemplo n.º 2
0
 def find_pool_and_lss(self, excluded_lss=None):
     for pool_id, pool in self._storage_pools.items():
         lss = self._find_lss_for_type_replication(pool['node'],
                                                   excluded_lss)
         if lss:
             return pool_id, lss
     msg = _("All LSS/LCU IDs for configured pools are exhausted.")
     raise restclient.LssIDExhaustError(message=msg)
Ejemplo n.º 3
0
 def find_available_lss(self, pool, find_new_pid, excluded_lss):
     if pool:
         node = int(pool[1:], 16) % 2
         lss = self._find_lss(node, excluded_lss)
         if lss:
             return (pool, lss)
         else:
             if not find_new_pid:
                 msg = _('All LSS/LCU IDs for configured pools on '
                         'storage are exhausted.')
                 raise restclient.LssIDExhaustError(message=msg)
     # find new pool id and lss for lun
     return self.find_biggest_pool_and_lss(excluded_lss)