Skip to main content
Glama
phantosmax

CloudStack MCP Server

by phantosmax

create_snapshot

Generate a snapshot of a specified volume in Apache CloudStack using the CloudStack MCP Server, ensuring data preservation and recovery readiness by providing the volume ID and optional snapshot name.

Instructions

Create a snapshot of a volume

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoSnapshot name
volumeidYesVolume ID to snapshot

Implementation Reference

  • The handler function that executes the create_snapshot tool logic. It calls the CloudStack client to create the snapshot and returns a formatted text response with job ID and snapshot ID.
    async handleCreateSnapshot(args: any) {
      const result = await this.cloudStackClient.createSnapshot(args);
      
      return {
        content: [
          {
            type: 'text',
            text: `Created snapshot of volume ${args.volumeid}. Job ID: ${result.createsnapshotresponse?.jobid}\nSnapshot ID: ${result.createsnapshotresponse?.id}`
          }
        ]
      };
    }
  • Input schema definition for the create_snapshot tool, specifying required volumeid and optional name.
    {
      name: 'create_snapshot',
      description: 'Create a snapshot of a volume',
      inputSchema: {
        type: 'object',
        properties: {
          volumeid: {
            type: 'string',
            description: 'Volume ID to snapshot',
          },
          name: {
            type: 'string',
            description: 'Snapshot name',
          },
        },
        required: ['volumeid'],
        additionalProperties: false,
      },
    },
  • src/server.ts:144-145 (registration)
    Tool registration/dispatch in the MCP server: maps 'create_snapshot' calls to the storage handler.
    case 'create_snapshot':
      return await this.storageHandlers.handleCreateSnapshot(args);
  • Helper method in CloudStack client that makes the underlying API request for createSnapshot.
    async createSnapshot(params: CloudStackParams): Promise<CloudStackResponse> {
      return this.request('createSnapshot', 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