Remove traces of now unused host capabilities from scheduler

Host capabilities updates are no longer used by the scheduler. All host
state is instead fetched from the DB. Some left over fields are still kept
by the host manager but contain no data. This change remove the last
traces of host capabilities from the scheduler.

The baremetal host manager used to rely on capabilities info to
decide which host state class to use, VM or baremetal. This has been
broken since host capabilities were removed (bug 1260265). The logic to
decide on host state class to use is updated to use DB data instead and
a test is added to verify the same.

Change-Id: I350109492c2addf5fdfaadee7cec4784f244e102
Closes-Bug: #1260265
Fix security group race condition while listing and deleting rules

Previously, there was a race condition that could occur if one was listing
a security group which contained a rule which referenced another security
group as an additional api call is used to look up the security group's
name which is returned (rather than id) via the API. The problem occurs if
this security group is deleted in which case a 404 was raised.
This patch fixes this issue by catching the 404 and ignoring the rule as
its already deleted as there is a constraint enforced that you cannot
delete a security group if another security group has a rule that references
that security group.

Change-Id: I3855b8d3a1bd2f7c88901da071f9bd5581bd56e4
Closes-bug: 1262566
Add helpers to create per-aggregate filters

This patchset introduce a new file of utility methods
to deal with aggregate metadata.
As well it updates related filters to use this new logic.
* AggregateRamFilter
* AggregateCoreFilter,
* AggregateTypeAffinityFilter

Closes-Bug: #1301340
Change-Id: I5e4aebe9e61cfbdc7b9e6b5de0788fc6670eb936
VCDriver - Ignore host in Maintenance mode in stats update

The VCDriver during stats update checks only for connected hosts.
However hosts which are in connected state to the Cluster can
be set to Maintenance mode.
The cluster does not boot instances to hosts which are in
maintenance mode.
Hence the VCDriver should check for hosts which are in
maintenance mode and ignore them for stats update.
VISDK API returns True for the property inMaintenanceMode for
Hosts which are in maintenance mode

Change-Id: Ieaf7530ed2d98c59c5450e8cb75e209823193d49
Closes-Bug: #1316674
Revert "Convert address to str in fixed_ip_obj.associate"

This reverts commit 5268c1136ed09346d13b28b42626c0b302e3abb2.

A change was made that breaks RPC compatibility since the actual
remotable method was changed to the underscored version.

Change-Id: I2589e914b5141fdea0738d04b4a8e14e349580a0
Catch InstanceInfoCacheNotFound during build_instances

instance.refresh() is raising InstanceInfoCacheNotFound which is logged
by the conductor and would cause all following builds to fail in a
multiple build request situation.  The cause appears to be a race
condition which should be addressed separately, but for now this
exception should be caught, logged, then ignored.

Change-Id: Ibf9e6687933ee90dad54b1998b243ef7256d79ca
Closes-bug: 1324793
VMware: Fix memory leaks caused by caches

Using suds objects as keys for the DatastoreBrowser cache is incorrect
because they don't implement __eq__ and __hash__ for the VIM types.
This always results in cache miss and the cache grows with every spawn()
operation.

This patch fix this by using the 'value' property (which is string) of
the MoRef as key.

Change-Id: I2bcaf87e733d51055566aee41bb0a7e254027ba9
Closes-Bug: 1316433
Merge "Revert "Convert address to str in fixed_ip_obj.associate""
Merge "Remove traces of now unused host capabilities from scheduler"
Merge "Add helpers to create per-aggregate filters"
Merge "VMware: Fix memory leaks caused by caches"
Merge "Catch InstanceInfoCacheNotFound during build_instances"
Merge "Fix security group race condition while listing and deleting rules"
Merge "VCDriver - Ignore host in Maintenance mode in stats update"