Firecracker Drives API

The Drives API from Firecracker — 1 operation(s) for drives.

GitHub OpenAPI
Business capability
IT Infrastructure Management BC-600.50

Operations 3

PUT /drives/{drive_id} Creates or updates a drive. Pre-boot only #
PATCH /drives/{drive_id} Updates the properties of a drive. Post-boot only #
DELETE /drives/{drive_id} Hot-unplugs a drive. Post-boot only #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/firecracker:firecracker-drives-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

firecracker-drives-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Firecracker Drives API
  description: RESTful public-facing API. The API is accessible through HTTP calls on specific URLs carrying JSON modeled data. The transport medium is a Unix Domain Socket.
  version: 1.19.0-dev
  termsOfService: ''
  contact:
    email: firecracker-maintainers@amazon.com
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
servers:
- url: http://localhost/
tags:
- name: Drives
paths:
  /drives/{drive_id}:
    put:
      summary: Creates or updates a drive. Pre-boot only
      description: Creates new drive with ID specified by drive_id path parameter. If a drive with the specified ID already exists, updates its state based on new input. Will fail if update is not possible.
      operationId: putGuestDriveByID
      parameters:
      - name: drive_id
        in: path
        description: The id of the guest drive
        required: true
        schema:
          type: string
      responses:
        204:
          description: Drive created/updated
        400:
          description: Drive cannot be created/updated due to bad input
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Drive'
        description: Guest drive properties
        required: true
      tags:
      - Drives
    patch:
      summary: Updates the properties of a drive. Post-boot only
      description: Updates the properties of the drive with the ID specified by drive_id path parameter. Will fail if update is not possible.
      operationId: patchGuestDriveByID
      parameters:
      - name: drive_id
        in: path
        description: The id of the guest drive
        required: true
        schema:
          type: string
      responses:
        204:
          description: Drive updated
        400:
          description: Drive cannot be updated due to bad input
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PartialDrive'
        description: Guest drive properties
        required: true
      tags:
      - Drives
    delete:
      summary: Hot-unplugs a drive. Post-boot only
      description: Removes the drive with the ID specified by the drive_id path parameter. The device must have been placed behind a PCIe root port. When the optional force flag is not set, the detach is graceful; the guest is notified and Firecracker waits for a guest acknowledgement before actually removing the device. When force is set, then the device is removed immediately. In either case the DELETE request is non-blocking.
      operationId: deleteGuestDriveByID
      parameters:
      - name: drive_id
        in: path
        description: The id of the guest drive
        required: true
        schema:
          type: string
      responses:
        204:
          description: Device removal started
        400:
          description: Device cannot be removed due to bad input
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UnplugParams'
        description: Hot-unplug properties
      tags:
      - Drives
