Skip to content

Commit

Permalink
core: fix VM and VM template import with old stale configuration
Browse files Browse the repository at this point in the history
Fixing an issue with importing a VM / VM template due to a
stale data that exists in "vm_ovf_generations" DB table.

The issue was that when attaching the SD, the
"unregistered_ovf_of_entities" DB table was populated
from the existing (and stale!) configuration
taken from the "vm_ovf_generations" DB table.

The solution is, when executing SD Attach and populating the
"unregistered_ovf_of_entities", to use the configuration taken
from the "vm_ovf_generations" DB table only when no configuration
is provided ("ovf_data" was passed as null).
Otherwise, the flow should take the provided up-to-date configuration.

Signed-off-by: Pavel Bar <pbar@redhat.com>
Bug-Url: https://bugzilla.redhat.com/1910858
Change-Id: I3a88cb23f8fe5d2c513e3c908c94a4f4ea4d7789
  • Loading branch information
barpavel authored and bennyz committed Apr 14, 2021
1 parent 7ecd9a1 commit 78d21ee
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packaging/dbscripts/unregistered_OVF_data_sp.sql
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ BEGIN
SET ovf_data = vog.ovf_data
FROM vm_ovf_generations vog
WHERE vog.vm_guid = u.entity_guid
AND u.entity_guid = v_entity_guid;
AND u.entity_guid = v_entity_guid
AND v_ovf_data IS NULL;
END;$PROCEDURE$
LANGUAGE plpgsql;

Expand Down

0 comments on commit 78d21ee

Please sign in to comment.