@@ -17,22 +17,25 @@ The `MicroVMConfig` class is a dataclass that defines default configuration valu
1717| ` data_path ` | str | "/var/lib/firecracker" | Base directory for storing Firecracker data |
1818| ` binary_path ` | str | "/usr/local/bin/firecracker" | Path to the Firecracker binary |
1919| ` kernel_file ` | str | "{data_path}/vmlinux-5.10.225" | Path to the Linux kernel file |
20+ | ` initrd_file ` | str | None | Path to the initrd file (optional) |
21+ | ` init_file ` | str | "/sbin/init" | Path to the init file |
2022| ` base_rootfs ` | str | "{data_path}/rootfs.img" | Path to the base root filesystem image |
23+ | ` overlayfs ` | bool | False | Whether to use overlay filesystem |
24+ | ` overlayfs_file ` | str | None | Path to the overlay filesystem file |
2125| ` ip_addr ` | str | "172.16.0.2" | Default IP address for microVMs |
2226| ` bridge ` | bool | False | Whether to use bridge networking by default |
2327| ` bridge_name ` | str | "docker0" | Default bridge interface name |
2428| ` mmds_enabled ` | bool | False | Whether MMDS (Microvm Metadata Service) is enabled by default |
2529| ` mmds_ip ` | str | "169.254.169.254" | Default IP address for MMDS |
26- | ` vcpu_count ` | int | 1 | Default number of virtual CPUs |
27- | ` mem_size_mib ` | int | 512 | Default memory size in MiB |
30+ | ` vcpu ` | int | 1 | Default number of virtual CPUs |
31+ | ` memory ` | str | 512 | Default memory size in MiB (can be specified as a number or with units like '1G') |
2832| ` hostname ` | str | "fc-vm" | Default hostname for microVMs |
2933| ` verbose ` | bool | False | Whether verbose logging is enabled by default |
3034| ` level ` | str | "INFO" | Default logging level |
3135| ` ssh_user ` | str | "root" | Default SSH user for connecting to microVMs |
3236| ` expose_ports ` | bool | False | Whether to expose ports by default |
3337| ` host_port ` | int | None | Default host port for port forwarding |
3438| ` dest_port ` | int | None | Default destination port for port forwarding |
35- | ` nat_enabled ` | bool | False | Whether to enable NAT by default |
3639| ` user_data ` | str | None | Cloud-init user data |
3740
3841## Using Custom Configuration
@@ -45,7 +48,7 @@ from firecracker import MicroVM
4548# Create a microVM with custom configuration
4649vm = MicroVM(
4750 vcpu = 2 ,
48- mem_size_mib = 1024 ,
51+ memory = 1024 ,
4952 ip_addr = " 192.168.100.2" ,
5053 bridge = True ,
5154 bridge_name = " br0"
@@ -63,7 +66,7 @@ from firecracker import MicroVM
6366
6467vm = MicroVM(
6568 vcpu = 1 ,
66- mem_size_mib = 256
69+ memory = 256
6770)
6871
6972vm.create()
@@ -76,7 +79,7 @@ from firecracker import MicroVM
7679
7780vm = MicroVM(
7881 vcpu = 4 ,
79- mem_size_mib = 4096
82+ memory = 4096
8083)
8184
8285vm.create()
@@ -168,15 +171,5 @@ For optimal performance, ensure your host system meets these requirements:
168171
169172- Linux kernel 4.14 or later
170173- KVM enabled
171- - At least 2GB of RAM
174+ - At least 4GB of RAM
172175- At least 2 CPU cores
173-
174- ## Best Practices
175-
176- 1 . ** Resource Allocation** : Allocate only the resources your application needs. Firecracker is designed for lightweight workloads.
177-
178- 2 . ** Data Persistence** : The rootfs is not persistent by default. For data persistence, consider mounting volumes or using network storage.
179-
180- 3 . ** Security** : Use minimal permissions and restrict network access to enhance security.
181-
182- 4 . ** Monitoring** : Implement monitoring to track resource usage and performance of your microVMs.
0 commit comments