components:
  schemas:
    UnplugParams:
      type: object
      description: Optional body of a device hot-unplug request.
      properties:
        force:
          type: boolean
          default: false
          description: If true, remove the device immediately. This can be used in case a buggy or misbehaving guest doesn't acknowledge a device removal but it might result in a guest crash.
    TokenBucket:
      type: object
      description: Defines a token bucket with a maximum capacity (size), an initial burst size (one_time_burst) and an interval for refilling purposes (refill_time). The refill-rate is derived from size and refill_time, and it is the constant rate at which the tokens replenish. The refill process only starts happening after the initial burst budget is consumed. Consumption from the token bucket is unbounded in speed which allows for bursts bound in size by the amount of tokens available. Once the token bucket is empty, consumption speed is bound by the refill_rate.
      required:
      - refill_time
      - size
      properties:
        one_time_burst:
          type: integer
          format: int64
          description: The initial size of a token bucket.
          minimum: 0
        refill_time:
          type: integer
          format: int64
          description: The amount of milliseconds it takes for the bucket to refill.
          minimum: 0
        size:
          type: integer
          format: int64
          description: The total number of tokens this bucket can hold.
          minimum: 0
    RateLimiter:
      type: object
      description: Defines an IO rate limiter with independent bytes/s and ops/s limits. Limits are defined by configuring each of the _bandwidth_ and _ops_ token buckets. This field is optional for virtio-block config and should be omitted for vhost-user-block configuration.
      properties:
        bandwidth:
          $ref: '#/components/schemas/TokenBucket'
          description: Token bucket with bytes as tokens
        ops:
          $ref: '#/components/schemas/TokenBucket'
          description: Token bucket with operations as tokens
    Error:
      type: object
      properties:
        fault_message:
          type: string
          description: A description of the error condition
          readOnly: true
    DmbSizeMib:
      type: integer
      minimum: 2
      maximum: 256
      multipleOf: 2
      description: Device Memory Buffer size in MiB for confidential enclaves; defaults to 16 at attachment. Explicit sizes are rejected by vhost-user block and by KVM or direct-mode transports at attachment (InstanceStart or hotplug PUT). GET /vm/config reports supplied values before start and resolved sizes after attachment, including the default. KVM and direct mode omit it.
    PartialDrive:
      type: object
      required:
      - drive_id
      properties:
        drive_id:
          type: string
        path_on_host:
          type: string
          description: Host level path for the guest drive. This field is optional for virtio-block config and should be omitted for vhost-user-block configuration.
        rate_limiter:
          $ref: '#/components/schemas/RateLimiter'
    BlockTopology:
      type: object
      description: Block device topology exposed to the guest via VIRTIO_BLK_F_TOPOLOGY. When value is present, it is used instead of Firecracker defaults. All I/O size fields are expressed in units of logical blocks. This field is optional for virtio-block config and should be omitted for vhost-user-block configuration.
      properties:
        physical_block_exp:
          type: integer
          description: log2 of the number of logical blocks per physical block.
        alignment_offset:
          type: integer
          description: Offset of the first aligned logical block.
        min_io_size:
          type: integer
          description: Suggested minimum I/O size, in units of logical blocks.
        opt_io_size:
          type: integer
          description: Suggested optimal (maximum) I/O size, in units of logical blocks.
    Drive:
      type: object
      required:
      - drive_id
      - is_root_device
      properties:
        drive_id:
          type: string
        partuuid:
          type: string
          description: Represents the unique id of the boot partition of this device. It is optional and it will be taken into account only if the is_root_device field is true.
        is_root_device:
          type: boolean
        cache_type:
          type: string
          description: Represents the caching strategy for the block device.
          enum:
          - Unsafe
          - Writeback
          default: Unsafe
        is_read_only:
          type: boolean
          description: Is block read only. This field is required for virtio-block config and should be omitted for vhost-user-block configuration.
        discard:
          type: boolean
          description: Enables virtio-blk discard support. When enabled, the guest can issue discard/TRIM requests for this drive. Only supported for writable virtio-block devices using the Sync IO engine. This field is optional for virtio-block config and should be omitted for vhost-user-block configuration.
          default: false
        num_queues:
          type: integer
          format: int32
          minimum: 1
          description: Number of virtio queues exposed by the block device, each processed on a dedicated worker thread. Cannot exceed the configured vCPU count. If omitted, the device exposes a single queue processed on the VMM thread. Setting it to 1 still processes the queue on a dedicated worker thread. This field is supported only for virtio-block configuration.
        path_on_host:
          type: string
          description: Host level path for the guest drive. This field is required for virtio-block config and should be omitted for vhost-user-block configuration.
        rate_limiter:
          $ref: '#/components/schemas/RateLimiter'
        io_engine:
          type: string
          description: Type of the IO engine used by the device. "Async" is supported on host kernels newer than 5.10.51. This field is optional for virtio-block config and should be omitted for vhost-user-block configuration.
          enum:
          - Sync
          - Async
          default: Sync
        image_format:
          type: string
          description: Format of the file at path_on_host. "Vmdk" images must be opened read-only and use the Sync IO engine. This field is optional for virtio-block config and should be omitted for vhost-user-block configuration.
          enum:
          - Raw
          - Vmdk
          default: Raw
        blk_size:
          type: integer
          description: Logical block size advertised to the guest via VIRTIO_BLK_F_BLK_SIZE. This field is optional for virtio-block config and should be omitted for vhost-user-block configuration.
          default: 512
        topology:
          $ref: '#/components/schemas/BlockTopology'
        socket:
          type: string
          description: Path to the socket of vhost-user-block backend. This field is required for vhost-user-block config should be omitted for virtio-block configuration.
        dmb_size_mib:
          $ref: '#/components/schemas/DmbSizeMib'