Skip to content

Commit

Permalink
core: fix SD detach flow ("unregistered_ovf_of_entities" DB table)
Browse files Browse the repository at this point in the history
Fix Storage Domain detach flow.
There is no need to write the OVF data related to VMs & VM templates
into the "unregistered_ovf_of_entities" DB table.
That causes in certain scenarios a stale data to be left there.
This table is correctly filled with up-to-date data during
Storage Domain attach flow.

Signed-off-by: Pavel Bar <pbar@redhat.com>
Bug-Url: https://bugzilla.redhat.com/1705338
  • Loading branch information
barpavel committed Sep 27, 2022
1 parent ce8b692 commit 88ae711
Showing 1 changed file with 0 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
import org.ovirt.engine.core.common.businessentities.VDSStatus;
import org.ovirt.engine.core.common.businessentities.VM;
import org.ovirt.engine.core.common.businessentities.VmBase;
import org.ovirt.engine.core.common.businessentities.VmEntityType;
import org.ovirt.engine.core.common.businessentities.VmTemplate;
import org.ovirt.engine.core.common.businessentities.network.VmNic;
import org.ovirt.engine.core.common.businessentities.storage.Disk;
Expand Down Expand Up @@ -304,28 +303,10 @@ private void removeEntitiesFromStorageDomain(final List<VM> vmsForStorageDomain,
TransactionSupport.executeInNewTransaction(() -> {
for (VM vm : vmsForStorageDomain) {
removeEntityLeftOver(vm.getId(), vm.getName(), storageDomainId);
unregisteredOVFDataDao.saveOVFData(new OvfEntityData(
vm.getId(),
vm.getName(),
VmEntityType.VM,
vm.getClusterArch(),
vm.getCompatibilityVersion(),
storageDomainId,
null,
null));
}

for (VmTemplate vmTemplate : vmTemplatesForStorageDomain) {
removeEntityLeftOver(vmTemplate.getId(), vmTemplate.getName(), storageDomainId);
unregisteredOVFDataDao.saveOVFData(new OvfEntityData(
vmTemplate.getId(),
vmTemplate.getName(),
VmEntityType.TEMPLATE,
vmTemplate.getClusterArch(),
clusterDao.get(vmTemplate.getClusterId()).getCompatibilityVersion(),
storageDomainId,
null,
null));
}
storageDomainDao.removeEntitesFromStorageDomain(storageDomainId);
return null;
Expand Down

0 comments on commit 88ae711

Please sign in to comment.