Change nova instances_path and cpuset mounts to openstack-helm default
This changes the nova configuration instances_path parameter to reflect the openstack-helm default of /var/lib/nova/instances. This changes the nova cpuset mount configuration to reflect the openstack-helm default cgroup path. The nova_setup_cpusets script now mounts /sys/fs/cgroup/cpuset instead of /dev/cpuset to provide the equivalent functionality. Change-Id: I1db45213b78da52532b40e6b6c07528f52427da0 Story: 2003909 Task: 27081 Signed-off-by: Jim Gauld <james.gauld@windriver.com>
This commit is contained in:
parent
44d0507491
commit
8a2fa70d4f
|
@ -14,7 +14,7 @@ rootwrap_config = /etc/nova/rootwrap.conf
|
||||||
api_paste_config = /etc/nova/api-paste.ini
|
api_paste_config = /etc/nova/api-paste.ini
|
||||||
allow_resize_to_same_host = true
|
allow_resize_to_same_host = true
|
||||||
auth_strategy = keystone
|
auth_strategy = keystone
|
||||||
instances_path = /etc/nova/instances
|
instances_path = /var/lib/nova/instances
|
||||||
debug = True
|
debug = True
|
||||||
my_ip = 127.0.0.1
|
my_ip = 127.0.0.1
|
||||||
glance_host = 127.0.0.1
|
glance_host = 127.0.0.1
|
||||||
|
|
|
@ -58,6 +58,8 @@ errlog()
|
||||||
|
|
||||||
start()
|
start()
|
||||||
{
|
{
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
# Do not continue if the host has not been configured. We can't do
|
# Do not continue if the host has not been configured. We can't do
|
||||||
# anything until the nova.conf file has been updated.
|
# anything until the nova.conf file has been updated.
|
||||||
if [ ! -f ${INITIAL_COMPUTE_CONFIG_COMPLETE} ]
|
if [ ! -f ${INITIAL_COMPUTE_CONFIG_COMPLETE} ]
|
||||||
|
@ -66,43 +68,37 @@ start()
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p /dev/cpuset
|
# Configure cpuset mount
|
||||||
|
CPUSET=/sys/fs/cgroup/cpuset
|
||||||
|
CPUS='cpuset.cpus'
|
||||||
|
MEMS='cpuset.mems'
|
||||||
|
mkdir -p ${CPUSET}
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
errlog "unable to create /dev/cpuset"
|
errlog "unable to create ${CPUSET}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! mountpoint -q /dev/cpuset
|
if ! mountpoint -q ${CPUSET}
|
||||||
then
|
then
|
||||||
mount -t cpuset none /dev/cpuset
|
mount -t cpuset none ${CPUSET}
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
errlog "unable to mount /dev/cpuset"
|
errlog "unable to mount ${CPUSET}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Figure out whether to use WRL or CentOS naming
|
|
||||||
if [ -f /dev/cpuset/cpuset.cpus ]
|
|
||||||
then
|
|
||||||
CPUS='cpuset.cpus'
|
|
||||||
MEMS='cpuset.mems'
|
|
||||||
else
|
|
||||||
CPUS='cpus'
|
|
||||||
MEMS='mems'
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Make the global "floating" cpuset
|
# Make the global "floating" cpuset
|
||||||
mkdir -p /dev/cpuset/floating
|
mkdir -p ${CPUSET}/floating
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
errlog "unable to create 'floating' cpuset"
|
errlog "unable to create 'floating' cpuset"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Assign the full set of NUMA nodes to the global floating nodeset
|
# Assign the full set of NUMA nodes to the global floating nodeset
|
||||||
MEMNODES=$(cat /dev/cpuset/${MEMS})
|
MEMNODES=$(cat ${CPUSET}/${MEMS})
|
||||||
log "Assign nodes ${MEMNODES} to floating/${MEMS}"
|
log "Assign nodes ${MEMNODES} to floating/${MEMS}"
|
||||||
cp /dev/cpuset/${MEMS} /dev/cpuset/floating/${MEMS}
|
cp ${CPUSET}/${MEMS} ${CPUSET}/floating/${MEMS}
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
errlog "unable to write to floating/${MEMS}"
|
errlog "unable to write to floating/${MEMS}"
|
||||||
fi
|
fi
|
||||||
|
@ -111,20 +107,21 @@ start()
|
||||||
VCPU_PIN_STR=$(grep vcpu_pin_set /etc/nova/nova.conf)
|
VCPU_PIN_STR=$(grep vcpu_pin_set /etc/nova/nova.conf)
|
||||||
VCPU_PIN_STR=${VCPU_PIN_STR//\"/}
|
VCPU_PIN_STR=${VCPU_PIN_STR//\"/}
|
||||||
FLOAT_CPUS=${VCPU_PIN_STR##*=}
|
FLOAT_CPUS=${VCPU_PIN_STR##*=}
|
||||||
|
|
||||||
log "Assign cpus ${FLOAT_CPUS} to floating/${CPUS}"
|
log "Assign cpus ${FLOAT_CPUS} to floating/${CPUS}"
|
||||||
/bin/echo $FLOAT_CPUS > /dev/cpuset/floating/${CPUS}
|
/bin/echo $FLOAT_CPUS > ${CPUSET}/floating/${CPUS}
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
errlog "unable to write to floating/${CPUS}"
|
errlog "unable to write to floating/${CPUS}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set ownership/permissions on the cpus/tasks files
|
# Set ownership/permissions on the cpus/tasks files
|
||||||
chown nova.nova /dev/cpuset/floating/${CPUS} /dev/cpuset/floating/tasks
|
chown nova.nova ${CPUSET}/floating/${CPUS} ${CPUSET}/floating/tasks
|
||||||
chmod 644 /dev/cpuset/floating/${CPUS} /dev/cpuset/floating/tasks
|
chmod 644 ${CPUSET}/floating/${CPUS} ${CPUSET}/floating/tasks
|
||||||
|
|
||||||
# Now set up the per-NUMA-node cpusets
|
# Now set up the per-NUMA-node cpusets
|
||||||
cd /sys/devices/system/node/
|
cd /sys/devices/system/node/
|
||||||
NODES=`ls -d node*`
|
NODES=$(ls -d node*)
|
||||||
cd /dev/cpuset/floating
|
cd ${CPUSET}/floating
|
||||||
for NODE in $NODES
|
for NODE in $NODES
|
||||||
do
|
do
|
||||||
NODENUM=${NODE#node}
|
NODENUM=${NODE#node}
|
||||||
|
@ -138,7 +135,7 @@ start()
|
||||||
# may span numa nodes. Default linux memory allocation policy is to
|
# may span numa nodes. Default linux memory allocation policy is to
|
||||||
# use the same node(s) where the task is affined if that is possible.
|
# use the same node(s) where the task is affined if that is possible.
|
||||||
log "Assign nodes ${MEMNODES} to floating/${NODE}/${MEMS}"
|
log "Assign nodes ${MEMNODES} to floating/${NODE}/${MEMS}"
|
||||||
cp /dev/cpuset/${MEMS} ${NODE}/${MEMS}
|
cp ${CPUSET}/${MEMS} ${NODE}/${MEMS}
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
errlog "unable to write to ${NODE}/${MEMS}"
|
errlog "unable to write to ${NODE}/${MEMS}"
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in New Issue