Skip to content

Commit

Permalink
Simplify management of tuned
Browse files Browse the repository at this point in the history
Disassociate the specific role names from their purpose.  Considering
that multiple roles can be assigned to a minion, applying a ceph-osd
profile to a gateway or having identical profiles for each role is
unnecessary.

Signed-off-by: Eric Jackson <[email protected]>
  • Loading branch information
swiftgist committed Nov 11, 2019
1 parent 9c6947a commit fa2c886
Show file tree
Hide file tree
Showing 25 changed files with 106 additions and 218 deletions.
24 changes: 8 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ copy-files:
install -d -m 755 $(DESTDIR)/srv/salt/ceph/tests/restart/rgw/forced
install -d -m 755 $(DESTDIR)/srv/salt/ceph/tests/restart/rgw/nochange
install -d -m 755 $(DESTDIR)/srv/salt/ceph/tests/tuned
install -d -m 755 $(DESTDIR)/srv/salt/ceph/tests/tuned/off
install -d -m 755 $(DESTDIR)/srv/salt/ceph/tests/symlink
install -m 644 srv/salt/ceph/tests/restart/*.sls $(DESTDIR)/srv/salt/ceph/tests/restart
install -m 644 srv/salt/ceph/tests/restart/mon/*.sls $(DESTDIR)/srv/salt/ceph/tests/restart/mon
Expand All @@ -138,7 +137,6 @@ copy-files:
install -m 644 srv/salt/ceph/tests/restart/rgw/forced/*.sls $(DESTDIR)/srv/salt/ceph/tests/restart/rgw/forced
install -m 644 srv/salt/ceph/tests/restart/rgw/nochange/*.sls $(DESTDIR)/srv/salt/ceph/tests/restart/rgw/nochange
install -m 644 srv/salt/ceph/tests/tuned/*.sls $(DESTDIR)/srv/salt/ceph/tests/tuned
install -m 644 srv/salt/ceph/tests/tuned/off/*.sls $(DESTDIR)/srv/salt/ceph/tests/tuned/off
install -m 644 srv/salt/ceph/tests/symlink/*.sls $(DESTDIR)/srv/salt/ceph/tests/symlink
# functests/1node
install -d -m 755 $(DESTDIR)/srv/salt/ceph/functests/1node
Expand All @@ -164,9 +162,8 @@ copy-files:
install -m 644 srv/salt/ceph/functests/1node/restart/*.sls $(DESTDIR)/srv/salt/ceph/functests/1node/restart
install -d -m 755 $(DESTDIR)/srv/salt/ceph/functests/1node/terminate
install -m 644 srv/salt/ceph/functests/1node/terminate/*.sls $(DESTDIR)/srv/salt/ceph/functests/1node/terminate
install -d -m 755 $(DESTDIR)/srv/salt/ceph/functests/1node/tuned/off
install -d -m 755 $(DESTDIR)/srv/salt/ceph/functests/1node/tuned
install -m 644 srv/salt/ceph/functests/1node/tuned/*.sls $(DESTDIR)/srv/salt/ceph/functests/1node/tuned
install -m 644 srv/salt/ceph/functests/1node/tuned/off/*.sls $(DESTDIR)/srv/salt/ceph/functests/1node/tuned/off
install -d -m 755 $(DESTDIR)/srv/salt/ceph/functests/1node/symlink
install -m 644 srv/salt/ceph/functests/1node/symlink/*.sls $(DESTDIR)/srv/salt/ceph/functests/1node/symlink
# functests/3nodes
Expand Down Expand Up @@ -764,20 +761,15 @@ copy-files:
install -m 644 srv/salt/ceph/terminate/storage/*.sls $(DESTDIR)/srv/salt/ceph/terminate/storage
# state files - tuned
install -d -m 755 $(DESTDIR)/srv/salt/ceph/tuned
install -d -m 755 $(DESTDIR)/srv/salt/ceph/tuned/osd
install -d -m 755 $(DESTDIR)/srv/salt/ceph/tuned/mon
install -d -m 755 $(DESTDIR)/srv/salt/ceph/tuned/mgr
install -m 644 srv/salt/ceph/tuned/osd/*.sls $(DESTDIR)/srv/salt/ceph/tuned/osd
install -m 644 srv/salt/ceph/tuned/mon/*.sls $(DESTDIR)/srv/salt/ceph/tuned/mon
install -m 644 srv/salt/ceph/tuned/mgr/*.sls $(DESTDIR)/srv/salt/ceph/tuned/mgr
install -d -m 755 $(DESTDIR)/srv/salt/ceph/tuned/latency
install -d -m 755 $(DESTDIR)/srv/salt/ceph/tuned/throughput
install -d -m 755 $(DESTDIR)/srv/salt/ceph/tuned/off
install -m 644 srv/salt/ceph/tuned/latency/*.sls $(DESTDIR)/srv/salt/ceph/tuned/latency
install -m 644 srv/salt/ceph/tuned/throughput/*.sls $(DESTDIR)/srv/salt/ceph/tuned/throughput
install -m 644 srv/salt/ceph/tuned/off/*.sls $(DESTDIR)/srv/salt/ceph/tuned/off
# conf files - tuned
install -d -m 755 $(DESTDIR)/srv/salt/ceph/tuned/files
install -d -m 755 $(DESTDIR)/srv/salt/ceph/tuned/files/ceph-osd
install -d -m 755 $(DESTDIR)/srv/salt/ceph/tuned/files/ceph-mon
install -d -m 755 $(DESTDIR)/srv/salt/ceph/tuned/files/ceph-mgr
install -m 644 srv/salt/ceph/tuned/files/ceph-osd/*.conf $(DESTDIR)/srv/salt/ceph/tuned/files/ceph-osd
install -m 644 srv/salt/ceph/tuned/files/ceph-mon/*.conf $(DESTDIR)/srv/salt/ceph/tuned/files/ceph-mon
install -m 644 srv/salt/ceph/tuned/files/ceph-mgr/*.conf $(DESTDIR)/srv/salt/ceph/tuned/files/ceph-mgr
install -m 644 srv/salt/ceph/tuned/files/*.conf $(DESTDIR)/srv/salt/ceph/tuned/files
# state files - update
install -d -m 755 $(DESTDIR)/srv/salt/ceph/upgrade
install -m 644 srv/salt/ceph/upgrade/*.sls $(DESTDIR)/srv/salt/ceph/upgrade
Expand Down
20 changes: 8 additions & 12 deletions deepsea.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -388,13 +388,10 @@ systemctl try-restart salt-api > /dev/null 2>&1 || :
%dir /srv/salt/ceph/time/ntp
%dir /srv/salt/ceph/time/ntp/files
%dir /srv/salt/ceph/tuned
%dir /srv/salt/ceph/tuned/mgr
%dir /srv/salt/ceph/tuned/mon
%dir /srv/salt/ceph/tuned/osd
%dir /srv/salt/ceph/tuned/latency
%dir /srv/salt/ceph/tuned/throughput
%dir /srv/salt/ceph/tuned/off
%dir /srv/salt/ceph/tuned/files
%dir /srv/salt/ceph/tuned/files/ceph-mgr
%dir /srv/salt/ceph/tuned/files/ceph-mon
%dir /srv/salt/ceph/tuned/files/ceph-osd
%dir /srv/salt/ceph/maintenance
%dir /srv/salt/ceph/maintenance/upgrade
%dir /srv/salt/ceph/maintenance/noout
Expand Down Expand Up @@ -732,12 +729,11 @@ systemctl try-restart salt-api > /dev/null 2>&1 || :
%config /srv/salt/ceph/time/chrony/files/*.j2
%config /srv/salt/ceph/time/ntp/*.sls
%config /srv/salt/ceph/time/ntp/files/*.j2
%config /srv/salt/ceph/tuned/mgr/*.sls
%config /srv/salt/ceph/tuned/mon/*.sls
%config /srv/salt/ceph/tuned/osd/*.sls
%config /srv/salt/ceph/tuned/files/ceph-mgr/tuned.conf
%config /srv/salt/ceph/tuned/files/ceph-mon/tuned.conf
%config /srv/salt/ceph/tuned/files/ceph-osd/tuned.conf
%config /srv/salt/ceph/tuned/latency/*.sls
%config /srv/salt/ceph/tuned/throughput/*.sls
%config /srv/salt/ceph/tuned/off/*.sls
%config /srv/salt/ceph/tuned/files/latency.conf
%config /srv/salt/ceph/tuned/files/throughput.conf
%config /srv/salt/ceph/upgrade/*.sls
%config /srv/salt/ceph/maintenance/noout/*.sls
%config /srv/salt/ceph/maintenance/upgrade/*.sls
Expand Down
20 changes: 4 additions & 16 deletions srv/salt/ceph/functests/1node/tuned/init.sls
Original file line number Diff line number Diff line change
@@ -1,23 +1,11 @@
Apply mgr tuned states:
salt.state:
- tgt: 'I@roles:mgr and I@cluster:ceph'
- tgt_type: compound
- sls: ceph.tuned.mgr

Apply mon tuned states:
Apply latency tuned states:
salt.state:
- tgt: 'I@roles:mon and I@cluster:ceph'
- tgt_type: compound
- sls: ceph.tuned.mon
- sls: ceph.tuned.latency

Apply osd tuned states:
Apply throughput tuned states:
salt.state:
- tgt: 'I@roles:storage and I@cluster:ceph'
- tgt_type: compound
- sls: ceph.tuned.osd

Check tuned for ses roles:
salt.state:
- tgt: "I@roles:storage or I@roles:mon or I@roles:mgr"
- tgt_type: compound
- sls: ceph.tests.tuned
- sls: ceph.tuned.throughput
23 changes: 0 additions & 23 deletions srv/salt/ceph/functests/1node/tuned/off/init.sls

This file was deleted.

26 changes: 14 additions & 12 deletions srv/salt/ceph/stage/deploy/core/default.sls
Original file line number Diff line number Diff line change
Expand Up @@ -148,26 +148,28 @@ deploy osds:
- name: disks.deploy
- failhard: True

mgr tuned:
latency tuned:
salt.state:
- tgt: 'I@roles:mgr and I@cluster:ceph'
- tgt: '( I@roles:mgr or I@roles:mon ) and I@cluster:ceph'
- tgt_type: compound
- sls: ceph.tuned.mgr
- sls: ceph.tuned.latency
- failhard: True

mon tuned:
salt.state:
- tgt: 'I@roles:mon and I@cluster:ceph'
- tgt_type: compound
- sls: ceph.tuned.mon
- failhard: True
{% set deepsea_minions = salt['saltutil.runner']('deepsea_minions.matches') %}
{% set mons = salt['saltutil.runner']('select.minions', roles='mon') %}
{% set mgrs = salt['saltutil.runner']('select.minions', roles='mgr') %}

osd tuned:
{% set throughput_minions = deepsea_minions | difference(mons) | difference(mgrs) | join(',') %}


{% if throughput_minions != "" %}
throughput tuned:
salt.state:
- tgt: 'I@roles:storage and I@cluster:ceph'
- tgt: 'not ( I@roles:mgr or I@roles:mon ) and I@cluster:ceph'
- tgt_type: compound
- sls: ceph.tuned.osd
- sls: ceph.tuned.throughput
- failhard: True
{% endif %}

pools:
salt.state:
Expand Down
14 changes: 0 additions & 14 deletions srv/salt/ceph/tuned/files/ceph-mon/tuned.conf

This file was deleted.

File renamed without changes.
File renamed without changes.
18 changes: 18 additions & 0 deletions srv/salt/ceph/tuned/latency/default.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

/etc/tuned/ceph-latency/tuned.conf:
file.managed:
- source: salt://ceph/tuned/files/latency.conf
- makedirs: True
- user: root
- group: root
- mode: 644

start tuned for latency profile:
service.running:
- name: tuned
- enable: True

apply latency profile:
cmd.run:
- name: 'tuned-adm profile ceph-latency'

3 changes: 3 additions & 0 deletions srv/salt/ceph/tuned/latency/disabled.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

tuned latency nop:
test.nop
3 changes: 3 additions & 0 deletions srv/salt/ceph/tuned/latency/init.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

include:
- .{{ salt['pillar.get']('tuned_latency', 'default') }}
17 changes: 0 additions & 17 deletions srv/salt/ceph/tuned/mgr/default-off.sls

This file was deleted.

16 changes: 0 additions & 16 deletions srv/salt/ceph/tuned/mgr/default.sls

This file was deleted.

3 changes: 0 additions & 3 deletions srv/salt/ceph/tuned/mgr/init.sls

This file was deleted.

15 changes: 0 additions & 15 deletions srv/salt/ceph/tuned/mon/default-off.sls

This file was deleted.

22 changes: 0 additions & 22 deletions srv/salt/ceph/tuned/mon/default.sls

This file was deleted.

3 changes: 0 additions & 3 deletions srv/salt/ceph/tuned/mon/init.sls

This file was deleted.

21 changes: 21 additions & 0 deletions srv/salt/ceph/tuned/off/default.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

stop tuned:
service.dead:
- name: tuned
- enable: False

/etc/tuned/ceph-latency/:
file.absent

/etc/tuned/ceph-throughput/:
file.absent

/etc/tuned/ceph-mon/:
file.absent

/etc/tuned/ceph-mgr/:
file.absent

/etc/tuned/ceph-osd/:
file.absent

3 changes: 3 additions & 0 deletions srv/salt/ceph/tuned/off/init.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

include:
- .{{ salt['pillar.get']('tuned_off', 'default') }}
17 changes: 0 additions & 17 deletions srv/salt/ceph/tuned/osd/default-off.sls

This file was deleted.

29 changes: 0 additions & 29 deletions srv/salt/ceph/tuned/osd/default.sls

This file was deleted.

3 changes: 0 additions & 3 deletions srv/salt/ceph/tuned/osd/init.sls

This file was deleted.

Loading

0 comments on commit fa2c886

Please sign in to comment.