Automatically generate cloud disk image when updating domains configuration
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-06-07 11:15:55 +02:00
parent f1339f0711
commit 1fe7c60f36
6 changed files with 55 additions and 8 deletions

View File

@ -182,6 +182,13 @@ impl Handler<DeleteDomainReq> for LibVirtActor {
false => sys::VIR_DOMAIN_UNDEFINE_NVRAM,
})?;
// Delete associated cloud init disk
let cloud_init_disk = AppConfig::get().cloud_init_disk_path_for_vm(&domain_name);
if cloud_init_disk.exists() {
std::fs::remove_file(cloud_init_disk)?;
}
// If requested, delete block storage associated with the VM
if !msg.keep_files {
log::info!("Delete storage associated with the domain");
let path = AppConfig::get().vm_storage_path(msg.id);