Closed dev-zero closed 10 years ago
While checking our disk images I found an image which was obviously a leftover from a deleted VM template. In that VM template it was attached as a secondary disk.
Looking through the code I found the following fragments:
VmController.php/VmTemplateController.php: actionDelete
$vda = $vm->devices->getDiskByName('vda'); $libvirt = CPhpLibvirt::getInstance(); if (!$libvirt->deleteVolumeFile($vda->sstSourceFile)) {
This is the culprit for the problem described above.
VMs are affected too:
VmController.php: actionDelete
if (!is_null($vm)) { if (!$vm->isActive()) { // delete sstDisk=vda->sstSourceFile $vda = $vm->devices->getDiskByName('vda'); $libvirt = CPhpLibvirt::getInstance(); if (!$libvirt->deleteVolumeFile($vda->sstSourceFile)) { $this->sendAjaxAnswer(array('error' => 1, 'message' => 'Unable to delete Volume File for Vm \'' . $vm->sstDisplayName . '\'!')); }
... as are dynamic VMs:
VmController.php: actionDestroyVm
@unlink($vm->devices->getDiskByName('vda')->sstSourceFile);
For a dynamic VM only the first overlay image will be removed when it is destroyed.
This bug was reproducible in the version 1.2.10.4 (vm-manager version 1.2.18.9)
While checking our disk images I found an image which was obviously a leftover from a deleted VM template. In that VM template it was attached as a secondary disk.
Looking through the code I found the following fragments:
VmController.php/VmTemplateController.php: actionDelete
This is the culprit for the problem described above.
VMs are affected too:
VmController.php: actionDelete
... as are dynamic VMs:
VmController.php: actionDestroyVm
For a dynamic VM only the first overlay image will be removed when it is destroyed.