feat: implement KVM enable and disable flow using ServiceEnabled#964
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## redfish #964 +/- ##
===========================================
+ Coverage 41.22% 41.49% +0.26%
===========================================
Files 152 152
Lines 14345 14370 +25
===========================================
+ Hits 5914 5963 +49
+ Misses 7858 7834 -24
Partials 573 573 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
e712ba7 to
d1b1704
Compare
9c1e9b3 to
cf7dd29
Compare
cf7dd29 to
fc4b1a3
Compare
There was a problem hiding this comment.
How is the KVM service status provided across ISM and AMT devices ?
I tested using following API's on AMT and ISM systems:
# Set environment variables
export CONSOLE_HOST=""
export CONSOLE_USER="admin"
export CONSOLE_PASS=""
export SYSTEM_ID=""
# Enable KVM
curl -sk -X PATCH \
"${CONSOLE_HOST}/redfish/v1/Systems/${SYSTEM_ID}" \
-u "${CONSOLE_USER}:${CONSOLE_PASS}" \
-H 'Content-Type: application/json' \
-d '{"GraphicalConsole": {"ServiceEnabled": true}}'
# Disable KVM
curl -sk -X PATCH \
"${CONSOLE_HOST}/redfish/v1/Systems/${SYSTEM_ID}" \
-u "${CONSOLE_USER}:${CONSOLE_PASS}" \
-H 'Content-Type: application/json' \
-d '{"GraphicalConsole": {"ServiceEnabled": false}}'
# Verify current state
curl -sk \
"${CONSOLE_HOST}/redfish/v1/Systems/${SYSTEM_ID}" \
-u "${CONSOLE_USER}:${CONSOLE_PASS}" | jq .GraphicalConsole
Here's my observations:
- On AMT Systems
- Initially ServiceEnabled is set to True and KVMStatus is set to Enabled.
- PATCH request of ServiceEnabled to true updates KVMStatus to Enabled and ServiceEnabled to true
- PATCH request of ServiceEnabled to false updates KVMStatus to Disabled and ServiceEnabled to false
- On ISM Systems
- Initially ServiceEnabled is set to False and KVMStatus is set to Disabled.
- PATCH request for ServiceEnabled succeeds - Should it not fail ?
- Post PATCH request when queried, ServiceEnabled is set to false and KVMStatus as Disabled.
We use usecase.SetFeatures to enable/disable KVM. In ISM case, In REST apis, current behavior is that a KVM enable request does not return an explicit unsupported error. If the backend returns DestinationUnreachable, we currently handle it internally and return a normal success response, with KVM state reflected as disabled in the response fields. |
fc4b1a3 to
71b3ea8
Compare
I have tested above behavior with ISM device using REST apis, the mentioned statement is true. I dont see any error logs or failure on console and the enable KVM api return success but in response KVM status will be false.
@sudhir-intc, My preference is Option 1, Suggest here. |
@amarnath-ac : Could you please create an issue for the Option-2 on DMT so that it can be fixed in the main DMT code. Please past the issue here. Once the issue is capture we could proceed with the merge of this PR |
Github issue created: #988. |
sudhir-intc
left a comment
There was a problem hiding this comment.
LGTM - Proceed with the merge after resolving the conflicts
Map ServiceEnabled updates to KVM enable/disable operations with corresponding controller and repository changes Signed-off-by: C, Amarnath <amarnath.c@intel.com>
71b3ea8 to
b601c1c
Compare
Map ServiceEnabled updates to KVM enable/disable operations with corresponding controller and repository changes