def hostActionSetCosMemory(_context): '''Tells vmkctl to set the Console OS memory size. This is also done in the bootloader, however vmkctl will nuke it upon rebooting. ''' from precheck import getConsoleMemorySize # avoid circular imports mem = vmkctl.MemoryInfoImpl() currentMemSize = mem.GetServiceConsoleReservedMem() cosMemory = getConsoleMemorySize(currentMemSize, mem.GetPhysicalMemory() / 1024 / 1024) mem.SetServiceConsoleReservedMem(cosMemory, True)
def compareCosMemSize(memSize, expectedCosSize): physicalMem = memSize / 1024 / 1024 assert precheck.getConsoleMemorySize(272, physicalMem) == expectedCosSize