Resolve "DMS should manage firecracker VM - 2"
Closes #25 (closed)
This MR has 3 features:
- Create a single endpoint with default values
Out of all the vm routes we have, we have added one more as an abstraction of all of those called /start-default
. As a bare minimum, the user need to pass the kernel path and filesystem path. Rest of the config are set default.
- Create, manage, delete network interfaces on host
Two things we should adhere for sake of compatibility:
i) We create tap devices with name tap1, tap2, tap3...tapN. ii) The address range we use is 172.20.x.x. The third octet is the integer value from tap devices (e.g. 1, 2, 3...N).
The tap device is linked to the metadata for the VM and is stored in SQLite database on the /etc/nunet/nunet.db.
PS: There is no need to delete the tap interfaces as they are deleted on system restart.
- Automatically start VM from last session
When a VM is initialized, it is given a status of awaiting
. It is given a status of running
when InstanceStart
action is invoked. This data is saved in SQLite.
Even when host system is shut down, the metadata would still say running
. This is how DMS looks for VMs to start on startup. It runs all the VMs with the state of running.
When VM is shut down from the firecracker end, the state is set to stopped
.
- Persistent way to keep track of metadata
This is a meta feature which will be used by other features. Current one developed is used to keep track of socket files and tap devices.
Other minor things:
- VM will keep running when DMS process is dead.