From 52e7b9d97967db9328f6c607f2f003d2b8f36389 Mon Sep 17 00:00:00 2001 From: Charles Short Date: Fri, 2 Dec 2022 13:18:04 -0500 Subject: [PATCH] debian: Manage /etc/platform/worker_resource.conf Install the /etc/platform/worker_resource.conf based on personaility type. The worker_resource.conf should be installed on AIO/worker and worker types. But not on controller only or storage types. Test Plan PASSED Build worker-utils package PASSED Build ISO PASSED Start a controller and check to make sure that the /etc/platform/worker_reserved.conf is not present. PASSED Start a worker and check to make sure that the /etc/platform/worker_reserved.conf is present. PASSED Install AIO and unlock host. PASSED Install Standard installation and unlock host. Story: 2009968 Task: 46980 Depends-On: https://review.opendev.org/c/starlingx/utilities/+/866496 Signed-off-by: Charles Short Change-Id: I32f0a841e55bb2d45b005407f99ed6430b60bf48 --- kickstart/files/kickstart.cfg | 10 +++++++++- kickstart/files/miniboot.cfg | 8 ++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/kickstart/files/kickstart.cfg b/kickstart/files/kickstart.cfg index 5e95bb5a..dd18c54f 100644 --- a/kickstart/files/kickstart.cfg +++ b/kickstart/files/kickstart.cfg @@ -2392,7 +2392,10 @@ if [ "${aio}" = true ] ; then elif [ ${RESERVEDMEM} -gt 8192 ]; then RESERVEDMEM=8192 fi - + + # Normally we would set personality based files later + # But we need to copy worker_reserved.conf now since it needs to be modified for AIO + cp /usr/share/worker-utils/config/worker_reserved.conf /etc/platform/worker_reserved.conf ilog "${SYSTEM_TYPE__AIO} Reserved Memory: ${RESERVEDMEM}" sed -i -e "s#\(WORKER_BASE_RESERVED\)=.*#\1=(\"node0:${RESERVEDMEM}MB:1\" \"node1:2000MB:0\" \"node2:2000MB:0\" \"node3:2000MB:0\")#g" /etc/platform/worker_reserved.conf worker_reserved=$(grep WORKER_BASE_RESERVED /etc/platform/worker_reserved.conf) @@ -2404,6 +2407,11 @@ if [ "${aio}" = true ] ; then worker_cpu_list=$(grep WORKER_CPU_LIST /etc/platform/worker_reserved.conf) ilog "${SYSTEM_TYPE__AIO} '${worker_cpu_list}'" +elif [ "${worker}" = true ] ; then + # Keep logic contained and copy worker_reserved.conf now since we need + # to do the copy for AIO above + ilog "Enable worker_reserved.conf for ${TRAIT__WORKER}" + cp /usr/share/worker-utils/config/worker_reserved.conf /etc/platform/worker_reserved.conf fi true diff --git a/kickstart/files/miniboot.cfg b/kickstart/files/miniboot.cfg index b0a71161..5bcc8801 100644 --- a/kickstart/files/miniboot.cfg +++ b/kickstart/files/miniboot.cfg @@ -2552,7 +2552,10 @@ if [ "${aio}" = true ] ; then RESERVEDMEM=8192 fi + # Normally we would set personality based files later + # But we need to copy worker_reserved.conf now since it needs to be modified for AIO ilog "${SYSTEM_TYPE__AIO} Reserved Memory: ${RESERVEDMEM}" + cp /usr/share/worker-utils/config/worker_reserved.conf /etc/platform/worker_reserved.conf sed -i -e "s#\(WORKER_BASE_RESERVED\)=.*#\1=(\"node0:${RESERVEDMEM}MB:1\" \"node1:2000MB:0\" \"node2:2000MB:0\" \"node3:2000MB:0\")#g" /etc/platform/worker_reserved.conf worker_reserved=$(grep WORKER_BASE_RESERVED /etc/platform/worker_reserved.conf) ilog "${SYSTEM_TYPE__AIO} '${worker_reserved}'" @@ -2563,6 +2566,11 @@ if [ "${aio}" = true ] ; then worker_cpu_list=$(grep WORKER_CPU_LIST /etc/platform/worker_reserved.conf) ilog "${SYSTEM_TYPE__AIO} '${worker_cpu_list}'" +elif [ "${worker}" = true ] ; then + # Keep logic contained and copy worker_reserved.conf now since we need + # to do the copy for AIO above + ilog "Enable worker_reserved.conf for ${TRAIT__WORKER}" + cp /usr/share/worker-utils/config/worker_reserved.conf /etc/platform/worker_reserved.conf fi true