diff --git a/doc/source/admin/multistores.rst b/doc/source/admin/multistores.rst index f328762604..e46c100fe9 100644 --- a/doc/source/admin/multistores.rst +++ b/doc/source/admin/multistores.rst @@ -46,9 +46,8 @@ operators to enable multiple stores support. * ``enabled_backends`` must be set as a key:value pair where key represents the identifier for the store and value will be the type of the store. Valid values are one of ``file``, ``http``, ``rbd``, - ``swift``, ``cinder``, ``sheepdog`` or ``vmware``. In order to have - multiple stores operator can specify multiple key:value separated by - comma. + ``swift``, ``cinder`` or ``vmware``. In order to have multiple stores + operator can specify multiple key:value separated by comma. .. warning:: The store identifier prefix ``os_glance_`` is reserved. If you diff --git a/doc/source/configuration/configuring.rst b/doc/source/configuration/configuring.rst index 4378c4ac50..f1da90bef5 100644 --- a/doc/source/configuration/configuring.rst +++ b/doc/source/configuration/configuring.rst @@ -401,15 +401,15 @@ stores disk images. These configuration options are specified in the Sets the storage backend to use by default when storing images in Glance. Available options for this option are (``file``, ``swift``, ``rbd``, - ``sheepdog``, ``cinder`` or ``vsphere``). In order to select a default store - it must also be listed in the ``stores`` list described below. + ``cinder`` or ``vsphere``). In order to select a default store it must also + be listed in the ``stores`` list described below. ``stores=STORES`` Optional. Default: ``file, http`` A comma separated list of enabled glance stores. Some available options for - this option are (``filesystem``, ``http``, ``rbd``, ``swift``, - ``sheepdog``, ``cinder``, ``vmware``) + this option are (``filesystem``, ``http``, ``rbd``, ``swift``, ``cinder``, + ``vmware``) Configuring the Filesystem Storage Backend ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -909,37 +909,6 @@ using a pool called ``images``, run:: ceph-authtool --gen-key --name client.glance --cap mon 'allow r' --cap osd 'allow rwx pool=images' /etc/glance/rbd.keyring ceph auth add client.glance -i /etc/glance/rbd.keyring -Configuring the Sheepdog Storage Backend -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -``sheepdog_store_address=ADDR`` - Optional. Default: ``localhost`` - - Can only be specified in configuration files. - - `This option is specific to the Sheepdog storage backend.` - - Sets the IP address of the sheep daemon - -``sheepdog_store_port=PORT`` - Optional. Default: ``7000`` - - Can only be specified in configuration files. - - `This option is specific to the Sheepdog storage backend.` - - Sets the IP port of the sheep daemon - -``sheepdog_store_chunk_size=SIZE_IN_MB`` - Optional. Default: ``64`` - - Can only be specified in configuration files. - - `This option is specific to the Sheepdog storage backend.` - - Images will be chunked into objects of this size (in megabytes). - For best performance, this should be a power of two. - Configuring the Cinder Storage Backend ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/doc/source/user/glanceapi.rst b/doc/source/user/glanceapi.rst index 3d65556acb..a23be7888b 100644 --- a/doc/source/user/glanceapi.rst +++ b/doc/source/user/glanceapi.rst @@ -502,7 +502,7 @@ The list of metadata headers that Glance accepts are listed below. * ``x-image-meta-store`` This header is optional. Valid values are one of ``file``, ``rbd``, - ``swift``, ``cinder``, ``sheepdog`` or ``vsphere``. + ``swift``, ``cinder`` or ``vsphere``. When present, Glance will attempt to store the disk image data in the backing store indicated by the value of the header. If the Glance node diff --git a/etc/glance-api.conf b/etc/glance-api.conf index 795524d6b6..165fcad088 100644 --- a/etc/glance-api.conf +++ b/etc/glance-api.conf @@ -5448,7 +5448,6 @@ # * http # * rbd # * swift -# * sheepdog # * cinder # * vmware # diff --git a/glance/cmd/status.py b/glance/cmd/status.py index c2b03d5e3d..6ac79a1b10 100644 --- a/glance/cmd/status.py +++ b/glance/cmd/status.py @@ -12,17 +12,55 @@ # License for the specific language governing permissions and limitations # under the License. +import sys + +import glance_store from oslo_config import cfg from oslo_upgradecheck import upgradecheck +from glance.common import wsgi # noqa + CONF = cfg.CONF +SUCCESS = upgradecheck.Code.SUCCESS +FAILURE = upgradecheck.Code.FAILURE + class Checks(upgradecheck.UpgradeCommands): """Programmable upgrade checks.""" - pass + def _check_sheepdog_store(self): + """Check that the removed sheepdog backend store is not configured.""" + glance_store.register_opts(CONF) + sheepdog_present = False + if 'sheepdog' in getattr(CONF, 'enabled_backends', {}): + sheepdog_present = True + + if 'sheepdog' in getattr(CONF.glance_store, 'stores', []): + sheepdog_present = True + + if sheepdog_present: + return upgradecheck.Result( + FAILURE, + 'The "sheepdog" backend store driver has been removed, but ' + 'current settings have it configured.') + + return upgradecheck.Result(SUCCESS) + + _upgrade_checks = ( + # Added in Ussuri + ('Sheepdog Driver Removal', _check_sheepdog_store), + ) def main(): - return upgradecheck.main(CONF, 'glance', Checks()) + try: + return upgradecheck.main(CONF, 'glance', Checks()) + except cfg.ConfigDirNotFoundError: + return ('ERROR: cannot read the glance configuration directory.\n' + 'Please re-run using the --config-dir option ' + 'with a valid glance configuration directory.') + + +if __name__ == '__main__': + sys.exit(main()) diff --git a/glance/common/location_strategy/store_type.py b/glance/common/location_strategy/store_type.py index 104381e27d..2401a2155b 100644 --- a/glance/common/location_strategy/store_type.py +++ b/glance/common/location_strategy/store_type.py @@ -44,7 +44,6 @@ Possible values: * http * rbd * swift - * sheepdog * cinder * vmware @@ -80,7 +79,6 @@ def init(): 'http': ['http', 'https'], 'rbd': ['rbd'], 'swift': ['swift', 'swift+https', 'swift+http'], - 'sheepdog': ['sheepdog'], 'cinder': ['cinder'], 'vmware': ['vsphere']} _STORE_TO_SCHEME_MAP.clear() diff --git a/glance/tests/unit/base.py b/glance/tests/unit/base.py index 3f1da5e5e1..606cb037a2 100644 --- a/glance/tests/unit/base.py +++ b/glance/tests/unit/base.py @@ -40,8 +40,7 @@ class StoreClearingUnitTest(test_utils.BaseTestCase): self.addCleanup(setattr, location, 'SCHEME_TO_CLS_MAP', dict()) def _create_stores(self, passing_config=True): - """Create known stores. Mock out sheepdog's subprocess dependency - on collie. + """Create known stores. :param passing_config: making store driver passes basic configurations. :returns: the number of how many store drivers been loaded. @@ -66,8 +65,7 @@ class MultiStoreClearingUnitTest(test_utils.BaseTestCase): self.addCleanup(setattr, location, 'SCHEME_TO_CLS_MAP', dict()) def _create_multi_stores(self, passing_config=True): - """Create known stores. Mock out sheepdog's subprocess dependency - on collie. + """Create known stores. :param passing_config: making store driver passes basic configurations. :returns: the number of how many store drivers been loaded. diff --git a/glance/tests/unit/common/scripts/test_scripts_utils.py b/glance/tests/unit/common/scripts/test_scripts_utils.py index aacbe0112f..cb467d5c1f 100644 --- a/glance/tests/unit/common/scripts/test_scripts_utils.py +++ b/glance/tests/unit/common/scripts/test_scripts_utils.py @@ -116,10 +116,6 @@ class TestScriptsUtils(test_utils.BaseTestCase): self.assertRaises(urllib.error.URLError, script_utils.validate_location_uri, location) - location = 'sheepdog://' - self.assertRaises(urllib.error.URLError, - script_utils.validate_location_uri, location) - location = 'rbd://' self.assertRaises(urllib.error.URLError, script_utils.validate_location_uri, location) diff --git a/glance/tests/unit/common/test_location_strategy.py b/glance/tests/unit/common/test_location_strategy.py index 1b47bc65fe..8bedd177fd 100644 --- a/glance/tests/unit/common/test_location_strategy.py +++ b/glance/tests/unit/common/test_location_strategy.py @@ -154,7 +154,7 @@ class TestStoreTypeStrategyModule(base.IsolatedUnitTest): """Test routines in glance.common.location_strategy.store_type""" def test_get_ordered_locations(self): - self.config(store_type_preference=[' rbd', 'sheepdog ', ' file', + self.config(store_type_preference=[' rbd', ' file', 'swift ', ' http ', 'vmware'], group='store_type_location_strategy') locs = [{'url': 'file://image0', 'metadata': {'idx': 3}}, @@ -164,15 +164,14 @@ class TestStoreTypeStrategyModule(base.IsolatedUnitTest): {'url': 'cinder://image5', 'metadata': {'idx': 9}}, {'url': 'file://image6', 'metadata': {'idx': 5}}, {'url': 'rbd://image7', 'metadata': {'idx': 1}}, - {'url': 'vsphere://image9', 'metadata': {'idx': 8}}, - {'url': 'sheepdog://image8', 'metadata': {'idx': 2}}] + {'url': 'vsphere://image8', 'metadata': {'idx': 8}}] ordered_locs = store_type.get_ordered_locations(copy.deepcopy(locs)) locs.sort(key=lambda loc: loc['metadata']['idx']) # The result will ordered by preferred store type order. self.assertEqual(locs, ordered_locs) def test_get_ordered_locations_with_invalid_store_name(self): - self.config(store_type_preference=[' rbd', 'sheepdog ', 'invalid', + self.config(store_type_preference=[' rbd', 'invalid', 'swift ', ' http '], group='store_type_location_strategy') locs = [{'url': 'file://image0', 'metadata': {'idx': 4}}, @@ -181,8 +180,7 @@ class TestStoreTypeStrategyModule(base.IsolatedUnitTest): {'url': 'swift://image4', 'metadata': {'idx': 3}}, {'url': 'cinder://image5', 'metadata': {'idx': 6}}, {'url': 'file://image6', 'metadata': {'idx': 7}}, - {'url': 'rbd://image7', 'metadata': {'idx': 1}}, - {'url': 'sheepdog://image8', 'metadata': {'idx': 2}}] + {'url': 'rbd://image7', 'metadata': {'idx': 1}}] ordered_locs = store_type.get_ordered_locations(copy.deepcopy(locs)) locs.sort(key=lambda loc: loc['metadata']['idx']) # The result will ordered by preferred store type order. diff --git a/releasenotes/notes/drop-sheepdog-b55aae84807d31d9.yaml b/releasenotes/notes/drop-sheepdog-b55aae84807d31d9.yaml new file mode 100644 index 0000000000..0ba0a8b344 --- /dev/null +++ b/releasenotes/notes/drop-sheepdog-b55aae84807d31d9.yaml @@ -0,0 +1,7 @@ +--- +upgrade: + - | + The ``sheepdog`` storage backend driver was deprecated in the Train release + and has now been removed. Any deployments still using Sheepdog storage + will need to migrate to a different backend storage prior to upgrading to + this release.