Migrate public templates that have URLs on data migration across secondary storages #10364
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Currently, data migration across secondary storages does not migrate public templates that have URLs (only private templates and public templates that do not have URLs are migrated) because, when this feature was implemented, it was assumed that these templates would automatically be downloaded when to newly added secondary storages. However, that's not always the case, as URLs can become inaccessible (unable to download the template), and their templates can be updated (unable to install due to checksum mismatch). This forces operators to manually move the templates inside the storage.
This PR solves this issue by allowing the migration of public templates that have URLs.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
How Has This Been Tested?
In an environment with the following templates:
a
,b
,c
t
System VM Template (KVM)
,z
And two secondary storages:
nfs-1
: has all the templatesnfs-2
: hasb
,c
(all public templates excepta
)I did the following tests:
I restarted the SSVM. Then, I verified that it began to download templates
a
andSystem VM Template (KVM)
tonfs-2
While the templates were downloading, I called
migrateSecondaryStorageData
to migrate the data fromnfs-1
tonfs-2
After the migration ended, I verified that all templates in
nfs-1
were moved tonfs-2
. I also verified that there were no duplicate template entries, and that theinstall_path
of the new entries matched the template's path innfs-2