Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jj-ceph-balancer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
resplat-public
jj-ceph-balancer
Compare revisions
c423ed489d53162c2764e3e6f1c1e4d8364721f2 to e814fa82baa27b7bddc422377316d5dc911f0b17
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
resplat-public/jj-ceph-balancer
Select target project
No results found
e814fa82baa27b7bddc422377316d5dc911f0b17
Select Git revision
Swap
Target
resplat-public/jj-ceph-balancer
Select target project
resplat-public/jj-ceph-balancer
1 result
c423ed489d53162c2764e3e6f1c1e4d8364721f2
Select Git revision
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (2)
Use --only-poolid instead of bugfix
· 7fb6df18
William Xiong
authored
6 months ago
and
Justin Mammarella
committed
6 months ago
7fb6df18
Merge branch 'add_only_poolid' into 'master'
· e814fa82
Justin Mammarella
authored
6 months ago
Use --only-poolid instead of bugfix See merge request
!3
e814fa82
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ceph-jj-balancer.conf
+3
-5
3 additions, 5 deletions
ceph-jj-balancer.conf
placementoptimizer.py
+0
-18
0 additions, 18 deletions
placementoptimizer.py
placementoptimizer_service.sh
+6
-3
6 additions, 3 deletions
placementoptimizer_service.sh
with
9 additions
and
26 deletions
ceph-jj-balancer.conf
View file @
e814fa82
...
...
@@ -17,14 +17,12 @@ MAX_REMAPS="20"
#Maximum number of pg movement attempts per osd. (--max-move-attempts)
MAX_MOVE_ATTEMPTS
=
"50"
#Name of the pool that JJ should balance. The ID of this pool will be fed into (--only-poolid)
POOL
=
"cephfs_data"
################################
#### Shell Script arguments ####
################################
#Don't run placementoptimizer.py if the number of remapped pgs exceed this threshold
PG_THRESHOLD
=
"1"
#The name of the pool used to search for remapped pgs.
#If left undefined, remapped pgs in the whole cluster will be considered.
#POOL="mf1fs_data"
This diff is collapsed.
Click to expand it.
placementoptimizer.py
View file @
e814fa82
...
...
@@ -4668,24 +4668,6 @@ def balance(args, cluster):
if osd_from not in source_osds:
continue
## WX BUGFIX --- Only utilize the osds with the right crushclass
#Iterate through valid crushclasses
for crushclass_name in pg_mappings.get_enabled_crushclasses():
osds_in_crushclass = cluster.get_crushclass_osds(crushclass_name)
#Skip balancing the OSD if it does not have the right crushclass
if osd_from not in osds_in_crushclass:
logging.info(f"-BUGFIX: WE ARE ONLY USING CRUSHCLASS: {crushclass_name}")
logging.info(f"-BUGFIX: OSD: {osd_from} HAS INVALID CRUSHCLASS - SKIPPING")
skip_osd=True
continue
else:
skip_osd=False
#Comment/uncomment this if statement to see effects of bugfix
if skip_osd:
continue
source_attempts += 1
if source_attempts > args.max_move_attempts:
...
...
This diff is collapsed.
Click to expand it.
placementoptimizer_service.sh
View file @
e814fa82
...
...
@@ -47,9 +47,12 @@ if [ -n "$5" ]
#Which Pool to use to search for remapped pgs.
POOL
=
$5
POOL_ID
=
$(
ceph
df
--format
json | jq
--arg
poolname
$POOL
'.pools[] | select(.name == $poolname) | .id'
)
echo
"Using Pool:
$POOL
with pool_id:
$POOL_ID
"
else
echo
"Must Specify which pool to balance. Exiting"
exit
1
fi
echo
"Using Pool:
$POOL
with pool_id:
$POOL_ID
"
echo
"Using Device Class:
$DEV_CLASS
"
echo
"Using PG Threshold:
$PG_THRESHOLD
"
echo
"Using Max Remaps:
$MAX_REMAPS
"
...
...
@@ -81,7 +84,7 @@ wait_remapped() {
}
while
[
1
]
;
do
wait_remapped
timeout
600 ./placementoptimizer.py
-v
balance
--max-pg-moves
$MAX_REMAPS
--only-crushclass
$DEV_CLASS
--max-move-attempts
$MAX_MOVE_ATTEMPTS
|
tee
/tmp/balance-upmaps
wait_remapped
timeout
600 ./placementoptimizer.py
-v
balance
--max-pg-moves
$MAX_REMAPS
--only-crushclass
$DEV_CLASS
--max-move-attempts
$MAX_MOVE_ATTEMPTS
--only-poolid
$POOL_ID
|
tee
/tmp/balance-upmaps
cat
/tmp/balance-upmaps | /bin/bash
done
This diff is collapsed.
Click to expand it.