Skip to main content
Glama
phantosmax

CloudStack MCP Server

by phantosmax

deploy_virtual_machine

Create and configure a virtual machine using specified service offering, template, and zone IDs on the CloudStack MCP Server. Optionally, assign a name, networks, security groups, SSH key pairs, and user data.

Instructions

Deploy a new virtual machine

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
displaynameNoVM display name
keypairNoSSH key pair name
nameNoVM name
networkidsNoNetwork IDs (comma-separated)
securitygroupidsNoSecurity group IDs (comma-separated)
serviceofferingidYesService offering ID
templateidYesTemplate ID
userdataNoUser data (base64 encoded)
zoneidYesZone ID

Implementation Reference

  • The handler function that implements the core logic for the 'deploy_virtual_machine' tool. It calls the CloudStack client to deploy the VM and returns a formatted text response with job ID and VM ID.
    async handleDeployVirtualMachine(args: any) {
      const result = await this.cloudStackClient.deployVirtualMachine(args);
      
      return {
        content: [
          {
            type: 'text',
            text: `Deployed virtual machine. Job ID: ${result.deployvirtualmachineresponse?.jobid}\nVM ID: ${result.deployvirtualmachineresponse?.id}`
          }
        ]
      };
    }
  • The tool definition including name, description, and input schema (parameters with types, descriptions, and required fields) for 'deploy_virtual_machine'.
    {
      name: 'deploy_virtual_machine',
      description: 'Deploy a new virtual machine',
      inputSchema: {
        type: 'object',
        properties: {
          serviceofferingid: {
            type: 'string',
            description: 'Service offering ID',
          },
          templateid: {
            type: 'string',
            description: 'Template ID',
          },
          zoneid: {
            type: 'string',
            description: 'Zone ID',
          },
          name: {
            type: 'string',
            description: 'VM name',
          },
          displayname: {
            type: 'string',
            description: 'VM display name',
          },
          networkids: {
            type: 'string',
            description: 'Network IDs (comma-separated)',
          },
          securitygroupids: {
            type: 'string',
            description: 'Security group IDs (comma-separated)',
          },
          keypair: {
            type: 'string',
            description: 'SSH key pair name',
          },
          userdata: {
            type: 'string',
            description: 'User data (base64 encoded)',
          },
        },
        required: ['serviceofferingid', 'templateid', 'zoneid'],
        additionalProperties: false,
      },
    },
  • src/server.ts:120-121 (registration)
    The switch case in the MCP server request handler that registers and routes calls to the 'deploy_virtual_machine' tool to its handler.
    case 'deploy_virtual_machine':
      return await this.vmHandlers.handleDeployVirtualMachine(args);
  • Helper method in the CloudStackClient class that wraps the API request for the 'deployVirtualMachine' CloudStack API command.
    async deployVirtualMachine(params: CloudStackParams): Promise<CloudStackResponse> {
      return this.request('deployVirtualMachine', params);
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/phantosmax/cloudstack-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server