worker/diskmanager: don't publish disk partitions

Don't publish partitions to state. Partitions may not be used
as there is no guarantee that the partition will remain available
(and we don't model hierarchy). Also, we will likely be using
partitions at least in some scenarios to synthesise a unique
identifier for block devices which can't otherwise be guaranteed.
provider/azure: filter out unsupported role sizes

Not all locations support all role sizes, so we
now query Azure's ListLocations API to check
availability.

Additionally, we have found that creating virtual
networks with affinity groups restricts which role
sizes can be provisioned, presumably because this
restricts the physical hosts which may be used.
We switch to using Location in virtual networks
instead, and filter out D and G series role sizes
in environments with a virtual network tied to an
affinity group. Higher performance A-series role
sizes may also fail, but are only going to be chosen
by users to specify the constraints accordingly
anyway.

Fixes https://bugs.launchpad.net/juju-core/1.21/+bug/1398406
Address review comments
Fix comment
state: introduce automatic multi-environment filtering

For collections that contain data for multiple environments,
getCollection now returns a wrapped collection that automatically
filters by environment UUID as required. This reduces the risk of
unintended data leakage between environments.

There are some areas where an actual mgo.Collection is required. These
now use the new State.getRawCollection method.

Now that this is handled automatically, this change also removes
several TODOs regarding filtering by environment UUID.

A later branch will remove all the now-unnecessary docID calls that
currently exist in state.
state: fixed service life handling in SetMetricCredentials

This method was adding the env UUID prefix onto an id that already had
the prefix when checking service life. This meant the life check was
never going to succeed and the associated test was passing for the
wrong reason (service not found instead of service is dying/dead).

The function was also only checking for the Dead state (but not
Dying). Based on the test, I have assumed that SetMetricCredentials is
only supposed to work if a service is alive so I've changed the
implementation to check for Alive instead of Dead.
Merge pull request #1230 from axw/worker-diskmanager-ignorepart

worker/diskmanager: don't publish disk partitions

Don't publish partitions to state. Partitions may not be used
as there is no guarantee that the partition will remain available
(and we don't model hierarchy). Also, we will likely be using
partitions at least in some scenarios to synthesise a unique
identifier for block devices which can't otherwise be guaranteed.

(Review request: http://reviews.vapour.ws/r/540/)
Merge pull request #1262 from axw/azure-rolesizes

provider/azure: filter out unsupported role sizes

Not all locations support all role sizes, so we
now query Azure's ListLocations API to check
availability.

Additionally, we have found that creating virtual
networks with affinity groups restricts which role
sizes can be provisioned, presumably because this
restricts the physical hosts which may be used.
We switch to using Location in virtual networks
instead, and filter out D and G series role sizes
in environments with a virtual network tied to an
affinity group. Higher performance A-series role
sizes may also fail, but are only going to be chosen
by users to specify the constraints accordingly
anyway.

Fixes https://bugs.launchpad.net/juju-core/1.21/+bug/1398406

(Review request: http://reviews.vapour.ws/r/576/)
state: populate env UUID on minUnitsDoc
Merge pull request #1240 from mjs/auto-env-uuid

state: introduce automatic multi-environment filtering

For collections that contain data for multiple environments, getCollection now returns a wrapped collection that automatically filters by environment UUID as required. This reduces  the risk of unintended data leakage between environments.

There are some areas where an actual mgo.Collection is required. These now use the new State.getRawCollection method.

Now that this is handled automatically, this change also removes several TODOs regarding filtering by environment UUID.

A later branch will remove all the now-unnecessary docID calls that currently exist in state.

(Review request: http://reviews.vapour.ws/r/551/)
state: use a raw collection when load settings

This is required to allow loading of settings before the env UUID
migration for settings. Without this change upgrades to 1.22 fail.
Merge pull request #1280 from mjs/settings-read-hack-fix

state: use a raw collection when load settings

This is required to allow loading of settings before the env UUID migration for settings. Without this change upgrades to 1.22 fail.

(Review request: http://reviews.vapour.ws/r/595/)