Skip to content

Properly handle errors and clear VM artefacts by using *exec.Cmd #35

@darkodraskovic

Description

@darkodraskovic

Currently, we launch a VM and we don't wait for the /usr/bin/qemu-system-x86_64 execution to finish. We do like so in order not to block manager while the launched VM is running.

Also, when VMs are running, they create artefacts, especially firmware vars file and disk image file. Currently, we delete those files on SIGTERM. On SIGKILL files are not properly removed. We would like to clean up artefacts immediately after the VM shuts down.

For both of these tasks we need to use *exec.Cmd ptr to struct that is returned when we run qemu-system-x86_64 command.

NB: Manager should probably have some sort of in RAM VM key value store, like Redis, so it knows which machines are currently running. This could also be probably solved via libvirt or maybe QEMU itself (by corresponding queries). This is important because when Manager restarts or while running, it needs to know what VMs are spinned up.

NB: This is connected to ultravioletrs/agent-OLD#42.

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions