https://github.com/laimis9133/plankton-swarm
A simple manual Ceph pg balancer
https://github.com/laimis9133/plankton-swarm
balancer bash ceph ceph-balancer osd pg shell shell-script
Last synced: 3 months ago
JSON representation
A simple manual Ceph pg balancer
- Host: GitHub
- URL: https://github.com/laimis9133/plankton-swarm
- Owner: laimis9133
- License: wtfpl
- Created: 2024-12-15T16:46:46.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-11-03T21:49:05.000Z (7 months ago)
- Last Synced: 2025-11-03T23:23:59.733Z (7 months ago)
- Topics: balancer, bash, ceph, ceph-balancer, osd, pg, shell, shell-script
- Language: Shell
- Homepage:
- Size: 69.3 KB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Plankton Swarm
A simple alternative manual Ceph pg balancer.
It will move a number of pgs from the most full OSDs to the least full OSDs taking into acount node failure domain.
It is very simple and straightforward and I havent seen one written in bash so here you go. Hope it helps.
Usage examples:
```
./plankton-swarm.sh source-osds osd.1,osd.2 target-osds osd.3,osd.4 pgs 5
- Moves 5 PGs from OSDs 1,2 to OSDs 3,4
./plankton-swarm.sh source-osds 85-90 5 target-osds lt60 pgs 4
- Moves 4 PGs from 5 top OSDs between 85% and 90% to OSDs below 60% utilization
./plankton-swarm.sh source-osds 1,2
- Move 3 pgs (default) from osd.1 and osd.2 to OSDs below 65% (default) utilization
./plankton-swarm.sh source-osds gt88 10 target-osds lt60 5 pgs 10 keep-upmaps
- Moves 10 PGs from top 10 OSDs above 88% to 5 least utilized OSDs below 60%
- Skips pgs that already have upmap
./plankton-swarm.sh help
- Displays help and various other usage examples
```
This tool is harmless to run as it only generates an executable **swarm-file**.
You can run it directly:
```
./plankton-swarm.sh && bash swarm-file
```

Massive shoutouts to the famous [jj-balancer](https://github.com/TheJJ/ceph-balancer) and CERN's [upmap-remapped](https://github.com/cernceph/ceph-scripts/blob/master/tools/upmap/upmap-remapped.py) for the inspiration!