From d4fec24f6c440ad63f745396980eea2416304e00 Mon Sep 17 00:00:00 2001 From: Tao Liu Date: Tue, 11 Dec 2018 17:47:37 -0500 Subject: [PATCH] Change compute node to worker node personality The compute personality & subfunction has been changed to worker, and compute_reserved.conf has been rename to worker_reserved.conf. Compute configuration flags have been updated to worker flags. This update changes misc dependencies to compute personality, compute_reserved.conf and configuration flag files. It aslo removed puppet-nova dependencies to compute_reserved.conf. Tests Performed: Non-containerized deployment AIO-SX: Sanity and Nightly automated test suite AIO-DX: Sanity and Nightly automated test suite 2+2 System: Sanity and Nightly automated test suite 2+2 System: Horizon Patch Orchestration Kubernetes deployment: AIO-SX: Create, delete, reboot and rebuild instances 2+2+2 System: worker nodes are unlock enable and no alarms Story: 2004022 Task: 27013 Depends-On: https://review.openstack.org/#/c/624452/ Change-Id: Iccf5584058a2154f1c4ffdb061938e76b9965861 Signed-off-by: Tao Liu --- .../syslog-ng-config/files/fm_event_syslogger | 4 +- .../centos/patches/0002-personality.patch | 4 +- ...emove-compute-reserved-VM-huge-pages.patch | 32 +++++ .../centos/meta_patches/PATCH_ORDER | 1 + ...emove-compute-reserved-VM-huge-pages.patch | 112 ++++++++++++++++++ monitoring/collectd-extensions/src/cpu.py | 8 +- monitoring/collectd-extensions/src/memory.py | 2 +- .../mlx4-config/files/mlx4_core_goenabled.sh | 4 +- .../files/ovsdb-server.pmon.conf | 12 +- .../openvswitch/files/ovsdb-server.pmon.conf | 12 +- .../scripts/live_stream.py | 2 +- 11 files changed, 169 insertions(+), 24 deletions(-) create mode 100644 config/puppet-modules/openstack/puppet-nova-11.4.0/centos/meta_patches/0012-Remove-compute-reserved-VM-huge-pages.patch create mode 100644 config/puppet-modules/openstack/puppet-nova-11.4.0/centos/patches/0012-Remove-compute-reserved-VM-huge-pages.patch diff --git a/config-files/syslog-ng-config/files/fm_event_syslogger b/config-files/syslog-ng-config/files/fm_event_syslogger index 1570659b4..e9fb1ba4b 100644 --- a/config-files/syslog-ng-config/files/fm_event_syslogger +++ b/config-files/syslog-ng-config/files/fm_event_syslogger @@ -60,8 +60,8 @@ while read line; do # be logged if [ ${nodetype} == "controller" ]; then _configuration_flag_file="/var/run/.controller_config_complete" - elif [ ${nodetype} == "compute" ]; then - _configuration_flag_file="/var/run/.compute_config_complete" + elif [ ${nodetype} == "worker" ]; then + _configuration_flag_file="/var/run/.worker_config_complete" elif [ ${nodetype} == "storage" ]; then _configuration_flag_file="/var/run/.storage_config_complete" else diff --git a/config/facter/centos/patches/0002-personality.patch b/config/facter/centos/patches/0002-personality.patch index 0291d6fcd..a1b6b5c8d 100644 --- a/config/facter/centos/patches/0002-personality.patch +++ b/config/facter/centos/patches/0002-personality.patch @@ -49,12 +49,12 @@ + end +end + -+Facter.add('is_compute_subfunction') do ++Facter.add('is_worker_subfunction') do + confine :kernel => :linux + + setcode do + if release = Facter::Util::FileRead.read('/etc/platform/platform.conf') -+ match = release.match(/^subfunction\=.*compute/) ? true : false ++ match = release.match(/^subfunction\=.*worker/) ? true : false + end + end +end diff --git a/config/puppet-modules/openstack/puppet-nova-11.4.0/centos/meta_patches/0012-Remove-compute-reserved-VM-huge-pages.patch b/config/puppet-modules/openstack/puppet-nova-11.4.0/centos/meta_patches/0012-Remove-compute-reserved-VM-huge-pages.patch new file mode 100644 index 000000000..352efbb85 --- /dev/null +++ b/config/puppet-modules/openstack/puppet-nova-11.4.0/centos/meta_patches/0012-Remove-compute-reserved-VM-huge-pages.patch @@ -0,0 +1,32 @@ +From 0cc8e6f6a7db603c534fc6d6a3d36c212446e8c2 Mon Sep 17 00:00:00 2001 +From: Tao Liu +Date: Wed, 12 Dec 2018 14:39:12 -0500 +Subject: [PATCH 1/1] Remove compute reserved VM huge pages + +--- + SPECS/puppet-nova.spec | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/SPECS/puppet-nova.spec b/SPECS/puppet-nova.spec +index 367de7b..3554bd2 100644 +--- a/SPECS/puppet-nova.spec ++++ b/SPECS/puppet-nova.spec +@@ -20,6 +20,7 @@ Patch0008: 0008-Adding-pci_weight_multiple-to-nova-scheduler-filter.patch + Patch0009: 0009-Remove-SerialConsole-from-NovaConf.patch + Patch0010: 0010-Remove-compute-huge.patch + Patch0011: 0011-Provide-a-way-to-set-mem_stats_period_seconds.patch ++Patch0012: 0012-Remove-compute-reserved-VM-huge-pages.patch + + BuildArch: noarch + +@@ -51,6 +52,7 @@ Puppet module for OpenStack Nova + %patch0009 -p1 + %patch0010 -p1 + %patch0011 -p1 ++%patch0012 -p1 + + find . -type f -name ".*" -exec rm {} + + find . -size 0 -exec rm {} + +-- +1.8.3.1 + diff --git a/config/puppet-modules/openstack/puppet-nova-11.4.0/centos/meta_patches/PATCH_ORDER b/config/puppet-modules/openstack/puppet-nova-11.4.0/centos/meta_patches/PATCH_ORDER index 800287913..f27e04d5b 100644 --- a/config/puppet-modules/openstack/puppet-nova-11.4.0/centos/meta_patches/PATCH_ORDER +++ b/config/puppet-modules/openstack/puppet-nova-11.4.0/centos/meta_patches/PATCH_ORDER @@ -9,3 +9,4 @@ 0009-Remove-SerialConsole-from-NovaConf.patch 0010-Remove-compute-huge.patch 0011-Provide-a-way-to-set-mem_stats_period_seconds.patch +0012-Remove-compute-reserved-VM-huge-pages.patch diff --git a/config/puppet-modules/openstack/puppet-nova-11.4.0/centos/patches/0012-Remove-compute-reserved-VM-huge-pages.patch b/config/puppet-modules/openstack/puppet-nova-11.4.0/centos/patches/0012-Remove-compute-reserved-VM-huge-pages.patch new file mode 100644 index 000000000..779f28887 --- /dev/null +++ b/config/puppet-modules/openstack/puppet-nova-11.4.0/centos/patches/0012-Remove-compute-reserved-VM-huge-pages.patch @@ -0,0 +1,112 @@ +From b5e101b0a02e4693f57b42ac487621685f839bee Mon Sep 17 00:00:00 2001 +From: Tao Liu +Date: Thu, 29 Nov 2018 10:48:37 -0600 +Subject: [PATCH 1/1] Remove compute reserved VM huge pages + +--- + .../compute_reserved_config/ini_setting.rb | 22 ---------------------- + lib/puppet/type/compute_reserved_config.rb | 19 ------------------- + manifests/compute.pp | 18 ------------------ + 3 files changed, 59 deletions(-) + delete mode 100644 lib/puppet/provider/compute_reserved_config/ini_setting.rb + delete mode 100644 lib/puppet/type/compute_reserved_config.rb + +diff --git a/lib/puppet/provider/compute_reserved_config/ini_setting.rb b/lib/puppet/provider/compute_reserved_config/ini_setting.rb +deleted file mode 100644 +index e7d142f..0000000 +--- a/lib/puppet/provider/compute_reserved_config/ini_setting.rb ++++ /dev/null +@@ -1,22 +0,0 @@ +-Puppet::Type.type(:compute_reserved_config).provide( +- :ini_setting, +- :parent => Puppet::Type.type(:ini_setting).provider(:ruby) +-) do +- +- def section +- resource[:name].split('/', 2).first +- end +- +- def setting +- resource[:name].split('/', 2).last +- end +- +- def separator +- '=' +- end +- +- def file_path +- '/etc/nova/compute_reserved.conf' +- end +- +-end +diff --git a/lib/puppet/type/compute_reserved_config.rb b/lib/puppet/type/compute_reserved_config.rb +deleted file mode 100644 +index fa9d441..0000000 +--- a/lib/puppet/type/compute_reserved_config.rb ++++ /dev/null +@@ -1,19 +0,0 @@ +-Puppet::Type.newtype(:compute_reserved_config) do +- +- ensurable +- +- newparam(:name, :namevar => true) do +- desc 'Section/setting name to manage from compute_reserved.conf' +- newvalues(/\S*\/\S+/) +- end +- +- newproperty(:value) do +- desc 'The value of the setting to be defined.' +- munge do |value| +- value = value.to_s.strip +- value.capitalize! if value =~ /^(true|false)$/i +- value +- end +- end +- +-end +diff --git a/manifests/compute.pp b/manifests/compute.pp +index 719729a..62f3ac2 100644 +--- a/manifests/compute.pp ++++ b/manifests/compute.pp +@@ -148,9 +148,6 @@ + # for shared machine processes + # Defaults to undef + # +-# [*compute_reserved_vm_memory_2M*] +-# [*compute_reserved_vm_memory_1G*] +-# + # DEPRECATED + # + # [*pci_passthrough*] +@@ -194,8 +191,6 @@ class nova::compute ( + $consecutive_build_service_disable_threshold = $::os_service_default, + # WRS PARAMETERS + $shared_pcpu_map = undef, +- $compute_reserved_vm_memory_2M = '()', +- $compute_reserved_vm_memory_1G = '()', + # DEPRECATED PARAMETERS + $pci_passthrough = undef, + ) { +@@ -253,19 +248,6 @@ class nova::compute ( + 'DEFAULT/shared_pcpu_map': value => join(any2array($shared_pcpu_map), ','); + } + +- ## Only override build default if value is provided at runtime. +- ## Setting to () has effect of calculating maximum 2M hugepages. +- if ($compute_reserved_vm_memory_2M and ($compute_reserved_vm_memory_2M != '()')) { +- compute_reserved_config { +- '/COMPUTE_VM_MEMORY_2M' : value => $compute_reserved_vm_memory_2M; +- } +- } +- if ($compute_reserved_vm_memory_1G and ($compute_reserved_vm_memory_1G != '()')) { +- compute_reserved_config { +- '/COMPUTE_VM_MEMORY_1G' : value => $compute_reserved_vm_memory_1G; +- } +- } +- + ensure_resource('nova_config', 'DEFAULT/allow_resize_to_same_host', { value => $allow_resize_to_same_host }) + + if ($vnc_enabled) { +-- +1.8.3.1 + diff --git a/monitoring/collectd-extensions/src/cpu.py b/monitoring/collectd-extensions/src/cpu.py index 6f0fbf539..79ffe97bf 100755 --- a/monitoring/collectd-extensions/src/cpu.py +++ b/monitoring/collectd-extensions/src/cpu.py @@ -11,7 +11,7 @@ # platform core usable since the previous sample. # # Init Function: -# - if 'compute_reserved.conf exists then query/store PLATFORM_CPU_LIST +# - if 'worker_reserved.conf exists then query/store PLATFORM_CPU_LIST # ############################################################################ import os @@ -24,7 +24,7 @@ PASS = 0 FAIL = 1 PATH = '/proc/cpuinfo' -COMPUTE_RESERVED_CONF = '/etc/nova/compute_reserved.conf' +WORKER_RESERVED_CONF = '/etc/platform/worker_reserved.conf' PLUGIN = 'platform cpu usage plugin' @@ -63,8 +63,8 @@ def init_func(): collectd.info('%s init function for %s' % (PLUGIN, c.hostname)) raw_list = "" - if os.path.exists(COMPUTE_RESERVED_CONF): - with open(COMPUTE_RESERVED_CONF, 'r') as infile: + if os.path.exists(WORKER_RESERVED_CONF): + with open(WORKER_RESERVED_CONF, 'r') as infile: for line in infile: if 'PLATFORM_CPU_LIST' in line: val = line.split("=") diff --git a/monitoring/collectd-extensions/src/memory.py b/monitoring/collectd-extensions/src/memory.py index 2b436aeca..84320e758 100755 --- a/monitoring/collectd-extensions/src/memory.py +++ b/monitoring/collectd-extensions/src/memory.py @@ -11,7 +11,7 @@ # platform core usable since the previous sample. # # Init Function: -# - if 'compute_reserved.conf exists then query/store PLATFORM_CPU_LIST +# - if 'worker_reserved.conf exists then query/store PLATFORM_CPU_LIST # ############################################################################ import os diff --git a/networking/mellanox/mlx4-config/files/mlx4_core_goenabled.sh b/networking/mellanox/mlx4-config/files/mlx4_core_goenabled.sh index 189cf3214..dae8aa317 100644 --- a/networking/mellanox/mlx4-config/files/mlx4_core_goenabled.sh +++ b/networking/mellanox/mlx4-config/files/mlx4_core_goenabled.sh @@ -10,13 +10,13 @@ NAME=$(basename $0) OPTIONS_CHANGED_FLAG=/var/run/.mlx4_cx3_reboot_required -COMPUTE_CONFIG_COMPLETE=/var/run/.compute_config_complete +WORKER_CONFIG_COMPLETE=/var/run/.worker_config_complete function LOG { logger "$NAME: $*" } -if [ -f $OPTIONS_CHANGED_FLAG ] && [ -f $COMPUTE_CONFIG_COMPLETE ]; then +if [ -f $OPTIONS_CHANGED_FLAG ] && [ -f $WORKER_CONFIG_COMPLETE ]; then LOG "mlx4_core options has been changed. Failing goenabled check." exit 1 fi diff --git a/networking/openvswitch-config/files/ovsdb-server.pmon.conf b/networking/openvswitch-config/files/ovsdb-server.pmon.conf index d357c44c8..9fa8b51a0 100644 --- a/networking/openvswitch-config/files/ovsdb-server.pmon.conf +++ b/networking/openvswitch-config/files/ovsdb-server.pmon.conf @@ -12,14 +12,14 @@ debounce = 20 ; number of seconds that a process needs to remain startuptime = 5 ; Seconds to wait after process start before starting the debounce monitor mode = passive ; Monitoring mode: passive (default) or active ; passive: process death monitoring (default: always) - ; active : heartbeat monitoring, i.e. request / response messaging + ; active : heartbeat monitoring, i.e. request / response messaging ; ignore : do not monitor or stop monitoring -subfunction = compute ; Optional label. - ; Manage this process in the context of a combo host subfunction - ; Choices: compute or storage. +subfunction = worker ; Optional label. + ; Manage this process in the context of a combo host subfunction + ; Choices: worker or storage. ; when specified pmond will wait for - ; /var/run/.compute_config_complete or - ; /var/run/.storage_config_complete + ; /var/run/.worker_config_complete or + ; /var/run/.storage_config_complete ; ... before managing this process with the specified subfunction ; Excluding this label will cause this process to be managed by default on startup diff --git a/networking/openvswitch/files/ovsdb-server.pmon.conf b/networking/openvswitch/files/ovsdb-server.pmon.conf index d357c44c8..9fa8b51a0 100644 --- a/networking/openvswitch/files/ovsdb-server.pmon.conf +++ b/networking/openvswitch/files/ovsdb-server.pmon.conf @@ -12,14 +12,14 @@ debounce = 20 ; number of seconds that a process needs to remain startuptime = 5 ; Seconds to wait after process start before starting the debounce monitor mode = passive ; Monitoring mode: passive (default) or active ; passive: process death monitoring (default: always) - ; active : heartbeat monitoring, i.e. request / response messaging + ; active : heartbeat monitoring, i.e. request / response messaging ; ignore : do not monitor or stop monitoring -subfunction = compute ; Optional label. - ; Manage this process in the context of a combo host subfunction - ; Choices: compute or storage. +subfunction = worker ; Optional label. + ; Manage this process in the context of a combo host subfunction + ; Choices: worker or storage. ; when specified pmond will wait for - ; /var/run/.compute_config_complete or - ; /var/run/.storage_config_complete + ; /var/run/.worker_config_complete or + ; /var/run/.storage_config_complete ; ... before managing this process with the specified subfunction ; Excluding this label will cause this process to be managed by default on startup diff --git a/tools/engtools/hostdata-collectors/scripts/live_stream.py b/tools/engtools/hostdata-collectors/scripts/live_stream.py index e0e56b311..bbdf120f9 100644 --- a/tools/engtools/hostdata-collectors/scripts/live_stream.py +++ b/tools/engtools/hostdata-collectors/scripts/live_stream.py @@ -1176,7 +1176,7 @@ def getPlatformCores(node, cpe): logging.basicConfig(filename="/tmp/livestream.log", filemode="a", format="%(asctime)s %(levelname)s %(message)s", level=logging.INFO) core_list = list() try: - with open("/etc/nova/compute_reserved.conf", "r") as f: + with open("/etc/platform/worker_reserved.conf", "r") as f: for line in f: if line.startswith("PLATFORM_CPU_LIST"): core_list = line.split("=")[1].replace("\"", "").strip("\n").split(",")