for detachISO command, iso for this VM is removed in DB even if the detachISO fails. Then after stop/start VM , the iso for this VM is gone

This commit is contained in:
anthony 2011-02-07 17:48:39 -08:00
parent 9614a64636
commit 88ff55849d
1 changed files with 7 additions and 7 deletions

View File

@ -1185,14 +1185,14 @@ public class TemplateManagerImpl implements TemplateManager, Manager, TemplateSe
VMTemplateVO iso = _tmpltDao.findById(isoId);
boolean success = _vmMgr.attachISOToVM(vmId, isoId, attach);
if ( success ) {
if (attach) {
vm.setIsoId(iso.getId());
} else {
vm.setIsoId(null);
}
if ( success && attach) {
vm.setIsoId(iso.getId());
_userVmDao.update(vmId, vm);
}
}
if ( !attach ) {
vm.setIsoId(null);
_userVmDao.update(vmId, vm);
}
return success;
}