566329ee | 22-May-2020 |
Manojkiran Eda <manojkiran.eda@gmail.com> |
Lock Management : Add Support for Mutltiple HMC's
- The Lock Structure already had the HMC-ID field which stores the corresponding unique Identifier that tells us which HMC has acquired the Lock
Lock Management : Add Support for Mutltiple HMC's
- The Lock Structure already had the HMC-ID field which stores the corresponding unique Identifier that tells us which HMC has acquired the Lock.
- Now, that the Know you client functionality is up, we can leverage the clientId field in the bmcweb session store to fill the lock structure with the corresponding hmc identifier.
NOTE : Also note that a Single HMC can have mutliple session that can acquire different locks, So when the ownership of any lock is tied up to its cliendId as well as the SessionId.
- Release Lock call on any Transaction ID can only be successful if the transactionID of corresponding lock has the complete owner-ship as per the NOTE mentioned above.
Tested By:
1. CREATE Session with Client ID as mentioned below:
'{"UserName":"root", "Password":"0penBmc", "Oem":{"OpenBMC" : {"ClientID":<unique id>}}}'
2. Make sure the GetLockList of the above session populates the CliendID field as per data mentioned in the login Request.
3. Release Lock on transaction ID with same HMC-ID but with different sessionID's should be successful only when both the HMC-ID(mapped to X-Auth tokens in the session store) & Session ID(from the session store) of the ReleaseLock request matches with the ownwership of the lock pertaining to the transaction ID in the request.
Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com> Change-Id: I60161bea6007782a397fc60f19d44c2211d4cf7f
show more ...
|
55fd1a9b | 30-Apr-2020 |
Manojkiran Eda <manojkiran.eda@gmail.com> |
AcquireLock : ResourceID Endianness Changes
- HMC constructs the resourceID with the First Segment data in the First Byte of the resourceID from the MSB position.
- As BMC is a Little Endi
AcquireLock : ResourceID Endianness Changes
- HMC constructs the resourceID with the First Segment data in the First Byte of the resourceID from the MSB position.
- As BMC is a Little Endian machine, and we need to convert the endian-ness before processing the resourceID.
Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com> Change-Id: Ieb0b0f8083c4c2cbd2b19477507e67378d5704ba
show more ...
|
07386c67 | 14-Dec-2019 |
Ratan Gupta <ratagupt@linux.vnet.ibm.com> |
Remove the locks associated with the session
This commit does the following => makes the lock class singleton. => during session timeout erase the locks associated with the session. => Erase the loc
Remove the locks associated with the session
This commit does the following => makes the lock class singleton. => during session timeout erase the locks associated with the session. => Erase the locks when the session is explicitly deleted on a user request.
We need to find a different way of calculating session timeout currently session timeout gets calculated when the request comes to BMC.
TODO: We need some module which keeps looking at the sessions in certain time interval and earse the session if it is timeout, It is useful in the case where there is resources which gets free after session timeout.
It may happen that client gets the session, obtain cerain resources on that session and never sends any request, in that case session timeout will never occur for that session.
Signed-off-by: Ratan Gupta <ratagupt@linux.vnet.ibm.com> Change-Id: Ic9962f761fc84a03747a90bd951ea36eb8962455
show more ...
|
402b5717 | 13-Dec-2019 |
manojkiraneda <manojkiran.eda@gmail.com> |
Implement GetLockList function in Lock Service
- This commit implements the GetLockList rest API, by which any external client(with admin privelege) can get a list of locks obtained by providin
Implement GetLockList function in Lock Service
- This commit implements the GetLockList rest API, by which any external client(with admin privelege) can get a list of locks obtained by providing the list of sessionID's as input.
TestedBy:
1. Get the session ID from the Session Service
curl -k -H "X-Auth-Token: $bmc_tokens" -X GET https://<ip>/redfish/v1/SessionService/Sessions/ { "@odata.context": "/redfish/v1/$metadata#SessionCollection.SessionCollection", "@odata.id": "/redfish/v1/SessionService/Sessions/", "@odata.type": "#SessionCollection.SessionCollection", "Description": "Session Collection", "Members": [ { "@odata.id": "/redfish/v1/SessionService/Sessions/qM4D0VfZt3" }, { "@odata.id": "/redfish/v1/SessionService/Sessions/bjYCiBSCIh" }, { "@odata.id": "/redfish/v1/SessionService/Sessions/LkfHvJFggY" }, { "@odata.id": "/redfish/v1/SessionService/Sessions/6RKP0aN5Gi" } ], "Members@odata.count": 4, "Name": "Session Collection" }
2. Use the GetLockList API to obtain the locks owned by a particular session.
curl -k -H "X-Auth-Token:$bmc_tokens" -XPOST -H "Content-type: application/json" -d '{"SessionIDs": ["qM4D0VfZt3","bjYCiBSCIh"]}' https://127.0.0.1:2443/ibm/v1/HMC/LockService/Actions/LockService.GetLockList { "Records": [ { "HMCID": "hmc-id", "LockType": "Read", "ResourceID": 256, "SegmentFlags": [ { "LockFlag": "LockSame", "SegmentLength": 3 }, { "LockFlag": "DontLock", "SegmentLength": 4 } ], "SessionID": "qM4D0VfZt3", "TransactionID": 1 } ] }
Signed-off-by: manojkiraneda <manojkiran.eda@gmail.com> Change-Id: I9375e2927938ab682df06ef60c823b279a7efead
show more ...
|
3b6dea60 | 13-Dec-2019 |
manojkiraneda <manojkiran.eda@gmail.com> |
Implement Release Lock in Lock Service
- This commit implements the Release Lock rest API, so that any external client(having admin-privelege) can release the locks owned by it.
Tested By:
1.c
Implement Release Lock in Lock Service
- This commit implements the Release Lock rest API, so that any external client(having admin-privelege) can release the locks owned by it.
Tested By:
1.curl -k -H "X-Auth-Token:$bmc_tokens" -XPOST -H "Content-type: application/json" -d '{ "Request" :[ { "LockType":"Read", "SegmentFlags": [ {"LockFlag":"LockSame","SegmentLength":3}, {"LockFlag":"DontLock","SegmentLength":4} ], "ResourceID": 256 } ] }' https://<ip>/ibm/v1/HMC/LockService/Actions/LockService.AcquireLock { "TransactionID": 1 }
2.curl -k -H "X-Auth-Token:$bmc_tokens" -XPOST -H "Content-type: application/json" -d '{ "Request" :[ { "LockType":"Read", "SegmentFlags": [ {"LockFlag":"LockSame","SegmentLength":3}, {"LockFlag":"DontLock","SegmentLength":4} ], "ResourceID": 256 } ] }' https://<ip>/ibm/v1/HMC/LockService/Actions/LockService.AcquireLock { "TransactionID": 2 }
3. Try releasing the lock owned by it
curl -k -H "X-Auth-Token:$bmc_tokens" -XPOST -H "Content-type: application/json" -d '{"TransactionIDs": [1]}' https://<ip>/ibm/v1/HMC/LockService/Actions/LockService.ReleaseLock
4. Try releasing the lock, which is not owned by the same session
curl -k -H "X-Auth-Token:$bmc_tokens" -XPOST -H "Content-type: application/json" -d '{"TransactionIDs": [2]}' https://127.0.0.1:2443/ibm/v1/HMC/LockService/Actions/LockService.ReleaseLock
{ "Record": { "HMCID": "hmc-id", "LockType": "Read", "ResourceID": 256, "SegmentFlags": [ { "LockFlag": "LockSame", "SegmentLength": 3 }, { "LockFlag": "DontLock", "SegmentLength": 4 } ], "SessionID": "qM4D0VfZt3", "TransactionID": 2 } }
Signed-off-by: manojkiraneda <manojkiran.eda@gmail.com> Change-Id: I5d75d44ce805358b25dc293db4dc0f44f4317c06
show more ...
|
0b631aea | 03-Dec-2019 |
manojkiraneda <manojkiran.eda@gmail.com> |
Implement Acquire Lock Function in Lock Service
- This commit implements the rest API by which any external client(Ex: Hardware Management Console) can request for a single/multiple locks as per th
Implement Acquire Lock Function in Lock Service
- This commit implements the rest API by which any external client(Ex: Hardware Management Console) can request for a single/multiple locks as per the design specification mentioned in `docs/designs/management-console/hmc-lock-management.md`
Tested By:
1. curl -k -H "X-Auth-Token:$bmc_tokens" -XPOST -H "Content-type: application/json" -d '{ "Request" :[ { "LockType":"Read", "SegmentFlags": [ {"LockFlag":"LockSame","SegmentLength":3}, {"LockFlag":"DontLock","SegmentLength":4} ], "ResourceID": 256 } ] }' https://<ip>/ibm/v1/HMC/LockService/Actions/LockService.AcquireLock
2.curl -k -H "X-Auth-Token:$bmc_tokens" -XPOST -H "Content-type: application/json" -d '{ "Request" :[ { "LockType":"Read", "SegmentFlags": [ {"LockFlag":"LockAll","SegmentLength":2}, {"LockFlag":"DontLock","SegmentLength":1} ], "ResourceID": 234 }, { "LockType" : "Read", "SegmentFlags": [ {"LockFlag":"DontLock","SegmentLength":2}, {"LockFlag":"DontLock","SegmentLength":1} ], "ResourceID": 234 } ]}' https://<ip>/ibm/v1/HMC/LockService/Actions/LockService.AcquireLock
Signed-off-by: manojkiraneda <manojkiran.eda@gmail.com> Change-Id: Ia173878702afe7c00160b7935d6a03099b7df622
show more ...
|
734a1c37 | 14-Dec-2019 |
Ratan Gupta <ratagupt@linux.vnet.ibm.com> |
Implement lock service introspect
This will list down the actions implemented by the Lock Service.
TestedBy: curl -k -H "X-Auth-Token: $bmc_tokens" -X GET https://<ip>:443/ibm/v1/HMC/LockService {
Implement lock service introspect
This will list down the actions implemented by the Lock Service.
TestedBy: curl -k -H "X-Auth-Token: $bmc_tokens" -X GET https://<ip>:443/ibm/v1/HMC/LockService { "Actions": { "#LockService.AcquireLock": { "target": "/ibm/v1/HMC/LockService/Actions/LockService.AcquireLock" }, "#LockService.GetLockList": { "target": "/ibm/v1/HMC/LockService/Actions/LockService.GetLockList" }, "#LockService.ReleaseLock": { "target": "/ibm/v1/HMC/LockService/Actions/LockService.ReleaseLock" } } }
Signed-off-by: Ratan Gupta <ratagupt@linux.vnet.ibm.com> Change-Id: Ifeb53c06c4ff80676c892f1e64518469a3aeb239
show more ...
|
d3630cb8 | 13-Dec-2019 |
Ratan Gupta <ratagupt@linux.vnet.ibm.com> |
Implement config file collection
This commit list the config files and implements the action to delete all the config files
TestedBy:
List config files:
curl -k -H "X-Auth-Token: $bmc_tokens" -X
Implement config file collection
This commit list the config files and implements the action to delete all the config files
TestedBy:
List config files:
curl -k -H "X-Auth-Token: $bmc_tokens" -X GET https://<ip>:443/ibm/v1/Host/ConfigFiles
Delete all the config files:
curl -k -H "X-Auth-Token: $bmc_tokens" -X POST https://<ip>:443/ibm/v1/Host/ConfigFiles/Actions/FileCollection.DeleteAll
Signed-off-by: Ratan Gupta <ratagupt@linux.vnet.ibm.com> Change-Id: I1a32906709ba32c8bd5328d8eb983705f8a3a6cd
show more ...
|
1c7b07c7 | 09-Sep-2019 |
asmithakarun <asmitk01@in.ibm.com> |
Read and Delete config files through REST interface
This commit supports Read, Delete the config files through REST interface.
Test-by:
1. Read a save area file: curl -k -H "X-Auth-Token: $bmc_tok
Read and Delete config files through REST interface
This commit supports Read, Delete the config files through REST interface.
Test-by:
1. Read a save area file: curl -k -H "X-Auth-Token: $bmc_token" -X GET https://${bmc}/ibm/v1/Host/ConfigFiles/<filename>
2. Delete a save area file: curl -k -H "X-Auth-Token: $bmc_token" -X DELETE https://${bmc}/ibm/v1/Host/ConfigFiles/<filename>
Signed-off-by: Asmitha Karunanithi <asmitk01@in.ibm.com> Change-Id: Id326b516e84e93c68d2260f5372e6e7f123a0e87 Signed-off-by: Sunitha Harish <sunithaharish04@gmail.com>
show more ...
|
97b0e43a | 21-Nov-2019 |
Sunitha Harish <sunithaharish04@gmail.com> |
Save-area file upload to BMC
This change includes: 1. New compiler option for the IBM management console specific functionalities 2. New REST path handler for the IBM path /ibm/v1/Host/ConfigFiles 3
Save-area file upload to BMC
This change includes: 1. New compiler option for the IBM management console specific functionalities 2. New REST path handler for the IBM path /ibm/v1/Host/ConfigFiles 3. Save-Area file Upload through REST interface PUT command
Tested by : curl -k -H "X-Auth-Token: $bmc_token" -X PUT https://${bmc}/ibm/v1/Host/ConfigFiles/<filename> --data-binary "@<filepath>"
Signed-off-by: Sunitha Harish <sunithaharish04@gmail.com> Change-Id: I939938009b2de447aea9af5bb3c53bdb845c4084
show more ...
|