Skip to content

feat: detect LMS availability and report to console#1290

Draft
sinchubhat wants to merge 1 commit into
mainfrom
issue1246-rpc-go
Draft

feat: detect LMS availability and report to console#1290
sinchubhat wants to merge 1 commit into
mainfrom
issue1246-rpc-go

Conversation

@sinchubhat
Copy link
Copy Markdown
Contributor

@sinchubhat sinchubhat commented Apr 24, 2026

  • Add shared utils.DetectLMS() TCP probe for Intel LMS on localhost:16992 (or :16993 for local TLS enforced).
  • Usage: Local activation (addDeviceToConsole payload), Remote activation (RPS message payload) and amtinfo --sync (deviceInfo.lmsInstalled)

Resolves #1246

Testing:

Activate the edge node

  • sends IsLMSAvailable, console stores lmsInstalled in deviceInfo; other fields remain zero-value since no sync has happened yet.
sudo ./rpc activate --local --profile <Profile.yaml> \
  --key "profile-key" \
  --skip-amt-cert-check -v \
  --auth-endpoint "http://<host-ip-addr>:8181/api/v1/authorize" \
  --auth-username <username> --auth-password "<password>"

Query from host

  • lmsInstalled value is stored without any sync data (other fields are just zero-value defaults from the struct).
TOKEN=$(curl -s http://localhost:8181/api/v1/authorize -H "Content-Type: application/json" \
  -d '{"username":"<username>","password":"<password>"}' | jq -r '.token') \
  && curl -s http://localhost:8181/api/v1/devices -H "Authorization: Bearer $TOKEN" \
  | jq '[.[] | {hostname, guid, deviceInfo}]'

Output

[
  {
    "hostname": "edge-node-ip-addr",
    "guid": "edge-node-guid",
    "deviceInfo": {
      "fwVersion": "",
      "fwBuild": "",
      "fwSku": "",
      "currentMode": "",
      "features": "",
      "ipAddress": "",
      "lastUpdated": "0001-01-01T00:00:00Z",
      "lmsInstalled": true
    }
  }
]

Sync Command

  • After sync, all firmware fields are populated alongside lmsInstalled value
sudo ./rpc amtinfo --sync --url http://<host-ip-addr>:8181/api/v1/devices \
  --auth-endpoint http://<host-ip-addr>:8181/api/v1/authorize \
  --auth-username <username> --auth-password "<password>"

Query from host

curl -s http://localhost:8181/api/v1/devices -H "Authorization: Bearer $TOKEN" | jq '[.[] | {hostname, guid, deviceInfo}]'

Output

[
  {
    "hostname": "edge-node-ip-addr",
    "guid": "edge-node-guid",
    "deviceInfo": {
      "fwVersion": "16.1.35",
      "fwBuild": "2557",
      "fwSku": "16392",
      "currentMode": "admin control mode",
      "features": "AMT Pro Corporate",
      "ipAddress": "edge-node-ip-addr",
      "lastUpdated": "2026-05-20T10:14:37.04994074+05:30",
      "lmsInstalled": true
    }
  }
]

Copy link
Copy Markdown
Member

@rsdmike rsdmike left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before going too far on this, I would suggest surfacing islmsavailable in the WSMANer interface: IsLMSAvailable() bool since SetupWsmanClient essentially already does this. and remove the lm/detect.go.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds Intel LMS (Local Manageability Service) reachability detection during activation and includes that signal in the device registration payload sent to Console, enabling Console to persist and expose LMS availability for each device.

Changes:

  • Track LMS reachability in the local WSMAN client (GoWSMANMessages) via a TCP probe during SetupWsmanClient.
  • Add isLMSAvailable to the device payload sent to Console during activation (with a fallback direct TCP probe when WSMAN isn’t initialized yet).
  • Extend the WSMAN interface + gomock to expose IsLMSAvailable(), and add unit tests for the new flag behavior.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
internal/mocks/wsman_mock.go Updates gomock WSMAN mock to include IsLMSAvailable() (and reorders Close()).
internal/local/amt/wsman_test.go Adds unit tests covering the new LMS availability flag behavior.
internal/local/amt/wsman.go Adds lmsAvailable state, sets it during LMS probe in SetupWsmanClient, and exposes IsLMSAvailable().
internal/interfaces/wsman.go Extends WSMANer interface with IsLMSAvailable().
internal/device/api.go Adds IsLMSAvailable to the JSON payload sent to Console (isLMSAvailable).
internal/commands/activate/activate.go Detects LMS availability during activation and includes it in the Console device payload (with fallback TCP probe).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/local/amt/wsman_test.go Outdated
@rsdmike rsdmike changed the base branch from next to main May 1, 2026 20:57
@sinchubhat sinchubhat changed the title feat: detect LMS availability during activation and report to console feat: detect LMS availability and report to console May 19, 2026
* Add shared utils.DetectLMS() TCP probe for Intel LMS on localhost:16992 (or :16993 for local TLS enforced).
* Usage: Local activation (addDeviceToConsole payload), Remote activation (RPS message payload) and amtinfo --sync (deviceInfo.lmsInstalled)

Resolves #1246
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.

Files not reviewed (1)
  • internal/mocks/wsman_mock.go: Language not supported

Comment thread internal/rps/message.go Outdated
Comment thread internal/local/amt/wsman.go
Comment thread internal/local/amt/wsman_test.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Detect LMS during orchestration and report it to Console

3 participants