Merge "Remove all references to sheepdog"

This commit is contained in:
Zuul 2020-04-07 04:05:36 +00:00 committed by Gerrit Code Review
commit 2d21685ee4
10 changed files with 60 additions and 58 deletions

View File

@ -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

View File

@ -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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -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

View File

@ -5448,7 +5448,6 @@
# * http
# * rbd
# * swift
# * sheepdog
# * cinder
# * vmware
#

View File

@ -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 <dirname> option '
'with a valid glance configuration directory.')
if __name__ == '__main__':
sys.exit(main())

View File

@ -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()

View File

@ -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.

View File

@ -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)

View File

@ -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.

View File

@ -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.