[−][src]Trait ttstack::model::VmEngine
Common methods for each engine, such as 'Firecracker', 'Qemu', 'Docker' ...
Required methods
pub fn check_feat(&self, feat_wanted: &[VmEngineFeat]) -> Result<bool>
[src]
Check if all features the client wanted can be supported.
pub fn start_vm(&self, vm: &mut Vm) -> Result<()>
[src]
Start a stopped
VM.
pub fn stop_vm(&self, vm: &mut Vm) -> Result<()>
[src]
Stop(aka pause) a running VM.
pub fn update_vm(&mut self, vm: Vm) -> Result<()>
[src]
Use the new Vm
instead of the old one,
apply all configs in the new Vm
.
pub fn cache_meta(&self, vm: &Vm) -> Result<PathBuf>
[src]
Cache all infomations of the 'Vm' to disk.
pub fn gen_vm_from_meta(&self, path: &Path) -> Result<Vm>
[src]
Restruct a Vm
from a cached config.
Provided methods
pub fn create_vm(&self, vm: &mut Vm) -> Result<()>
[src]
Create the VM instance, and update necessary data of the Vm
.
pub fn destroy_vm(&self, vm: &mut Vm) -> Result<()>
[src]
Destroy the VM instance, and update necessary data of the Vm
.
pub fn rm_meta(&self, vm: &mut Vm, path: &Path) -> Result<()>
[src]
Remove a cached config of Vm
.
pub fn create_snapshot(
&self,
vm: &mut Vm,
name: &str,
life_time: Option<u64>
) -> Result<()>
[src]
&self,
vm: &mut Vm,
name: &str,
life_time: Option<u64>
) -> Result<()>
Add a snapshot for the runtime image:
- stop the runtime instance
- cache current meta-config
- snapshot storage
- restart the runtime instance
pub fn destroy_snapshot(&self, vm: &mut Vm, name: &str) -> Result<()>
[src]
Delete a snapshot of the runtime image:
- remove the storage of snapshot
- remove the cached-meta of snapshot
pub fn apply_snapshot(&mut self, vm: &mut Vm, name: &str) -> Result<()>
[src]
Revert to the state of this snapshot:
- stop the runtime instance
- relink runtime image to the one in snapshot
- restore the responding Vm from cached-meta
- restart the runtime instance