Skip to content

Conversation

@nwilkens
Copy link
Member

@nwilkens nwilkens commented Oct 8, 2025

Add GET /servers/:server_uuid/vms/:uuid/console endpoint to query console connection details from vm-agent.

Returns:

  • host: IP address of compute node admin interface
  • port: TCP port for console proxy
  • type: 'socket' (KVM) or 'zcons' (Bhyve/Joyent/LX)

This endpoint queries vmadmd for console proxy details and returns them for CloudAPI to establish WebSocket connections.

🤖 Generated with Claude Code

Add GET /servers/:server_uuid/vms/:uuid/console endpoint to query console
connection details from vm-agent.

Returns:
- host: IP address of compute node admin interface
- port: TCP port for console proxy
- type: 'socket' (KVM) or 'zcons' (Bhyve/Joyent/LX)

This endpoint queries vmadmd for console proxy details and returns them
for CloudAPI to establish WebSocket connections.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@nwilkens nwilkens requested a review from Copilot October 8, 2025 17:40
Copy link

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 a new console endpoint to CNAPI that allows querying console connection details for virtual machines. The endpoint provides the necessary information (host, port, type) for CloudAPI to establish WebSocket connections to VM consoles.

  • Adds GET /servers/:server_uuid/vms/:uuid/console endpoint
  • Implements console information validation and error handling
  • Provides console connection details (host, port, type) for different VM brands

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

var timeout = setTimeout(function () {
responded = true;
next(new restify.InternalError(
'Time-out reached waiting for machine_load request to return'));
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

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

The error message references 'machine_load request' but this endpoint is for console information, not machine loading. The message should be updated to reflect the actual operation.

Suggested change
'Time-out reached waiting for machine_load request to return'));
'Time-out reached waiting for VM console information to return'));

Copilot uses AI. Check for mistakes.
}

// Ensure console info exists
if (!vminfo.console || !vminfo.console.host || !vminfo.console.port) {
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

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

The validation should also check for vminfo.console.type since it's used later and returned in the response. Missing type could cause undefined to be returned.

Suggested change
if (!vminfo.console || !vminfo.console.host || !vminfo.console.port) {
if (!vminfo.console || !vminfo.console.host || !vminfo.console.port || !vminfo.console.type) {

Copilot uses AI. Check for mistakes.
@danmcd danmcd requested a review from a team October 8, 2025 18:08
nwilkens added a commit that referenced this pull request Jan 12, 2026
- Update timeout error message to reference "VM console information"
  instead of "machine_load request" for clarity
- Add validation for console.type field since it is returned to callers
  and should be required alongside host and port

Addresses PR review feedback from #44

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

1 participant