Merge "Change compute node to worker node personality"
This commit is contained in:
commit
204bd9ea0c
@ -60,8 +60,8 @@ while read line; do
|
|||||||
# be logged
|
# be logged
|
||||||
if [ ${nodetype} == "controller" ]; then
|
if [ ${nodetype} == "controller" ]; then
|
||||||
_configuration_flag_file="/var/run/.controller_config_complete"
|
_configuration_flag_file="/var/run/.controller_config_complete"
|
||||||
elif [ ${nodetype} == "compute" ]; then
|
elif [ ${nodetype} == "worker" ]; then
|
||||||
_configuration_flag_file="/var/run/.compute_config_complete"
|
_configuration_flag_file="/var/run/.worker_config_complete"
|
||||||
elif [ ${nodetype} == "storage" ]; then
|
elif [ ${nodetype} == "storage" ]; then
|
||||||
_configuration_flag_file="/var/run/.storage_config_complete"
|
_configuration_flag_file="/var/run/.storage_config_complete"
|
||||||
else
|
else
|
||||||
|
@ -49,12 +49,12 @@
|
|||||||
+ end
|
+ end
|
||||||
+end
|
+end
|
||||||
+
|
+
|
||||||
+Facter.add('is_compute_subfunction') do
|
+Facter.add('is_worker_subfunction') do
|
||||||
+ confine :kernel => :linux
|
+ confine :kernel => :linux
|
||||||
+
|
+
|
||||||
+ setcode do
|
+ setcode do
|
||||||
+ if release = Facter::Util::FileRead.read('/etc/platform/platform.conf')
|
+ 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
|
+ end
|
||||||
+end
|
+end
|
||||||
|
@ -0,0 +1,32 @@
|
|||||||
|
From 0cc8e6f6a7db603c534fc6d6a3d36c212446e8c2 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Tao Liu <tao.liu@windriver.com>
|
||||||
|
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
|
||||||
|
|
@ -9,3 +9,4 @@
|
|||||||
0009-Remove-SerialConsole-from-NovaConf.patch
|
0009-Remove-SerialConsole-from-NovaConf.patch
|
||||||
0010-Remove-compute-huge.patch
|
0010-Remove-compute-huge.patch
|
||||||
0011-Provide-a-way-to-set-mem_stats_period_seconds.patch
|
0011-Provide-a-way-to-set-mem_stats_period_seconds.patch
|
||||||
|
0012-Remove-compute-reserved-VM-huge-pages.patch
|
||||||
|
@ -0,0 +1,112 @@
|
|||||||
|
From b5e101b0a02e4693f57b42ac487621685f839bee Mon Sep 17 00:00:00 2001
|
||||||
|
From: Tao Liu <tao.liu@windriver.com>
|
||||||
|
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
|
||||||
|
|
@ -11,7 +11,7 @@
|
|||||||
# platform core usable since the previous sample.
|
# platform core usable since the previous sample.
|
||||||
#
|
#
|
||||||
# Init Function:
|
# 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
|
import os
|
||||||
@ -24,7 +24,7 @@ PASS = 0
|
|||||||
FAIL = 1
|
FAIL = 1
|
||||||
|
|
||||||
PATH = '/proc/cpuinfo'
|
PATH = '/proc/cpuinfo'
|
||||||
COMPUTE_RESERVED_CONF = '/etc/nova/compute_reserved.conf'
|
WORKER_RESERVED_CONF = '/etc/platform/worker_reserved.conf'
|
||||||
|
|
||||||
PLUGIN = 'platform cpu usage plugin'
|
PLUGIN = 'platform cpu usage plugin'
|
||||||
|
|
||||||
@ -63,8 +63,8 @@ def init_func():
|
|||||||
collectd.info('%s init function for %s' % (PLUGIN, c.hostname))
|
collectd.info('%s init function for %s' % (PLUGIN, c.hostname))
|
||||||
|
|
||||||
raw_list = ""
|
raw_list = ""
|
||||||
if os.path.exists(COMPUTE_RESERVED_CONF):
|
if os.path.exists(WORKER_RESERVED_CONF):
|
||||||
with open(COMPUTE_RESERVED_CONF, 'r') as infile:
|
with open(WORKER_RESERVED_CONF, 'r') as infile:
|
||||||
for line in infile:
|
for line in infile:
|
||||||
if 'PLATFORM_CPU_LIST' in line:
|
if 'PLATFORM_CPU_LIST' in line:
|
||||||
val = line.split("=")
|
val = line.split("=")
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
# platform core usable since the previous sample.
|
# platform core usable since the previous sample.
|
||||||
#
|
#
|
||||||
# Init Function:
|
# 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
|
import os
|
||||||
|
@ -10,13 +10,13 @@
|
|||||||
|
|
||||||
NAME=$(basename $0)
|
NAME=$(basename $0)
|
||||||
OPTIONS_CHANGED_FLAG=/var/run/.mlx4_cx3_reboot_required
|
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 {
|
function LOG {
|
||||||
logger "$NAME: $*"
|
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."
|
LOG "mlx4_core options has been changed. Failing goenabled check."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -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
|
startuptime = 5 ; Seconds to wait after process start before starting the debounce monitor
|
||||||
mode = passive ; Monitoring mode: passive (default) or active
|
mode = passive ; Monitoring mode: passive (default) or active
|
||||||
; passive: process death monitoring (default: always)
|
; 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
|
; ignore : do not monitor or stop monitoring
|
||||||
subfunction = compute ; Optional label.
|
subfunction = worker ; Optional label.
|
||||||
; Manage this process in the context of a combo host subfunction
|
; Manage this process in the context of a combo host subfunction
|
||||||
; Choices: compute or storage.
|
; Choices: worker or storage.
|
||||||
; when specified pmond will wait for
|
; when specified pmond will wait for
|
||||||
; /var/run/.compute_config_complete or
|
; /var/run/.worker_config_complete or
|
||||||
; /var/run/.storage_config_complete
|
; /var/run/.storage_config_complete
|
||||||
; ... before managing this process with the specified subfunction
|
; ... before managing this process with the specified subfunction
|
||||||
; Excluding this label will cause this process to be managed by default on startup
|
; Excluding this label will cause this process to be managed by default on startup
|
||||||
|
|
||||||
|
@ -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
|
startuptime = 5 ; Seconds to wait after process start before starting the debounce monitor
|
||||||
mode = passive ; Monitoring mode: passive (default) or active
|
mode = passive ; Monitoring mode: passive (default) or active
|
||||||
; passive: process death monitoring (default: always)
|
; 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
|
; ignore : do not monitor or stop monitoring
|
||||||
subfunction = compute ; Optional label.
|
subfunction = worker ; Optional label.
|
||||||
; Manage this process in the context of a combo host subfunction
|
; Manage this process in the context of a combo host subfunction
|
||||||
; Choices: compute or storage.
|
; Choices: worker or storage.
|
||||||
; when specified pmond will wait for
|
; when specified pmond will wait for
|
||||||
; /var/run/.compute_config_complete or
|
; /var/run/.worker_config_complete or
|
||||||
; /var/run/.storage_config_complete
|
; /var/run/.storage_config_complete
|
||||||
; ... before managing this process with the specified subfunction
|
; ... before managing this process with the specified subfunction
|
||||||
; Excluding this label will cause this process to be managed by default on startup
|
; Excluding this label will cause this process to be managed by default on startup
|
||||||
|
|
||||||
|
@ -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)
|
logging.basicConfig(filename="/tmp/livestream.log", filemode="a", format="%(asctime)s %(levelname)s %(message)s", level=logging.INFO)
|
||||||
core_list = list()
|
core_list = list()
|
||||||
try:
|
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:
|
for line in f:
|
||||||
if line.startswith("PLATFORM_CPU_LIST"):
|
if line.startswith("PLATFORM_CPU_LIST"):
|
||||||
core_list = line.split("=")[1].replace("\"", "").strip("\n").split(",")
|
core_list = line.split("=")[1].replace("\"", "").strip("\n").split(",")
|
||||||
|
Loading…
Reference in New Issue
Block a user