sreejasahithi opened a new pull request, #10681:
URL: https://github.com/apache/ozone/pull/10681
## What changes were proposed in this pull request?
Currently, when Container Balancer is stopped, `ozone admin
containerbalancer status` only reports: "ContainerBalancer is Not Running."
It would be helpful if after stop, status shows the last known run state:
- Stop reason (also in non-verbose mode)
- Start/stop timestamps, balancing duration, and configuration used ( with
--verbose flag)
- Last iteration details ( with --verbose flag)
- Iteration history details (with --verbose -H flag)
## What is the link to the Apache JIRA
[HDDS-15667](https://issues.apache.org/jira/browse/HDDS-15667)
## How was this patch tested?
Tested manually in docker cluster and added test cases.
```
bash-5.1$ ozone admin containerbalancer status --verbose -H
ContainerBalancer is Running.
Started at: 2026-07-06 07:02:10
Balancing duration: 18s
Container Balancer Configuration values:
Key Value
Threshold 0.1
Max Datanodes to Involve per Iteration(percent) 100
Max Size to Move per Iteration 500GB
Max Size Entering Target per Iteration 26GB
Max Size Leaving Source per Iteration 26GB
Number of Iterations 2
Time Limit for Single Container's Movement 65min
Time Limit for Single Container's Replication 50min
Interval between each Iteration 0min
Whether to Enable Network Topology false
Whether to Trigger Refresh Datanode Usage Info false
Container IDs to Include in Balancing None
Container IDs to Exclude from Balancing None
Datanodes Specified to be Balanced None
Datanodes Excluded from Balancing None
Current iteration info:
Key Value
Iteration number 1
Iteration duration 18s
Iteration result -
Size scheduled to move 300 MB
Moved data size 0 B
Scheduled to move containers 3
Already moved containers 0
Failed to move containers 0
Failed to move containers by timeout 0
Entered data to nodes
f46d7cf0-b35b-4229-a415-bd54c2206dd9 <- 200 MB
2438c217-695d-448b-bd1a-4f4a7afe9daa <- 100 MB
Exited data from nodes
b2a9ce1f-7a39-4b28-b71b-50f354ca2022 -> 100 MB
bfb500d0-b538-4d44-bbed-9f22863d10f2 -> 100 MB
b4cebd02-82fb-4b96-a05e-ab84b5f37d37 -> 100 MB
Iteration history list:
```
```
bash-5.1$ ozone admin containerbalancer status --verbose -H
ContainerBalancer is Not Running.
Stop reason: CAN_NOT_BALANCE_ANY_MORE
Started at: 2026-07-06 07:02:10
Stopped at: 2026-07-06 07:03:05
Balancing duration: 55s
Container Balancer Configuration values:
Key Value
Threshold 0.1
Max Datanodes to Involve per Iteration(percent) 100
Max Size to Move per Iteration 500GB
Max Size Entering Target per Iteration 26GB
Max Size Leaving Source per Iteration 26GB
Number of Iterations 2
Time Limit for Single Container's Movement 65min
Time Limit for Single Container's Replication 50min
Interval between each Iteration 0min
Whether to Enable Network Topology false
Whether to Trigger Refresh Datanode Usage Info false
Container IDs to Include in Balancing None
Container IDs to Exclude from Balancing None
Datanodes Specified to be Balanced None
Datanodes Excluded from Balancing None
Last iteration info:
Key Value
Iteration number 2
Iteration duration 0s
Iteration result CAN_NOT_BALANCE_ANY_MORE
Size scheduled to move 0 B
Moved data size 0 B
Scheduled to move containers 0
Already moved containers 0
Failed to move containers 0
Failed to move containers by timeout 0
Entered data to nodes
-
Exited data from nodes
-
Iteration history list:
Key Value
Iteration number 1
Iteration duration 30s
Iteration result ITERATION_COMPLETED
Size scheduled to move 300 MB
Moved data size 300 MB
Scheduled to move containers 3
Already moved containers 3
Failed to move containers 0
Failed to move containers by timeout 0
Entered data to nodes
f46d7cf0-b35b-4229-a415-bd54c2206dd9 <- 200 MB
2438c217-695d-448b-bd1a-4f4a7afe9daa <- 100 MB
Exited data from nodes
b2a9ce1f-7a39-4b28-b71b-50f354ca2022 -> 100 MB
bfb500d0-b538-4d44-bbed-9f22863d10f2 -> 100 MB
b4cebd02-82fb-4b96-a05e-ab84b5f37d37 -> 100 MB
Key Value
Iteration number 2
Iteration duration 0s
Iteration result CAN_NOT_BALANCE_ANY_MORE
Size scheduled to move 0 B
Moved data size 0 B
Scheduled to move containers 0
Already moved containers 0
Failed to move containers 0
Failed to move containers by timeout 0
Entered data to nodes
-
Exited data from nodes
-
```
```
bash-5.1$ ozone admin containerbalancer status
ContainerBalancer is Not Running.
Stop reason: CAN_NOT_BALANCE_ANY_MORE
```
Green CI : https://github.com/sreejasahithi/ozone/actions/runs/28775666320
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]