Rename devstack CYBORG_CONF_FILE to CYBORG_CONF for consistency
CYBORG_CONF_FILE var is used to point cyborg config file in devstack. In DevStack, most of the services config file var is SERVICE_CONF. In order to keep consistent with other devstack plugins, thic cr renames the var CYBORG_CONF_FILE to CYBORG_CONF. Note: It also make sure it fallback to the old name. Change-Id: I287974c02be44437ed865c5b4ea3e2b1f2389573 Signed-off-by: Chandan Kumar (raukadah) <chkumar@redhat.com>
This commit is contained in:
1 parent
042a8dca4d
commit
2bff6797ca
4 files changed
+35
-35
No files matched your search
+29
-29
@@ -124,36 +124,36 @@ function configure_cyborg {
|
||||
function configure_cyborg_common {
|
||||
configure_cyborg_dirs
|
||||
# Copy over cyborg configuration file and configure common parameters.
|
||||
iniset $CYBORG_CONF_FILE DEFAULT debug True
|
||||
inicomment $CYBORG_CONF_FILE DEFAULT log_file
|
||||
iniset $CYBORG_CONF_FILE database connection `database_connection_url cyborg`
|
||||
iniset $CYBORG_CONF_FILE DEFAULT state_path $CYBORG_STATE_PATH
|
||||
iniset $CYBORG_CONF_FILE DEFAULT use_syslog $SYSLOG
|
||||
iniset_rpc_backend cyborg $CYBORG_CONF_FILE
|
||||
iniset $CYBORG_CONF DEFAULT debug True
|
||||
inicomment $CYBORG_CONF DEFAULT log_file
|
||||
iniset $CYBORG_CONF database connection `database_connection_url cyborg`
|
||||
iniset $CYBORG_CONF DEFAULT state_path $CYBORG_STATE_PATH
|
||||
iniset $CYBORG_CONF DEFAULT use_syslog $SYSLOG
|
||||
iniset_rpc_backend cyborg $CYBORG_CONF
|
||||
}
|
||||
|
||||
function configure_cyborg_agent {
|
||||
# set up drivers / hardware types
|
||||
iniset $CYBORG_CONF_FILE agent enabled_drivers $CYBORG_ENABLED_DRIVERS
|
||||
iniset $CYBORG_CONF agent enabled_drivers $CYBORG_ENABLED_DRIVERS
|
||||
|
||||
# Configure placement client auth for multinode deployments
|
||||
configure_keystoneauth $CYBORG_CONF_FILE cyborg placement
|
||||
configure_keystoneauth $CYBORG_CONF cyborg placement
|
||||
|
||||
# Add retries so that placement registers the resource provider
|
||||
# Set higher than the default (3) because in CI the subnode agent
|
||||
# starts before nova-compute has registered its resource provider
|
||||
# with Placement. 6 retries gives ~63s of tolerance (1+2+4+8+16+32).
|
||||
iniset $CYBORG_CONF_FILE agent resource_provider_startup_retries 6
|
||||
iniset $CYBORG_CONF agent resource_provider_startup_retries 6
|
||||
}
|
||||
|
||||
# configure_cyborg_api() - Is used by configure_cyborg(). Performs
|
||||
# API specific configuration.
|
||||
function configure_cyborg_api {
|
||||
iniset $CYBORG_CONF_FILE DEFAULT auth_strategy $CYBORG_AUTH_STRATEGY
|
||||
configure_keystone_authtoken_middleware $CYBORG_CONF_FILE cyborg
|
||||
iniset $CYBORG_CONF_FILE oslo_policy policy_file $CYBORG_POLICY_JSON
|
||||
iniset $CYBORG_CONF DEFAULT auth_strategy $CYBORG_AUTH_STRATEGY
|
||||
configure_keystone_authtoken_middleware $CYBORG_CONF cyborg
|
||||
iniset $CYBORG_CONF oslo_policy policy_file $CYBORG_POLICY_JSON
|
||||
|
||||
iniset $CYBORG_CONF_FILE conductor automated_clean $CYBORG_AUTOMATED_CLEAN_ENABLED
|
||||
iniset $CYBORG_CONF conductor automated_clean $CYBORG_AUTOMATED_CLEAN_ENABLED
|
||||
|
||||
if [ "$CYBORG_USE_UWSGI" == "True" ]; then
|
||||
write_uwsgi_config "$CYBORG_UWSGI_CONF" "$CYBORG_UWSGI" "/accelerator" "" "cyborg-api"
|
||||
@@ -164,14 +164,14 @@ function configure_cyborg_api {
|
||||
function configure_auth_for {
|
||||
local service_config_section
|
||||
service_config_section=$1
|
||||
iniset $CYBORG_CONF_FILE $service_config_section auth_type password
|
||||
iniset $CYBORG_CONF_FILE $service_config_section auth_url $KEYSTONE_SERVICE_URI
|
||||
iniset $CYBORG_CONF_FILE $service_config_section username cyborg
|
||||
iniset $CYBORG_CONF_FILE $service_config_section password $SERVICE_PASSWORD
|
||||
iniset $CYBORG_CONF_FILE $service_config_section project_name $SERVICE_PROJECT_NAME
|
||||
iniset $CYBORG_CONF_FILE $service_config_section user_domain_id default
|
||||
iniset $CYBORG_CONF_FILE $service_config_section project_domain_id default
|
||||
iniset $CYBORG_CONF_FILE $service_config_section cafile $SSL_BUNDLE_FILE
|
||||
iniset $CYBORG_CONF $service_config_section auth_type password
|
||||
iniset $CYBORG_CONF $service_config_section auth_url $KEYSTONE_SERVICE_URI
|
||||
iniset $CYBORG_CONF $service_config_section username cyborg
|
||||
iniset $CYBORG_CONF $service_config_section password $SERVICE_PASSWORD
|
||||
iniset $CYBORG_CONF $service_config_section project_name $SERVICE_PROJECT_NAME
|
||||
iniset $CYBORG_CONF $service_config_section user_domain_id default
|
||||
iniset $CYBORG_CONF $service_config_section project_domain_id default
|
||||
iniset $CYBORG_CONF $service_config_section cafile $SSL_BUNDLE_FILE
|
||||
}
|
||||
|
||||
# configure_cyborg_conductor() - Is used by configure_cyborg().
|
||||
@@ -179,18 +179,18 @@ function configure_auth_for {
|
||||
function configure_cyborg_conductor {
|
||||
|
||||
# set keystone region for all services
|
||||
iniset $CYBORG_CONF_FILE keystone region_name $REGION_NAME
|
||||
iniset $CYBORG_CONF keystone region_name $REGION_NAME
|
||||
|
||||
# this one is needed for lookup of Cyborg API endpoint via Keystone
|
||||
configure_auth_for service_catalog
|
||||
configure_keystoneauth $CYBORG_CONF_FILE cyborg nova
|
||||
configure_keystoneauth $CYBORG_CONF_FILE cyborg placement
|
||||
configure_keystoneauth $CYBORG_CONF cyborg nova
|
||||
configure_keystoneauth $CYBORG_CONF cyborg placement
|
||||
|
||||
# NOTE(sean-k-mooney) it is not obvious why this is in the conductor
|
||||
# section or what sets is_deployed_by_agent so this should either be
|
||||
# documented, removed or moved to the correct location.
|
||||
if is_deployed_by_agent; then
|
||||
iniset $CYBORG_CONF_FILE api ramdisk_heartbeat_timeout 30
|
||||
iniset $CYBORG_CONF api ramdisk_heartbeat_timeout 30
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -210,7 +210,7 @@ function init_cyborg {
|
||||
recreate_database cyborg utf8
|
||||
|
||||
# Migrate cyborg database
|
||||
$CYBORG_BIN_DIR/cyborg-dbsync --config-file ${CYBORG_CONF_FILE} upgrade
|
||||
$CYBORG_BIN_DIR/cyborg-dbsync --config-file ${CYBORG_CONF} upgrade
|
||||
create_cyborg_cache_dir
|
||||
fi
|
||||
}
|
||||
@@ -240,20 +240,20 @@ function start_cyborg_api {
|
||||
if [ "$CYBORG_USE_UWSGI" == "True" ]; then
|
||||
run_process cyborg-api "$(which uwsgi) --ini $CYBORG_UWSGI_CONF --procname-prefix cyborg-api"
|
||||
else
|
||||
run_process cyborg-api "$CYBORG_BIN_DIR/cyborg-api --config-file $CYBORG_CONF_FILE"
|
||||
run_process cyborg-api "$CYBORG_BIN_DIR/cyborg-api --config-file $CYBORG_CONF"
|
||||
fi
|
||||
}
|
||||
|
||||
# start_cyborg_conductor() - Used by start_cyborg().
|
||||
# Starts Cyborg conductor.
|
||||
function start_cyborg_conductor {
|
||||
run_process cyborg-cond "$CYBORG_BIN_DIR/cyborg-conductor --config-file=$CYBORG_CONF_FILE"
|
||||
run_process cyborg-cond "$CYBORG_BIN_DIR/cyborg-conductor --config-file=$CYBORG_CONF"
|
||||
}
|
||||
|
||||
# start_cyborg_agent() - Used by start_cyborg().
|
||||
# Starts Cyborg agent.
|
||||
function start_cyborg_agent {
|
||||
run_process cyborg-agent "$CYBORG_BIN_DIR/cyborg-agent --config-file=$CYBORG_CONF_FILE"
|
||||
run_process cyborg-agent "$CYBORG_BIN_DIR/cyborg-agent --config-file=$CYBORG_CONF"
|
||||
}
|
||||
|
||||
# stop_cyborg() - Stop running processes
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ CYBORG_DEVSTACK_FILES_DIR=$CYBORG_DEVSTACK_DIR/files
|
||||
CYBORG_DATA_DIR=$DATA_DIR/cyborg
|
||||
CYBORG_STATE_PATH=/var/lib/cyborg
|
||||
CYBORG_CONF_DIR=${CYBORG_CONF_DIR:-/etc/cyborg}
|
||||
CYBORG_CONF_FILE=$CYBORG_CONF_DIR/cyborg.conf
|
||||
CYBORG_CONF=${CYBORG_CONF:-${CYBORG_CONF_FILE:-$CYBORG_CONF_DIR/cyborg.conf}}
|
||||
CYBORG_API_PASTE_INI=$CYBORG_CONF_DIR/api-paste.ini
|
||||
CYBORG_POLICY_JSON=$CYBORG_CONF_DIR/policy.yaml
|
||||
CYBORG_SERVICE_HOST=${CYBORG_SERVICE_HOST:-$SERVICE_HOST}
|
||||
|
||||
@@ -72,14 +72,14 @@ if [ $ret_val -gt 1 ] ; then
|
||||
# returned as greater than 1 which means there is a major upgrade
|
||||
# stopping issue which needs to be addressed.
|
||||
echo "WARNING: Status check failed, we're going to attempt to apply the schema update and then re-evaluate."
|
||||
$CYBORG_BIN_DIR/cyborg-dbsync --config-file=$CYBORG_CONF_FILE upgrade
|
||||
$CYBORG_BIN_DIR/cyborg-dbsync --config-file=$CYBORG_CONF upgrade
|
||||
$CYBORG_BIN_DIR/cyborg-status upgrade check && ret_val=$? || ret_val=$?
|
||||
if [ $ret_val -gt 1 ] ; then
|
||||
die $LINENO "Cyborg DB Status check failed, returned: $ret_val"
|
||||
fi
|
||||
fi
|
||||
|
||||
$CYBORG_BIN_DIR/cyborg-dbsync --config-file=$CYBORG_CONF_FILE upgrade || die $LINENO "DB migration error"
|
||||
$CYBORG_BIN_DIR/cyborg-dbsync --config-file=$CYBORG_CONF upgrade || die $LINENO "DB migration error"
|
||||
|
||||
# When using uWSGI: create config if missing; re-enable Apache site (stop_cyborg
|
||||
# disables it, and we only call write_uwsgi_config when conf is missing).
|
||||
|
||||
@@ -359,7 +359,7 @@ In your ``~/devstack/local.conf`` file, add or update the following sections:
|
||||
# Find device IDs with: lspci -nn | grep -i Non-Volatile
|
||||
# Example: Red Hat QEMU NVMe Controller [1b36:0010]
|
||||
|
||||
[[post-config|$CYBORG_CONF_FILE]]
|
||||
[[post-config|$CYBORG_CONF]]
|
||||
[pci]
|
||||
# NVMe device passthrough (vendor_id: 1b36, product_id: 0010)
|
||||
passthrough_whitelist='{"vendor_id":"1b36","product_id":"0010"}'
|
||||
@@ -371,7 +371,7 @@ In your ``~/devstack/local.conf`` file, add or update the following sections:
|
||||
|
||||
* ``CYBORG_ENABLED_DRIVERS``: Enables both the fake driver (for testing) and
|
||||
the PCI driver
|
||||
* ``[[post-config|$CYBORG_CONF_FILE]]``: Adds configuration to ``cyborg.conf``
|
||||
* ``[[post-config|$CYBORG_CONF]]``: Adds configuration to ``cyborg.conf``
|
||||
after DevStack generates it
|
||||
* ``[pci]``: Configuration section for the PCI driver
|
||||
* ``passthrough_whitelist``: JSON string specifying which PCI devices to manage
|
||||
@@ -386,7 +386,7 @@ entries as a JSON array:
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
[[post-config|$CYBORG_CONF_FILE]]
|
||||
[[post-config|$CYBORG_CONF]]
|
||||
[pci]
|
||||
# Whitelist both NVMe and virtio-rng devices
|
||||
passthrough_whitelist='[{"vendor_id":"1b36","product_id":"0010"},{"vendor_id":"1af4","product_id":"1044"}]'
|
||||
|
||||
Reference in new issue
Block a user