Before looking at the networking options, I have looked at adding extra drives to my Firecracker VMMs. Storing data on the root file system will not scale well long term. Additional disks will be a good solution to persist application specific data across reboots and upgrades.
§Create the disk on the host
First, create an additional file system on the host:
|
|
§Reconfigure the VMM
Change the VMM drives
configuration:
|
|
and relaunch the VMM.
§Verify the configuration
In another terminal:
|
|
Disk /dev/vda: 500 MiB, 524288000 bytes, 1024000 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/vdb: 500 MiB, 524288000 bytes, 1024000 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
I can mount it:
|
|
Firecracker shows me:
[ 1800.756913] EXT4-fs (vdb): mounted filesystem with ordered data mode. Opts: (null)
[ 1800.758116] ext4 filesystem being mounted at /mnt supports timestamps until 2038 (0x7fffffff)
I can also write to it:
|
|
total 14
drwxr-xr-x 3 root root 1024 Feb 14 15:07 .
drwxr-xr-x 16 root root 1024 Feb 14 15:49 ..
drwx------ 2 root root 12288 Feb 14 15:07 lost+found
|
|
total 15
drwxr-xr-x 3 root root 1024 Feb 14 15:50 .
drwxr-xr-x 16 root root 1024 Feb 14 15:49 ..
drwx------ 2 root root 12288 Feb 14 15:07 lost+found
-rw-r--r-- 1 root root 2 Feb 14 15:50 test
§Live resize does not work
Not sure at this stage if this is because of how the system is built or if it’s a limitation of the VMM but I am not able to live resize the disk. Executing on the host:
|
|
100+0 records in
100+0 records out
104857600 bytes (105 MB, 100 MiB) copied, 0.0798364 s, 1.3 GB/s
and in the VMM:
|
|
does not reflect the change. The change only becomes visible after VMM restart.