firecracker-node
    Preparing search index...

    Class FirecrackerMicroVMLauncher

    A builder class for setting up and launching a Firecracker microVM instance.

    This class allows you to configure the boot source, drives, and machine configuration before launching the microVM.

    If you want to manually control the Firecracker process and API calls, consider using FirecrackerMicroVM directly.

    const launcher = new FirecrackerMicroVMLauncher({
    apiSock: "/tmp/firecracker.socket",
    });

    launcher
    .setBootSource({
    kernel_image_path: "/path/to/kernel",
    boot_args: "console=ttyS0 reboot=k panic=1 pci=off",
    })
    .addDrive({
    drive_id: "rootfs",
    path_on_host: "/path/to/rootfs.ext4",
    is_root_device: true,
    is_read_only: false,
    })
    .setMachineConfiguration({
    vcpu_count: 2,
    mem_size_mib: 512,
    });

    // Launch the microVM
    // This will start the firecrafcker process, configure the VM, and start it
    const instance = await launcher.launch();
    Index

    Constructors

    Methods

    • Launch the Firecracker microVM. This methods does the following:

      1. Spawns the Firecracker process.
      2. Configures the boot source.
      3. Adds the drives.
      4. Sets the machine configuration (if provided).
      5. Starts the microVM.

      Returns Promise<FirecrackerMicroVM>

      The instance of the launched Firecracker microVM.

      Calling this method multiple times will spawn multiple Firecracker processes.

      Maybe return some wrapper around FirecrackerMicroVM that only exposes post-boot methods?