power_on_vm
Start a powered-off virtual machine using its UUID to make it operational.
Instructions
Power on a virtual machine.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| vm_uuid | Yes | The UUID (extId) of the virtual machine |
Implementation Reference
- src/nutanix_mcp/tools/vm.py:172-182 (handler)The async handler function that executes the power_on_vm tool. It calls the Nutanix v4 API POST endpoint at 'ahv/config/vms/{vm_uuid}/$actions/power-on' with an empty body, and returns a status indicating the power-on task was initiated along with the task's extId.
async def handle_power_on_vm( client: NutanixClient, arguments: dict[str, Any] ) -> dict[str, Any]: """Power on a VM using v4 vmm API.""" vm_uuid = arguments["vm_uuid"] result = await client.v4_post( namespace="vmm", path=f"ahv/config/vms/{vm_uuid}/$actions/power-on", body={}, ) return {"status": "power_on_initiated", "taskExtId": result.get("data", {}).get("extId")} - src/nutanix_mcp/tools/vm.py:50-63 (schema)The tool definition / input schema for power_on_vm. It declares the tool name, description, and input schema requiring a 'vm_uuid' string parameter.
{ "name": "power_on_vm", "description": "Power on a virtual machine.", "inputSchema": { "type": "object", "properties": { "vm_uuid": { "type": "string", "description": "The UUID (extId) of the virtual machine", }, }, "required": ["vm_uuid"], }, }, - src/nutanix_mcp/tools/vm.py:240-246 (registration)The VM_HANDLERS dispatch table that maps the string 'power_on_vm' to the handle_power_on_vm function. This table is imported into server.py and merged into the ALL_HANDLERS dict.
VM_HANDLERS: dict[str, Any] = { "list_vms": handle_list_vms, "get_vm": handle_get_vm, "power_on_vm": handle_power_on_vm, "power_off_vm": handle_power_off_vm, "create_vm": handle_create_vm, } - src/nutanix_mcp/__main__.py:1-5 (registration)Entry point that imports and calls server.main(), indirectly registering all tools including power_on_vm.
"""Allow running as python -m nutanix_mcp.""" from nutanix_mcp.server import main main() - src/nutanix_mcp/server.py:34-41 (registration)The ALL_HANDLERS dict in server.py merges VM_HANDLERS (which contains power_on_vm) and is used by the call_tool handler to dispatch tool requests.
# Merge all handler dispatch tables ALL_HANDLERS: dict[str, Any] = { **VM_HANDLERS, **CLUSTER_HANDLERS, **PE_HANDLERS, **REPORT_HANDLERS, **NETWORKING_HANDLERS, }