Initializes the configuration for Firecracker instance. It does not start the microVM (or firecracker process) yet.
To actually start the microVM, call spawnFirecrackerProcess().
OptionalinitParams: FirecrackerInitParamsthe initialization parameters for the Firecracker process
Protected OptionalfirecrackerThe spawned Firecracker process.
ProtectedinitInitialization parameters for the Firecracker process. Defaults are taken from DefaultFirecrackerInitParams.
ProtectedundiciThe Undici HTTP client configured to connect over the provided Unix socket.
ProtectedbuildBuilds the command line arguments array for the Firecracker binary based on initParams. This follows the same logic as the Rust ArgParser in the Firecracker source.
Creates new drive with ID specified by drive_id or updates existing drive. This works pre-boot only. Will fail if update is not possible.
Guest drive properties
Gets the machine configuration of the VM. When called before the PUT operation, it will return the default values for the vCPU count (=1), memory size (=128 MiB). By default SMT is disabled and there is no CPU Template.
the machine configuration
Protectedjsonrequest() internallyProtectednorequest() internallyPartially updates the Machine Configuration of the VM. Pre-boot only.
A subset of Machine Configuration Parameters
ProtectedrequestMakes a request to the API.
the options for the request. Everything will work except the 'Content-Type' header, which is always set to 'application/json'.
array of valid status codes for the response
the response from the API
Creates new boot source if one does not already exist, otherwise updates it. This is works pre-boot only. Will fail if update is not possible.
the bootsource
Updates the Machine Configuration of the VM. Pre-boot only.
mem_size_mib must be a multiple of 2.Machine Configuration Parameters
Spawns a firecracker process
whether to remove an existing socket file before starting the process. This is useful to ensure that a stale socket does not prevent the Firecracker process from starting.
Starts an action on the instance
The action to start
resolves when the action is successfully started
Kills the Firecracker process and waits for it to exit.
Updates the properties of a drive with the specified ID. This works post-boot only. Will fail if update is not possible.
Guest drive properties to update
Represents a firecracker microVM instance.
Note
This makes API calls for each configuration change. Use FirecrackerLauncher for easier microVM setup.