adh_cache.py
def calculate_utilization(self):
        '''Calculate the utilization of the host. Fill in the host size and then iterate all hosted VMs to calculate utilization. 
        '''
        # logger.debug ("dedicated_host: calculate_utilization:Enter")
        self.utilized_cores = 0
        self.utilized_mem = 0 
        if (self.total_cores == 0 or self.total_mem == 0):
            self.total_cores = SKUS.host_skus[self.sku]["core_count"]
            self.total_mem = SKUS.host_skus[self.sku]["mem_size"]
        
        for vm_name, vm in self.vm_list.items():
            if vm.size:
                vm.core_count = SKUS.vm_skus[vm.size]["cpu_count"]
                self.utilized_cores += vm.core_count
                vm.mem_size = SKUS.vm_skus[vm.size]["mem_size"]
                self.utilized_mem += vm.mem_size
        
        self.available_cores=self.total_cores - self.utilized_cores
        self.available_mem = self.total_mem - self.utilized_mem
        
        logger.debug ("DedicatedHost: %s, group %s, %s, FD: %s ,%d VMs, Utilization(used/total): Cores %d / %d; Mem %d / %d", \
            self.name,self.group_name, self.sku, self.fault_domain, len(self.vm_list), self.utilized_cores, self.total_cores,self.utilized_mem, self.total_mem)
Calculate the utilization of the host. Fill in the host size and then iterate all hosted VMs to calculate utilization. 
        
Calculate the utilization of the host. Fill in the host size and then iterate all hosted VMs to calculate utilization.
Calculate the utilization of the host . Fill in the host size and then iterate all hosted VMs to calculate utilization .
def calculate_utilization(self):
        self.utilized_cores = 0
        self.utilized_mem = 0 
        if (self.total_cores == 0 or self.total_mem == 0):
            self.total_cores = SKUS.host_skus[self.sku]["core_count"]
            self.total_mem = SKUS.host_skus[self.sku]["mem_size"]
        for vm_name, vm in self.vm_list.items():
            if vm.size:
                vm.core_count = SKUS.vm_skus[vm.size]["cpu_count"]
                self.utilized_cores += vm.core_count
                vm.mem_size = SKUS.vm_skus[vm.size]["mem_size"]
                self.utilized_mem += vm.mem_size
        self.available_cores=self.total_cores - self.utilized_cores
        self.available_mem = self.total_mem - self.utilized_mem
        logger.debug ("DedicatedHost: %s, group %s, %s, FD: %s ,%d VMs, Utilization(used/total): Cores %d / %d; Mem %d / %d", \
            self.name,self.group_name, self.sku, self.fault_domain, len(self.vm_list), self.utilized_cores, self.total_cores,self.utilized_mem, self.total_mem)
def calculate_utilization ( self ) : self . utilized_cores = 0 self . utilized_mem = 0 if ( self . total_cores == 0 or self . total_mem == 0 ) : self . total_cores = SKUS . host_skus [ self . sku ] [ "core_count" ] self . total_mem = SKUS . host_skus [ self . sku ] [ "mem_size" ] for vm_name , vm in self . vm_list . items ( ) : if vm . size : vm . core_count = SKUS . vm_skus [ vm . size ] [ "cpu_count" ] self . utilized_cores += vm . core_count vm . mem_size = SKUS . vm_skus [ vm . size ] [ "mem_size" ] self . utilized_mem += vm . mem_size self . available_cores = self . total_cores - self . utilized_cores self . available_mem = self . total_mem - self . utilized_mem logger . debug ( "DedicatedHost: %s, group %s, %s, FD: %s ,%d VMs, Utilization(used/total): Cores %d / %d; Mem %d / %d" , self . name , self . group_name , self . sku , self . fault_domain , len ( self . vm_list ) , self . utilized_cores , self . total_cores , self . utilized_mem , self . total_mem )
Calculate the utilization of the host.
Calculate the utilization of the host .
'''Calculate the utilization of the host. Fill in the host size and then iterate all hosted VMs to calculate utilization. 
        ''' # logger.debug ("dedicated_host: calculate_utilization:Enter")
self