Re-add the StorPool distributed storage driver
Re-add the driver as it was removed, then make the following
six changes (bugfixes and updates):
1. Move the testcase to cinder/tests/unit/
2. Pass the H402 docstring check
Add a period at the end of a single-line docstring.
3. Fall back to the configured template
If the volume type does not specify a template, properly fall back to
the default template from the configuration instead of going with none.
4. Return volume object in _attach_volume()
Catch up with rev.
bbf1b49 of volume/driver.py.
5. Use the ABC metaclasses
Declare the existing StorPool volume driver functionality by
deriving from the appropriate driver.*VD classes.
6. Implement volume retyping and migrations
initialize_connection(): store the StorPool client ID in the connection
data to be used by the "StorPool" Brick connector.
validate_connector(): actually check the connector data for a valid
hostname defined in the StorPool configuration.
_storpool_client_id(): new method to get the numeric ID of a host in
the StorPool cluster from the /etc/storpool.conf file.
_attach_volume(), _detach_volume(): if the "remote" flag is set, pass
the request on to the default Cinder driver implementation; it knows
how to make remote volumes accessible.
_attach_volume(), _detach_volume(): support the case when these methods
are invoked from a method that is not overridden in the StorPool Cinder
driver - create a storpool.spopenstack.AttachDB attachment structure
and destroy it upon detaching.
ensure_export(): add a stub method, the actual work is handled by
the Nova volume attachment driver.
retype(): new method: handle a StorPool-to-StorPool retyping where
at most the volume's StorPool template or replication is changed.
For anything else, return False to indicate an unsupported request so
that a full volume migration is triggered.
update_migrated_volume(): rename the StorPool volume to correspond to
the real Cinder volume's name.
Add the StorPoolConfigurationMissing and StorPoolConfigurationInvalid
exceptions.
Flesh out the validate_connector() and initialize_connection() unit tests.
Implements: blueprint storpool-block-driver
Implements: blueprint abc-driver-update
Implements: blueprint volume-retype
Change-Id: I5c29cb5f679b08b8db664c9f20cf24cbcd7c6c60