Rethinking Resources

After several days of intense discussions at the Vancouver OpenStack Summit, it's clear to me that we have a giant pile of technical debt in the scheduler, based on the way we think about resources in a cloud environment. This needs to change.

In the beginning there were numerous compute resources that were managed by Nova. Theoretically, they could be divided up in any way you wanted, but some combinations really didn't make sense. For example, a single server with 4 CPUs, 32GB of RAM, and 1TB of disk could be sold as several virtual servers, but if the first one requested asked for 1CPU, 32GB RAM and 10GB disk, the rest of the CPUs and disk would be useless. So for that reason, the concept of flavors was born: particular combinations of RAM, CPU and disk that would be the only allowable way to size your VM; this would allow resources to be allocated in ways that would minimize waste. It was also convenient for billing usages, as public cloud providers could charge a set amount per flavor, rather than creating a confusing matrix of prices. In fact, the flavor concept was brought over from Rackspace's initial public cloud, based on the Slicehost codebase, which used flavors this way. Things were simple, and flavors worked.

Well, at least for a while, but then the notion of "cloud" continue to grow, and the resources to be allocated become more complex than the original notion of "partial slices of a whole thing", with new things to specify, such as SSD disks, NUMA topologies and PCI devices. These really had nothing to do with the original concept of flavors, but since they were the closest thing to saying "I want a VM that looks like this", these extra items were grafted onto flavors, as 'flavor' became a synonym for "all the stuff I want in my VM". These additional things didn't fit into the original idea of a flavor, and instead of recognizing that they are fundamentally different, the data model was updated to add things called 'extra_specs'. This is wrong on so many levels: they aren't "extra"; they are as basic to the request as anything else. These extra specs were originally freeform key-value pairs, and you could stuff pretty much anything in there. Now we have begun the process of cleaning this up, and it hasn't been very pretty.

With the advent of Ironic, though, it's clear that we need to take a step back and think this through. You can't allocate parts of a resource in Ironic, because each resource is a single non-virtualized machine. We've already broken the original design of one host == one compute node by treating Ironic resources as individual compute nodes, each with a flavor that represents the resources of that machine. Calling the Ironic machine sizes "flavors" just adds to the error.

We need to re-think just what it means to say we have a resource. We have to stop trying to treat all resources as if they can be made to follow the original notion of a divisible pool of stuff, and start to recognize that only some resources follow that pattern, while others are discreet. Discreet resources cannot be divided, and for them, the "flavor" notion simply does not apply. We need to stop trying to cram everything into flavor, and instead treat the request as what we need to persist, with 'flavor' being just one possible component of the request. The spec to create a request object is a step in the right direction, but doesn't do enough to shed this notion of requests only being for divisible compute resources.

Making these changes now would make it a lot easier in the long run to turn the current nova scheduler into a service that can allocate all sorts of resources, and not just divide up compute nodes. I would like to see the notion of resources, requests, and claims all completely revamped during the Liberty cycle, with the changes being completed in M. This will go a long way to making the scheduler cleaner by reducing the technical debt by assumption that we've built up in the last 5 years.

2 thoughts on “Rethinking Resources”

Comments are closed.