firecracker-node
    Preparing search index...

    Class FirecrackerMicroVM

    Represents a running Firecracker microVM instance.

    Use the static create() method to spawn and boot a microVM. This class only exposes post-boot methods.

    Index

    Methods

    • Stops the Firecracker microVM and cleans up resources. This kills the Firecracker process, removes the socket file and closes the API client connection.

      After calling this method, the instance is no longer usable. Any subsequent method calls will throw an error.

      Returns Promise<void>

    • Updates the properties of a drive. This can be used to change the backing file or rate limiter of a drive post-boot.

      Parameters

      Returns Promise<void>

      If the VM has been stopped

    • Creates and boots a new Firecracker microVM.

      This method:

      1. Creates a new FirecrackerMicroVM instance which internally
        • Spawns the Firecracker process
        • Creates the API client to communicate with the process
      2. Then, waits for the API to be ready
      3. Configures boot source, drives, and machine configuration
      4. Starts the microVM and returns a running instance

      Parameters

      • firecrackerInitParams: FirecrackerInitParams

        Firecracker process initialization parameters

      • microVMConfig: MicroVMConfig
      • cleanupExistingSocket: boolean = true

        Whether to clean up an existing socket file before starting the VM (default: true)

      Returns Promise<FirecrackerMicroVM>

      A running FirecrackerMicroVM instance

      If the configuration is invalid or if the API/VM fails to start