sureshanaparti opened a new pull request, #10417:
URL: https://github.com/apache/cloudstack/pull/10417
### Description
This PR addresses the following improvements during MS maintenance
- Sends 503 (Service Unavailable) response status when maintenance or
shutdown is initiated
[Any load balancer in the clustered environment can avoid routing requests
to this MS node]
- Migrates systemvm agents before routing host agents
- Updates last agents (using the msid)
- Added events for maintenance and shutdown operations
- Some code improvements
<!--- Describe your changes in DETAIL - And how has behaviour functionally
changed. -->
<!-- For new features, provide link to FS, dev ML discussion etc. -->
<!-- In case of bug fix, the expected and actual behaviours, steps to
reproduce. -->
<!-- When "Fixes: #<id>" is specified, the issue/PR will automatically be
closed when this PR gets merged -->
<!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" -->
<!-- Fixes: # -->
<!---
*******************************************************************************
-->
<!--- NOTE: AUTOMATION USES THE DESCRIPTIONS TO SET LABELS AND PRODUCE
DOCUMENTATION. -->
<!--- PLEASE PUT AN 'X' in only **ONE** box -->
<!---
*******************************************************************************
-->
### Types of changes
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] Enhancement (improves an existing feature and functionality)
- [x] Cleanup (Code refactoring and cleanup, that may add test cases)
- [ ] build/CI
- [ ] test (unit or integration test code)
### Feature/Enhancement Scale or Bug Severity
#### Feature/Enhancement Scale
- [ ] Major
- [x] Minor
#### Bug Severity
- [ ] BLOCKER
- [ ] Critical
- [ ] Major
- [ ] Minor
- [ ] Trivial
### Screenshots (if appropriate):
### How Has This Been Tested?
<!-- Please describe in detail how you tested your changes. -->
<!-- Include details of your testing environment, and the tests you ran to
-->
Manually tested the changes.
```
(cmk) 🐱 > list managementservers
filter=uuid,name,state,pendingjobscount,agentscount,
count = 3
managementserver:
+------+-------------------------------------------------------------+-------------+------------------+-------------+
| UUID | NAME |
STATE | PENDINGJOBSCOUNT | AGENTSCOUNT |
+------+-------------------------------------------------------------+-------------+------------------+-------------+
| | ref-trl-7940-k-m7-suresh-anaparti-mgmt1 | Maintenance |
0 | 0 |
| | ref-trl-7940-k-m7-suresh-anaparti-mgmt2 | Up |
0 | 8 |
| | ref-trl-7940-k-m7-suresh-anaparti-mgmt3 | Up |
0 | 4 |
+------+-------------------------------------------------------------+-------------+------------------+-------------+
(cmk) 🐱 > list managementserversmetrics
filter=name,agentcount,agents,lastagents
count = 3
managementserver:
+-------------------------------------------------------------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
| NAME | AGENTCOUNT |
AGENTS
|
LASTAGENTS
|
+-------------------------------------------------------------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ref-trl-7940-k-m7-suresh-anaparti-mgmt1 | 0 | []
|
["4933c5ad-1b83-43ad-8f84-e3419b235657","8b57630e-6202-4c51-914c-6f4ddce52d79","b671e13f-a5eb-4ed2-b99d-080f3b776d0e","7d476ad8-c03d-4fdb-8c0d-f34f0f172d0b"]
|
| ref-trl-7940-k-m7-suresh-anaparti-mgmt2 | 8 |
["12462284-f84f-4b24-befa-4b75d0982015","13a5b8ae-2b4b-4977-91d7-f97adb7db564","e8de2144-efb3-408c-99a8-a2592fe2c7d9","794f8261-0a73-4edc-a829-5764deb266e8","bb832b60-f1e7-4601-b50f-8385636ada99","095d3cb6-51f6-4283-9960-e633b8d72cec","d72a4703-1770-445c-8d83-5193eb39cad7","c93e0bd4-9997-44d1-a730-697c7a11512f"]
|
|
| ref-trl-7940-k-m7-suresh-anaparti-mgmt3 | 4 |
["4933c5ad-1b83-43ad-8f84-e3419b235657","8b57630e-6202-4c51-914c-6f4ddce52d79","b671e13f-a5eb-4ed2-b99d-080f3b776d0e","7d476ad8-c03d-4fdb-8c0d-f34f0f172d0b"]
|
|
+-------------------------------------------------------------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
```
503 Service Unavailable response =>
```
(cmd) 🐱 > create volume diskofferingid=b8199316-68a0-4328-b97a-de50a9f65474
zoneid=02302e8a-be46-42b3-91fd-30c59b4a530d
🙈 Error: (HTTP 503, error code 9999) Maintenance or Shutdown has been
initiated on this management server. Can not accept new jobs
Request:
GET
/client/api/?zoneid=02302e8a-be46-42b3-91fd-30c59b4a530d&diskofferingid=b8199316-68a0-4328-b97a-de50a9f65474&name=testvol&command=createVolume&response=json&sessionkey=xGzNFCzSuhI1eh-uG9Ps593r2bY
HTTP/1.1
Response:
HTTP/1.1 503 Service Unavailable
Content-Type: application/json;charset=utf-8
X-Description: Maintenance or Shutdown has been initiated on this management
server. Can not accept new jobs
...
```
#### How did you try to break this feature and the system with this change?
<!-- see how your change affects other areas of the code, etc. -->
<!-- Please read the
[CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md)
document -->
--
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]