{% if not fragment %} VM Instances {% endif %} {% macro vm_actions(vm) %} {% if vm.useremail and vm.status == 'running' and vm.sessionid %} Peek (view-only) {% elif vm.status == 'running' and not vm.useremail and not vm.adminreservedat %}
{% elif vm.adminreservedat %} Admin session active
{% else %} {% endif %} {# Deliberately outside the chain above, not another elif: an Unhealthy VM should still offer Connect, since a *successful* Admin Connect is the automatic way the flag gets cleared. This is the manual escape hatch for when the box is known good but connecting isn't wanted — assign_vm skips Unhealthy rows and the client can't clear the flag itself (check_gpu only reports on change), so without this raw SQL was the only way out (lablink#404). #} {% if vm.healthy == 'Unhealthy' %}
{% endif %} {% endmacro %} {% macro vm_list_content(instances) %}
{% for vm in instances %} {% endfor %}
No. Hostname User Email In Use VM Status GPU Health Status Total Startup Duration Logs Access
{{ loop.index }} {{ vm.hostname }} {{ vm.useremail or "—" }} {{ "Yes" if vm.inuse else "No" }} {{ vm.status or "Unknown" }} {{ vm.healthy or "—" }} {{ "%.1f"|format(vm.totalstartupdurationseconds or 0) }}s View Logs
{{ vm_actions(vm) }}
{{ instances | selectattr('status', 'equalto', 'running') | list | length }}
Running
{{ instances | rejectattr('status', 'in', ['running', 'error']) | list | length }}
Initializing
{{ instances | selectattr('status', 'equalto', 'error') | list | length }}
Errors
{{ instances | length }}
Total VMs
{% for vm in instances %}
{{ vm.hostname }} {{ (vm.status or "unknown") | upper }}
User: {{ vm.useremail or "—" }}
GPU Health: {{ vm.healthy or "—" }}
Container Startup: {{ "%.1f"|format(vm.containerstartupdurationseconds or 0) }}s
Total Startup: {{ "%.1f"|format(vm.totalstartupdurationseconds or 0) }}s
View Logs {{ vm_actions(vm) }}
{% endfor %}
{% endmacro %} {% if fragment %}{{ vm_list_content(instances) }}{% else %} ← Back to Admin Dashboard

Existing VM Instances

{% if request.args.get('vnc_error') %} {% set vnc_error = request.args.get('vnc_error') %}
{% if vnc_error == 'peek_unavailable' %} This VM no longer has an active session to view. {% elif vnc_error == 'connect_raced' %} This VM was just claimed by someone else. Please refresh and try again. {% elif vnc_error == 'rotation_failed' %} Could not establish a VNC session — the VM's agent may be unreachable. It has been marked unhealthy. {% elif vnc_error == 'connect_failed' %} Something went wrong while connecting to this VM. The reservation has been released — please try again. {% else %} An error occurred. {% endif %}
{% endif %} {% if request.args.get('error') %} {% set op_error = request.args.get('error') %}
{% if op_error == 'launch_unsupported' %} Provider does not support host provisioning. {% elif op_error == 'destroy_unsupported' %} Provider does not support host destruction. {% elif op_error == 'num_vms_required' %} Number of VMs is required. {% elif op_error == 'num_vms_invalid' %} Invalid number of VMs. Please enter a valid positive integer. {% elif op_error == 'allocator_outputs_missing' %} Allocator outputs not found. {% elif op_error == 'already_in_progress' %} An operation is already in progress (job #{{ request.args.get('job_id', '?') }}). {% else %} An error occurred. {% endif %}
{% endif %}
{{ vm_list_content(instances) }}
Recent Operations (0)
{% endif %} {% if not fragment %} {% endif %} {% if not fragment %} {% endif %}