-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extra features setup json #73
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,11 +13,12 @@ | |
# | ||
# Open vStorage is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY of any kind. | ||
|
||
from ovs.lib.generic import GenericController | ||
from ovs.extensions.generic.logger import Logger | ||
from ..helpers.backend import BackendHelper | ||
from ..helpers.storagedriver import StoragedriverHelper | ||
from ..helpers.storagerouter import StoragerouterHelper | ||
from ..helpers.vpool import VPoolHelper | ||
from ..validate.decorators import required_roles, check_vpool | ||
|
||
|
||
|
@@ -72,7 +73,11 @@ def add_vpool(vpool_name, vpool_details, api, storagerouter_ip, proxy_amount=2, | |
'parallelism': {'proxies': proxy_amount} | ||
} | ||
api_data = {'call_parameters': call_parameters} | ||
|
||
|
||
# Setting for mds_safety | ||
if vpool_details.get('mds_safety') is not None: | ||
call_parameters['mds_config_params'] = {'mds_safety': vpool_details['mds_safety']} | ||
|
||
# Setting possible alba accelerated alba | ||
if vpool_details['fragment_cache']['location'] == 'backend': | ||
call_parameters['backend_info_aa'] = {'alba_backend_guid': BackendHelper.get_albabackend_by_name(vpool_details['fragment_cache']['backend']['name']).guid, | ||
|
@@ -113,7 +118,25 @@ def add_vpool(vpool_name, vpool_details, api, storagerouter_ip, proxy_amount=2, | |
raise RuntimeError(error_msg) | ||
else: | ||
VPoolSetup.LOGGER.info('Creation of vPool `{0}` should have succeeded on storagerouter `{1}`'.format(vpool_name, storagerouter_ip)) | ||
return storagerouter_ip, '/mnt/{0}'.format(vpool_name) | ||
|
||
# Settings volumedriver | ||
storagedriver_config = {} | ||
if vpool_details.get('storagedriver').get('volume_manager') is not None: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If storagedriver would be filled in, I'd opt to validate the possible options (see how we validate the call params) |
||
storagedriver_config['volume_manager'] = vpool_details['storagedriver']['volume_manager'] | ||
if vpool_details.get('storagedriver').get('backend_connection_manager') is not None: | ||
storagedriver_config['backend_connection_manager'] = vpool_details['storagedriver']['backend_connection_manager'] | ||
|
||
if storagedriver_config: | ||
VPoolSetup.LOGGER.info('Updating volumedriver configuration of vPool `{0}` on storagerouter `{1}`.'.format(vpool_name, storagerouter_ip)) | ||
vpool = VPoolHelper.get_vpool_by_name(vpool_name) | ||
storagedriver = [sd for sd in vpool.storagedrivers if sd.storagerouter.ip == storagerouter_ip][0] | ||
if not storagedriver: | ||
error_msg = 'Unable to find the storagedriver of vPool {0} on storagerouter {1}'.format(vpool_name, storagerouter_ip) | ||
raise RuntimeError(error_msg) | ||
StoragedriverHelper.change_config(storagedriver, storagedriver_config) | ||
VPoolSetup.LOGGER.info('Updating volumedriver config of vPool `{0}` should have succeeded on storagerouter `{1}`'.format(vpool_name, storagerouter_ip)) | ||
|
||
return storagerouter_ip, '/mnt/{0}'.format(vpool_name) | ||
|
||
@staticmethod | ||
def execute_scrubbing(): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current master branch points towards FWK 2.11
No need to have this try-except stuff