def _to_dict(self): # NOTE(sahid): Used as legacy, could be renamed in # _legacy_to_dict_ to the future to avoid confusing. return {'cpus': hardware.format_cpu_spec(self.cpuset, allow_ranges=False), 'mem': {'total': self.memory}, 'id': self.id, 'pagesize': self.pagesize}
def _to_dict(self): return { 'id': self.id, 'cpus': hardware.format_cpu_spec( self.cpuset, allow_ranges=False), 'mem': { 'total': self.memory, 'used': self.memory_usage}, 'cpu_usage': self.cpu_usage}
def _to_dict(self): return { 'id': self.id, 'cpus': hardware.format_cpu_spec(self.cpuset, allow_ranges=False), 'mem': { 'total': self.memory, 'used': self.memory_usage }, 'cpu_usage': self.cpu_usage }
def to_dict_legacy(self, host_topology): cells = [] for cell in host_topology.cells: cells.append( {'cpus': hardware.format_cpu_spec( cell.cpuset, allow_ranges=False), 'mem': {'total': cell.memory, 'limit': cell.memory * self.ram_allocation_ratio}, 'cpu_limit': len(cell.cpuset) * self.cpu_allocation_ratio, 'id': cell.id}) return {'cells': cells}
def _to_dict(self): # NOTE(sahid): Used as legacy, could be renamed in # _legacy_to_dict_ to the future to avoid confusing. return { 'cpus': hardware.format_cpu_spec(self.cpuset, allow_ranges=False), 'mem': { 'total': self.memory }, 'id': self.id, 'pagesize': self.pagesize }
def to_dict_legacy(self, host_topology): cells = [] for cell in host_topology.cells: cells.append({ 'cpus': hardware.format_cpu_spec(cell.cpuset, allow_ranges=False), 'mem': { 'total': cell.memory, 'limit': cell.memory * self.ram_allocation_ratio }, 'cpu_limit': len(cell.cpuset) * self.cpu_allocation_ratio, 'id': cell.id }) return {'cells': cells}