Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes from the last weeks testing #157

Merged
merged 13 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions actions/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,40 +300,40 @@ func switchOffColor() {
func cmdLineSyntax() string {
return `saptune: Comprehensive system optimisation management for SAP solutions.
Daemon control:
saptune [--format FORMAT] [--force-color] daemon ( start | stop | status [--non-compliance-check] ) ATTENTION: deprecated
saptune [--format FORMAT] [--force-color] service ( start | stop | restart | takeover | enable | disable | enablestart | disablestop | status [--non-compliance-check] )
saptune [--format FORMAT] [--force-color] [--fun] daemon ( start | stop | status [--non-compliance-check] ) ATTENTION: deprecated
saptune [--format FORMAT] [--force-color] [--fun] service ( start | stop | restart | takeover | enable | disable | enablestart | disablestop | status [--non-compliance-check] )
Tune system according to SAP and SUSE notes:
saptune [--format FORMAT] [--force-color] note ( list | verify | revertall | enabled | applied )
saptune [--format FORMAT] [--force-color] note ( apply | simulate | customise | create | edit | revert | show | delete ) NOTEID
saptune [--format FORMAT] [--force-color] [--fun] note ( list | verify | revertall | enabled | applied )
saptune [--format FORMAT] [--force-color] [--fun] note ( apply | simulate | customise | create | edit | revert | show | delete ) NOTEID
saptune [--format FORMAT] [--force-color] [--fun] note verify [--colorscheme SCHEME] [--show-non-compliant] [NOTEID|applied]
saptune [--format FORMAT] [--force-color] note rename NOTEID NEWNOTEID
saptune [--format FORMAT] [--force-color] [--fun] note rename NOTEID NEWNOTEID
Tune system for all notes applicable to your SAP solution:
saptune [--format FORMAT] [--force-color] solution ( list | verify | enabled | applied )
saptune [--format FORMAT] [--force-color] solution ( apply | simulate | customise | create | edit | revert | show | delete ) SOLUTIONNAME
saptune [--format FORMAT] [--force-color] solution change [--force] SOLUTIONNAME
saptune [--format FORMAT] [--force-color] [--fun] solution ( list | verify | enabled | applied )
saptune [--format FORMAT] [--force-color] [--fun] solution ( apply | simulate | customise | create | edit | revert | show | delete ) SOLUTIONNAME
saptune [--format FORMAT] [--force-color] [--fun] solution change [--force] SOLUTIONNAME
saptune [--format FORMAT] [--force-color] [--fun] solution verify [--colorscheme SCHEME] [--show-non-compliant] [SOLUTIONNAME]
saptune [--format FORMAT] [--force-color] solution rename SOLUTIONNAME NEWSOLUTIONNAME
saptune [--format FORMAT] [--force-color] [--fun] solution rename SOLUTIONNAME NEWSOLUTIONNAME
Staging control:
saptune [--format FORMAT] [--force-color] staging ( status | enable | disable | is-enabled | list )
saptune [--format FORMAT] [--force-color] staging ( analysis | diff ) [ ( NOTEID | SOLUTIONNAME )... | all ]
saptune [--format FORMAT] [--force-color] staging release [--force|--dry-run] [ ( NOTEID | SOLUTIONNAME )... | all ]
saptune [--format FORMAT] [--force-color] [--fun] staging ( status | enable | disable | is-enabled | list )
saptune [--format FORMAT] [--force-color] [--fun] staging ( analysis | diff ) [ ( NOTEID | SOLUTIONNAME.sol )... | all ]
saptune [--format FORMAT] [--force-color] [--fun] staging release [--force|--dry-run] [ ( NOTEID | SOLUTIONNAME.sol )... | all ]
Config (re-)settings:
saptune [--format FORMAT] [--force-color] configure ( COLOR_SCHEME | SKIP_SYSCTL_FILES | IGNORE_RELOAD | DEBUG ) Value
saptune [--format FORMAT] [--force-color] configure ( reset | show )
saptune [--format FORMAT] [--force-color] [--fun] configure ( COLOR_SCHEME | SKIP_SYSCTL_FILES | IGNORE_RELOAD | DEBUG ) Value
saptune [--format FORMAT] [--force-color] [--fun] configure ( reset | show )
Verify all applied Notes:
saptune [--format FORMAT] [--force-color] verify applied
saptune [--format FORMAT] [--force-color] [--fun] verify applied
Revert all parameters tuned by the SAP notes or solutions:
saptune [--format FORMAT] [--force-color] revert all
saptune [--format FORMAT] [--force-color] [--fun] revert all
Remove the pending lock file from a former saptune call
saptune [--format FORMAT] [--force-color] lock remove
saptune [--format FORMAT] [--force-color] [--fun] lock remove
Call external script '/usr/sbin/saptune_check'
saptune [--format FORMAT] [--force-color] check
saptune [--format FORMAT] [--force-color] [--fun] check
Print current saptune status:
saptune [--format FORMAT] [--force-color] status [--non-compliance-check]
saptune [--format FORMAT] [--force-color] [--fun] status [--non-compliance-check]
Print current saptune version:
saptune [--format FORMAT] [--force-color] version
saptune [--format FORMAT] [--force-color] [--fun] version
Print this message:
saptune [--format FORMAT] [--force-color] help
saptune [--format FORMAT] [--force-color] [--fun] help

Deprecation list:
all 'saptune daemon' actions
Expand Down
2 changes: 1 addition & 1 deletion actions/actionsMatchtxt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var noteListMatchText = `
All notes (+ denotes manually enabled notes, * denotes notes enabled by solutions, - denotes notes enabled by solutions but reverted manually later, O denotes override file exists for note, C denotes custom note):
900929 Linux: STORAGE_PARAMETERS_WRONG_SET and 'mmap() failed'
Version 7 from 31.07.2017
https://launchpad.support.sap.com/#/notes/900929
https://me.sap.com/notes/900929
NEWSOL2NOTE
extraNote Configuration drop in for extra tests
Version 0 from 04.06.2019
Expand Down
8 changes: 4 additions & 4 deletions actions/noteacts.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,10 +334,6 @@ func NoteActionDelete(reader io.Reader, writer io.Writer, noteID string, tuneApp
if !extraNote && !overrideNote {
system.ErrorExit("The Note definition file you want to delete is a saptune internal (shipped) Note and can NOT be deleted. Exiting ...")
}
inSolution, _ := getNoteInSol(tuneApp, noteID)
if inSolution != "" {
system.ErrorExit("The Note definition file you want to delete is part of a Solution(s) (%s). Please fix the Solution first and then try deleting again.", inSolution)
}

if !extraNote && overrideNote {
// system note, override file exists
Expand All @@ -354,6 +350,10 @@ func NoteActionDelete(reader io.Reader, writer io.Writer, noteID string, tuneApp
}
}
if extraNote {
inSolution, _ := getNoteInSol(tuneApp, noteID)
if inSolution != "" {
system.ErrorExit("The Note definition file you want to delete is part of a Solution(s) (%s). Please fix the Solution first and then try deleting again.", inSolution)
}
// custom note
txtConfirm = fmt.Sprintf("Note to delete is a customer/vendor specific Note.\nDo you really want to delete this Note (%s)?", noteID)
// remove customer/vendor specific note definition file
Expand Down
2 changes: 1 addition & 1 deletion actions/noteacts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func TestNoteActions(t *testing.T) {
All notes (+ denotes manually enabled notes, * denotes notes enabled by solutions, - denotes notes enabled by solutions but reverted manually later, O denotes override file exists for note, C denotes custom note):
C 900929 Linux: STORAGE_PARAMETERS_WRONG_SET and 'mmap() failed'
Version 7 from 31.07.2017
https://launchpad.support.sap.com/#/notes/900929
https://me.sap.com/notes/900929
+ NEWSOL2NOTE
 - O extraNote Configuration drop in for extra tests
Version 0 from 04.06.2019
Expand Down
9 changes: 5 additions & 4 deletions development.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ the sources should be available at $GOPATH/src/github.com/SUSE/saptune

## build saptune v3
cd $GOPATH/src/github.com/SUSE/saptune
version="3.0.0-test"
version="3.2.0-test"
bdate=$(date +"%Y/%m/%d")
go build -ldflags "-X 'github.com/SUSE/saptune/actions.RPMVersion=$version' -X 'github.com/SUSE/saptune/actions.RPMDate=$bdate'"
bvers=15
go build -ldflags "-X 'github.com/SUSE/saptune/actions.RPMVersion=$version' -X 'github.com/SUSE/saptune/actions.RPMDate=$bdate' -X '%{GONS}/%{name}/system.RPMBldVers=$bvers'"

## lint and format checks for the sources before committing changes

Expand All @@ -23,12 +24,12 @@ and run the unit tests (in a docker container)
## unit tests for saptune:
after committing the changes to git travis is used for automatic testing

But before committing the sources, run the tests locally by using docker and the same workflow as on travis
But before committing the sources, run the tests locally by using docker and the same workflow as with github actions

su -
systemctl start docker
cd $GOPATH/src/github.com/SUSE/saptune
docker run --name saptune-ci --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro -td -v "$(pwd):/app" registry.opensuse.org/home/angelabriel/st-ci-base/containers/st-ci-base
docker run --name saptune-ci --privileged --tmpfs /run -v /sys/fs/cgroup:/sys/fs/cgroup:rw --cgroupns=host -td -v "$(pwd):/app" registry.opensuse.org/home/angelabriel/st-ci-base/containers/st-ci-base
docker exec -t saptune-ci /bin/sh -c "cd /app; ./run_saptune_ci_tst.sh;"

in $GOPATH/src/github.com/SUSE/saptune
Expand Down
10 changes: 8 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,14 @@ func callSaptuneCheckScript(arg string) {
cmdOut, err = exec.Command(saptcheck, "--json").CombinedOutput()
system.Jcollect(cmdOut)
} else {
// call external scrip saptune_check
cmd := exec.Command(saptcheck)
var cmd *exec.Cmd
// call external script saptune_check
if system.IsFlagSet("force-color") {
// call saptune_check unbuffered
cmd = exec.Command("unbuffer", saptcheck)
} else {
cmd = exec.Command(saptcheck)
}
cmd.Stdin = os.Stdin
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
Expand Down
6 changes: 3 additions & 3 deletions ospackage/man/saptune-note.5
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ Configure C-States for lower latency in Linux (applies to Intel-based systems on
Turn off autoNUMA balancing - see kernel.numa_balancing in section [sysctl] as 'alternative' settings
.TP
.BI transparent_hugepage=never
Disable transparent hugepages - see THP in section [vm] as 'alternative' settings
Configure transparent hugepages - see THP in section [vm] as 'alternative' settings
\" section limits
.SH "[limits]"
The section "[limits]" is dealing with ulimit settings for user login sessions in the pam_limits module. The settings will \fBNOT\fP be done in the central limits file \fI/etc/security/limits.conf\fP. Instead there will be a \fBdrop-in file\fP in \fI/etc/security/limits.d\fP for each domain-item-type combination used in the Note definition file.
Expand Down Expand Up @@ -653,9 +653,9 @@ The section "[vm]" manipulates \fI/sys/kernel/mm\fP switches.
This section can to contain the following options:
.TP
.BI THP= STRING
This option disables transparent hugepages by changing \fI/sys/kernel/mm/transparent_hugepage/enabled\fP
This option configures transparent hugepages by changing \fI/sys/kernel/mm/transparent_hugepage/enabled\fP
.br
Possible values are '\fBnever\fP' to disable and '\fBalways\fP' to enable.
Possible values are '\fBnever\fP' to disable, '\fBalways\fP' to enable and '\fBmadvise\fP'.
.TP
.BI KSM= INT
Kernel Samepage Merging (KSM). KSM allows for an application to register with the kernel so as to have its memory pages merged with other processes that also register to have their pages merged. For KVM the KSM mechanism allows for guest virtual machines to share pages with each other. In today's environment where many of the guest operating systems like XEN, KVM are similar and are running on same host machine, this can result in significant memory savings, the default value is set to 0.
Expand Down
61 changes: 32 additions & 29 deletions ospackage/man/saptune.8
Original file line number Diff line number Diff line change
Expand Up @@ -14,74 +14,74 @@
.\" * GNU General Public License for more details.
.\" */
.\"
.TH saptune "8" "October 2024" "" "System optimization For SAP"
.TH saptune "8" "November 2024" "" "System optimization For SAP"
.SH NAME
saptune \- Comprehensive system optimization management for SAP solutions (\fBVersion 3\fP)

ATTENTION: If you still use version \fB1\fP of saptune it's now time to migrate to saptune version \fB3\fP, so please refer to man page saptune-migrate(7).

.SH SYNOPSIS
\fBsaptune\fP [--format FORMAT] [--force-color] \fBdaemon\fP
\fBsaptune\fP [--format FORMAT] [--force-color] [--fun] \fBdaemon\fP
( start | stop | status [--non-compliance-check] ) \fBATTENTION: deprecated\fP

\fBsaptune\fP [--format FORMAT] [--force-color] \fBservice\fP
\fBsaptune\fP [--format FORMAT] [--force-color] [--fun] \fBservice\fP
( start | stop | restart | takeover | enable | disable | enablestart | disablestop | status [--non-compliance-check] )

\fBsaptune\fP [--format FORMAT] [--force-color] \fBnote\fP
\fBsaptune\fP [--format FORMAT] [--force-color] [--fun] \fBnote\fP
( list | verify | revertall | enabled | applied )

\fBsaptune\fP [--format FORMAT] [--force-color] \fBnote\fP
\fBsaptune\fP [--format FORMAT] [--force-color] [--fun] \fBnote\fP
( apply | simulate | customise | create | edit | revert | show | delete ) NOTEID

\fBsaptune\fP [--format FORMAT] [--force-color] \fBnote\fP
\fBsaptune\fP [--format FORMAT] [--force-color] [--fun] \fBnote\fP
verify [--colorscheme SCHEME] [--show-non-compliant] [NOTEID|applied]

\fBsaptune\fP [--format FORMAT] [--force-color] \fBnote\fP
\fBsaptune\fP [--format FORMAT] [--force-color] [--fun] \fBnote\fP
rename NOTEID NEWNOTEID

\fBsaptune\fP [--format FORMAT] [--force-color] \fBsolution\fP
\fBsaptune\fP [--format FORMAT] [--force-color] [--fun] \fBsolution\fP
( list | verify | enabled | applied )

\fBsaptune\fP [--format FORMAT] [--force-color] \fBsolution\fP
\fBsaptune\fP [--format FORMAT] [--force-color] [--fun] \fBsolution\fP
( apply | simulate | customise | create | edit | revert | show | delete ) SOLUTIONNAME

\fBsaptune\fP [--format FORMAT] [--force-color] \fBsolution\fP
\fBsaptune\fP [--format FORMAT] [--force-color] [--fun] \fBsolution\fP
change [--force] SOLUTIONNAME

\fBsaptune\fP [--format FORMAT] [--force-color] \fBsolution\fP
\fBsaptune\fP [--format FORMAT] [--force-color] [--fun] \fBsolution\fP
verify [--colorscheme SCHEME] [--show-non-compliant] [SOLUTIONNAME]

\fBsaptune\fP [--format FORMAT] [--force-color] \fBsolution\fP
\fBsaptune\fP [--format FORMAT] [--force-color] [--fun] \fBsolution\fP
rename SOLUTIONNAME NEWSOLUTIONNAME

\fBsaptune\fP [--format FORMAT] [--force-color] \fBstaging\fP
\fBsaptune\fP [--format FORMAT] [--force-color] [--fun] \fBstaging\fP
( status | enable | disable | is-enabled | list )

\fBsaptune\fP [--format FORMAT] [--force-color] \fBstaging\fP
( analysis | diff ) [ ( NOTEID | SOLUTIONNAME )... | all ]
\fBsaptune\fP [--format FORMAT] [--force-color] [--fun] \fBstaging\fP
( analysis | diff ) [ ( NOTEID | SOLUTIONNAME.sol )... | all ]

\fBsaptune\fP [--format FORMAT] [--force-color] \fBstaging\fP
release [--force|--dry-run] [ ( NOTEID | SOLUTIONNAME )... | all ]
\fBsaptune\fP [--format FORMAT] [--force-color] [--fun] \fBstaging\fP
release [--force|--dry-run] [ ( NOTEID | SOLUTIONNAME.sol )... | all ]

\fBsaptune\fP [--format FORMAT] [--force-color] \fBconfigure\fP
\fBsaptune\fP [--format FORMAT] [--force-color] [--fun] \fBconfigure\fP
( COLOR_SCHEME | SKIP_SYSCTL_FILES | IGNORE_RELOAD | DEBUG ) Value

\fBsaptune\fP [--format FORMAT] [--force-color] \fBconfigure\fP
\fBsaptune\fP [--format FORMAT] [--force-color] [--fun] \fBconfigure\fP
( reset | show )

\fBsaptune\fP [--format FORMAT] [--force-color] \fBverify\fP
\fBsaptune\fP [--format FORMAT] [--force-color] [--fun] \fBverify\fP
applied

\fBsaptune\fP [--format FORMAT] [--force-color] \fBrevert\fP
\fBsaptune\fP [--format FORMAT] [--force-color] [--fun] \fBrevert\fP
all

\fBsaptune\fP [--format FORMAT] [--force-color] \fBcheck\fP
\fBsaptune\fP [--format FORMAT] [--force-color] [--fun] \fBcheck\fP

\fBsaptune\fP [--format FORMAT] [--force-color] \fBstatus [--non-compliance-check]\fP
\fBsaptune\fP [--format FORMAT] [--force-color] [--fun] \fBstatus [--non-compliance-check]\fP

\fBsaptune\fP [--format FORMAT] [--force-color] \fBversion\fP
\fBsaptune\fP [--format FORMAT] [--force-color] [--fun] \fBversion\fP

\fBsaptune\fP [--format FORMAT] [--force-color] \fBhelp\fP
\fBsaptune\fP [--format FORMAT] [--force-color] [--fun] \fBhelp\fP

.SH DESCRIPTION
saptune is designed to automate the configuration recommendations from SAP and SUSE to run an SAP application on SLES for SAP. These configuration recommendations are normally referred to as SAP Notes. So some dedicated SAP Notes are the base for the work of saptune. Additional some best practice guides are added as Note definitions to optimize the system for some really special cases.
Expand Down Expand Up @@ -672,7 +672,7 @@ The solution definition is shown as a whole object. It is only possible to relea
.br
Lastly a hint is printed to remind the user that he has to release staged objects before he can use them and that it is possible to view the changes.
.TP
.B diff [ ( NOTEID | SOLUTIONNAME )... | all ]
.B diff [ ( NOTEID | SOLUTIONNAME.sol )... | all ]
Shows the differences between the Note (or all Notes) or the Solution definition in the staging area and the working area.
.br
For each Note in the staging area the output contains the values of all parameter which differ. This includes new or removed parameters as well as changes in the reminder section.
Expand All @@ -681,12 +681,12 @@ For the Solution, all changed solutions are displayed with their differences.
.br
Lastly a hint is printed to remind the user that he has to release staged objects before he can use them.
.TP
.B analysis [ ( NOTEID | SOLUTIONNAME )... | all ]
.B analysis [ ( NOTEID | SOLUTIONNAME.sol )... | all ]
Does an analysis of the requested Notes, the Solution definitions or everything in the staging area to warn the user about possible issues or additional steps to perform.
.br
Lastly a hint is printed to remind the user that he has to release staged objects before he can use them as well that he should check out the differences.
.TP
.B release [ ( NOTEID | SOLUTIONNAME )... | all ]
.B release [ ( NOTEID | SOLUTIONNAME.sol )... | all ]
Releases the requested Notes, the Solution definitions or everything in the stages area.
.br
This means the Notes or the Solution definitions get moved from the staging area to the working area. In case of a deleted Note/Solution, it will be removed from the working area.
Expand All @@ -704,7 +704,7 @@ Not all of the former variables will be available as configure option, only thos
.SS
.TP
.B COLOR_SCHEME SCHEME
Default color scheme. See saptune verify --colorscheme SCHEME for available schemes.
Default color scheme. See 'saptune verify' in this man page for available color schemes.
.TP
.B SKIP_SYSCTL_FILES FILE[,FILE...]
Comma-separated list of sysctl config files or directories which should be excluded when checking if parameters handled by saptune are handled by sysctl as well.
Expand Down Expand Up @@ -855,6 +855,9 @@ So we now \fBdeprecated\fP all "DAEMON ACTIONS" like '\fIsaptune daemon start\fP
.TP
.B version 3.1
With the update to saptune version 3.1 we \fBdeprecated\fP the actions '\fIsaptune note simulate\fP' and '\fIsaptune solution simulate\fP'.
.TP
.B version 3.2
With the update to saptune version 3.2 we \fBdeprecated\fP the manual editing of the file \fI/etc/sysconfig/saptune\fP as the main configuration file will be (re)moved in future versions.

.SH FILES
.PP
Expand Down
2 changes: 1 addition & 1 deletion ospackage/usr/share/saptune/notes/1410736
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
VERSION=6
DATE=15.06.2020
DESCRIPTION=TCP/IP: setting keepalive interval
REFERENCES=https://launchpad.support.sap.com/#/notes/1410736
REFERENCES=https://me.sap.com/notes/1410736

[sysctl]
net.ipv4.tcp_keepalive_time = 300
Expand Down
2 changes: 1 addition & 1 deletion ospackage/usr/share/saptune/notes/1557506
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
VERSION=16
DATE=06.02.2020
DESCRIPTION=Linux paging improvements
REFERENCES=https://launchpad.support.sap.com/#/notes/1557506
REFERENCES=https://me.sap.com/notes/1557506

[pagecache]
## Type: yesno
Expand Down
6 changes: 3 additions & 3 deletions ospackage/usr/share/saptune/notes/1656250
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# 1656250 - SAP on AWS: Support prerequisites - only Linux Operating System IO Recommendations

[version]
VERSION=63
DATE=05.02.2024
VERSION=69
DATE=10.10.2024
DESCRIPTION=SAP on AWS: Support prerequisites - only Linux Operating System IO Recommendations
REFERENCES=https://launchpad.support.sap.com/#/notes/1656250
REFERENCES=https://me.sap.com/notes/1656250

[sys:blkpat=nvme:csp=aws]
# On linux operating systems the kernel parameter nvme_core.io_timeout controls
Expand Down
Loading
Loading