lablink_allocator_service.routes.admin_sessions¶
lablink_allocator_service.routes.admin_sessions
¶
Admin VNC troubleshooting sessions.
Three distinct affordances, deliberately separate:
- peek — read-only second viewer onto a participant's live session. Never touches useremail and never rotates credentials.
- connect — full control over a VM nobody is assigned to. Reserves the VM out of the assignable pool (AdminReservedAt) and mints a real session, but never sets useremail.
- release — ends a connect session and returns the VM to the pool.
Attributes¶
bp = Blueprint('admin_sessions', __name__)
module-attribute
¶
logger = logging.getLogger(__name__)
module-attribute
¶
Classes¶
Functions:¶
admin_clear_unhealthy(hostname)
¶
Clear an allocator-set Unhealthy flag by hand.
A rotation timeout marks a client Unhealthy and assign_vm skips those rows, so the pool can read as empty while the client is perfectly fine. The client cannot clear it itself: check_gpu only reports on change, and on a GPU-less box it posts 'N/A' once and then exits its loop entirely. A successful Admin Connect clears it automatically (see admin_connect_vm); this is the escape hatch for when the box is known good but connecting to it isn't wanted. Before either existed, raw SQL was the only way out (lablink#404).
Source code in packages/allocator/src/lablink_allocator_service/routes/admin_sessions.py
admin_connect_vm(hostname)
¶
Connect (full control) to a VM not currently assigned to anyone, for admin troubleshooting. Reserves the VM out of the assignable pool (AdminReservedAt) and mints a real session via the same prepare_browser_session path /api/request_vm uses — but never sets useremail.
Source code in packages/allocator/src/lablink_allocator_service/routes/admin_sessions.py
admin_peek_vm(hostname)
¶
View (read-only) a VM already assigned to a participant, without touching useremail or rotating credentials — opens a second WS viewer onto the same live KasmVNC session.
Source code in packages/allocator/src/lablink_allocator_service/routes/admin_sessions.py
admin_release_vm(hostname)
¶
End an admin troubleshooting session, returning the VM to the assignable pool. Posted to by both the dashboard row's Release button and the /desktop wrapper page's Release form.