Skip to content

Commit 955a3f9

Browse files
Muhammad Yuga NugrahaMuhammad Yuga Nugraha
authored andcommitted
docs: update documentation
1 parent cb2ad0b commit 955a3f9

2 files changed

Lines changed: 14 additions & 21 deletions

File tree

docs/configuration.md

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -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
4649
vm = 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

6467
vm = MicroVM(
6568
vcpu=1,
66-
mem_size_mib=256
69+
memory=256
6770
)
6871

6972
vm.create()
@@ -76,7 +79,7 @@ from firecracker import MicroVM
7679

7780
vm = MicroVM(
7881
vcpu=4,
79-
mem_size_mib=4096
82+
memory=4096
8083
)
8184

8285
vm.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.

docs/examples.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ from firecracker import MicroVM
2525
# Create a microVM with custom resources
2626
vm = MicroVM(
2727
vcpu=2,
28-
mem_size_mib=1024,
28+
memory=1024,
2929
ip_addr="192.168.100.2"
3030
)
3131
vm.create()
@@ -197,7 +197,7 @@ from firecracker import MicroVM
197197
# Create a microVM with appropriate resources
198198
vm = MicroVM(
199199
vcpu=2,
200-
mem_size_mib=1024,
200+
memory=1024,
201201
ip_addr="192.168.100.2"
202202
)
203203
vm.create()
@@ -225,7 +225,7 @@ from firecracker import MicroVM
225225
vm = MicroVM(
226226
name="database",
227227
vcpu=4,
228-
mem_size_mib=4096,
228+
memory=4096,
229229
ip_addr="192.168.100.3"
230230
)
231231
vm.create()
@@ -250,7 +250,7 @@ from firecracker import MicroVM
250250
vm = MicroVM(
251251
name="dev-env",
252252
vcpu=2,
253-
mem_size_mib=2048,
253+
memory=2048,
254254
ip_addr="192.168.100.4"
255255
)
256256
vm.create()

0 commit comments

Comments
 (0)