reboot_virtual_machine
Restart a virtual machine on the CloudStack MCP Server by specifying its VM ID, ensuring operational stability and resource efficiency in cloud infrastructure management.
Instructions
Reboot a virtual machine
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | VM ID to reboot |
Implementation Reference
- The main handler function that calls the CloudStack client to reboot the VM and returns a formatted response with the job ID.async handleRebootVirtualMachine(args: any) { const result = await this.cloudStackClient.rebootVirtualMachine({ id: args.id }); return { content: [ { type: 'text', text: `Rebooted virtual machine ${args.id}. Job ID: ${result.rebootvirtualmachineresponse?.jobid}` } ] }; }
- The tool definition including name, description, and input schema requiring a VM ID.{ name: 'reboot_virtual_machine', description: 'Reboot a virtual machine', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'VM ID to reboot', }, }, required: ['id'], additionalProperties: false, }, }, {
- src/server.ts:116-117 (registration)The switch case in the MCP server that registers and routes calls to the reboot handler.case 'reboot_virtual_machine': return await this.vmHandlers.handleRebootVirtualMachine(args);
- src/cloudstack-client.ts:108-110 (helper)The CloudStack client method that sends the actual API request to reboot the virtual machine.async rebootVirtualMachine(params: CloudStackParams): Promise<CloudStackResponse> { return this.request('rebootVirtualMachine', params); }