Add object models for comparing resource amounts

Right now, we have 4 distinct ways (!) of comparing resources in the
resource tracker:

- Straight integer amounts stored in top-level key/value pairs in the
  nova.compute.resource_tracker.ResourceTracker.old_resources dictionary
  attribute. For example: {"local_gb": X, "local_gb_used": Y}

- NUMA topology amounts and usages are stored as a serialized
  nova.virt.hardware.VirtNUMAInstanceTopology/VirtNUMAHostTopology
  pair in the old_resources dictionary under the 'numa_topology' key:
  {"numa_topology": JSON-BLOB}

- PCI device amounts and usages are separately tracked by the
  nova.compute.resource_tracker.ResourceTracker.pci_tracker object. This
  really is quite silly, and duplicates a ton of comparison functionality
  from both NUMA and the standard integer amount/usage stuff. The results
  of this pci_tracker work is placed into the "pci_devices" and
  "pci_passthrough_devices" (no idea why it was necessary to have two keys
  here...) as a JSON-serialized BLOB of information that comes directly from
  the pci_stats field in the compute_nodes table.

- The "extensible resource tracker" places "stuff" into a "stats" key in
  the top-level old_resources dictionary attribute. The "stuff" is a
  collection of free-form, unstructured, and undocumented amount
  information for whatever resource classes happen to be included by the
  deployer.

Just like we have 4 distinct ways of comparing resource amounts, we have
four totally different ways of comparing capacity of a resource with the
used amount of that resource:

- Straight integer amounts are compared using a simple `(total - used) >
  requested` formula.

- NUMA topology usage records use a set of classes that derive from
  nova.virt.hardware.VirtNUMATopology that enable different usage and cell
  topologies to be compared for fit. Unfortunately, the
  VirtNUMAHostTopology object inherited the nova.compute.claim.Claim
  object's claim_test() method, which tightly couples the (supposedly
  non-coupled) nova.virt.hardware classes to the Claim interface in the
  resource tracker.

- PCI device resource usages are managed in yet another completely
  different way, using the code in nova.pci.pci_manager.PciManager, which
  is a member of the resource tracker's pci_tracker attribute.

- And still yet the extensible resource tracker plugins offer another way
  of calculating and storing usage records: in a JSON blob that is passed
  from one plugin to another, which the plugin expected to update the
  supplied dictionary with a usage record that only it understands.

This patch adds the basic object models that will enable us to have a
single interface for comparing resource amounts and usages. It adds some
helper classes in /nova/resources/amounts.py that allow any "amount" of
a resource to be specified using the same generalized class, and any
capacity/usage of any resource to be both updated and check for
available room for a requested amount of some resource -- again, all in
a consistent generalized class interface.

The next patch in the series adds the actual resource types that
utilize the AmountSpec and UsageSpec objects introduced in this patch.

Change-Id: I6676fe3a9fb7d23adae1819cebab3a8cbad7487e
Partially-implements: resource-objects
Adds resource type classes

A set of resource types is added in /nova/resources/types.py. Simple
integer-based resources like CPU, RAM, and LocalDisk are included, in
addition to complex resources like NUMATopology, which uses the
primitives in nova.virt.hardware in order to update usage amounts and
calculate whether a requested NUMATopology for a to-be-launched instance
would fit in the NUMA cells advertised and used on a compute node.

A base nova.resources.types.ResourceType class is used as a generic
class interface for any resource, simple or complex, to create
nova.resources.amounts.AmountSpec and UsageSpec objects that can be used
to represent concrete amount and usage records. The idea here is to have
a single way of modeling some resource that is provided by a compute
node, and a single way of comparing a requested amount of something with
the capacity and usage records of the provider of that resource.

The next patch in the series converts the resource tracker to use these
resource amount and usage objects instead of the four different ways
that it currently tracks different types of resources.

Change-Id: I1962469d4d39c7ca2e9632ff8dad1e7f4de9125c
Partially-implements: resource-objects