Systems Administrator

Case File: Which Host Gets the Machine

Eighteen virtual machines need homes on three hosts. Write the placement rule that treats CPU, RAM and disk differently: CPU may be overcommitted by a ratio, RAM may not and must leave a reserve for the hypervisor, disk is plain capacity. Place each machine on the first host with room, list those that do not fit, and run the placement on clusters you cannot see. The hosts and machines are generated for you alone.

50 min

Sabi Logistics · Virtual 1

Which Host Gets the Machine

We bought three hosts for the consolidation, and the vendor says that everything will fit, but I would like to see it

Musa Head of IT · Phone call

Musa. We are consolidating twenty old servers onto three new hosts. The vendor says everything will fit. I have seen that sentence before, and then a Monday when the hosts ran out of memory and every machine on them slowed to a crawl.

I want the arithmetic. For each host we know the cores, the RAM and the disk. For each machine, the virtual CPUs, the RAM and the disk. Our rules: we allow four virtual CPUs for each physical core, because most servers are idle; we allow no overcommit of RAM, and keep a reserve for the hypervisor itself. Please place the machines in the order of the list, on the first host that has room, and tell me which ones do not fit.

The brief

What you need to know first.

  • CPU can be shared. A physical core can serve many virtual CPUs in turn, as long as they are not all busy at once. A ratio of 4 means that a host with 16 cores can have up to 64 virtual CPUs on it. The limit is cores * ratio.
  • RAM cannot. A machine that has been promised 16 GB needs 16 GB of real memory when it uses it. A host that runs out starts to swap to disk, and everything on it slows down. So the limit is ram_gb - reserve_gb (the reserve keeps memory for the hypervisor and its overhead). Disk is simple capacity.
  • First fit. For each machine in the order given, go through the hosts in the order given and take the first one where all three limits still hold after adding the machine: used vcpu + vcpu <= cores * ratio, used ram + ram <= ram_gb - reserve, used disk + disk <= disk_gb. A limit that is reached exactly still fits. If no host has room, the machine is unplaced. A machine is never split.
  • Return {"placement": {vm: host}, "unplaced": [names in order], "used": {host: {"vcpu", "ram_gb", "disk_gb"}}}. Every host appears in used, even with nothing on it.
  • Fill in place, result, n_placed and most_ram_host (most RAM in use; ties: the name that sorts first). The checks run place on requests that you cannot see, including limits that are hit exactly and an empty list of machines.

The lab gives you the data for this case, invented and generated for you alone. Today is 2026-11-09.

Preparing your data…

On a real system

The lab modelled the rules with a script. These are the commands that you would type on the real thing.

You want toTypeWhat you get
see the cores and memory of a KVM hostvirsh nodeinfoCPU count and memory of the host
see the virtual CPUs and memory of Hyper-V machinesGet-VM | Select-Object Name, ProcessorCount, MemoryAssignedwhat each machine has been given
see the capacity of a Hyper-V hostGet-VMHost | Format-List LogicalProcessorCount, MemoryCapacitythe cores and memory of the host

Only run commands on systems that you own or have written permission to test.

🔒 The debrief unlocks when you close the case. Finish the lab above.

Write the placement note

Write the note for the Head of IT: the three limits and why CPU, RAM and disk are treated differently (ratio, reserve, plain capacity), how the first-fit placement worked and which machines did not fit and which limit stopped them, which host carries the most RAM, why raising the CPU ratio would not help when RAM is the limit, and how to size safely (measured use, headroom for failure, smarter packing, affinity rules, a written policy).

0 words

🧪 Want to practise this on your own computer? See how to set up your lab →

📝

Knowledge Check

1 of 4

A host has 16 cores and the CPU ratio is 4. How many virtual CPUs may it carry under this rule?

Report a problem

About: /lessons/case-the-packing-list