Skip to content

Commit 40b9e4d

Browse files
author
Daman Arora
committed
Add config keys for controlling public/private template secondary storage replica counts
1 parent b744824 commit 40b9e4d

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

engine/components-api/src/main/java/com/cloud/template/TemplateManager.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
public interface TemplateManager {
4646
static final String AllowPublicUserTemplatesCK = "allow.public.user.templates";
4747
static final String TemplatePreloaderPoolSizeCK = "template.preloader.pool.size";
48+
static final String PublicTemplateSecStorageCopyCK = "public.template.secstorage.copy";
49+
static final String PrivateTemplateSecStorageCopyCK = "private.template.secstorage.copy";
4850

4951
static final ConfigKey<Boolean> AllowPublicUserTemplates = new ConfigKey<Boolean>("Advanced", Boolean.class, AllowPublicUserTemplatesCK, "true",
5052
"If false, users will not be able to create public Templates.", true, ConfigKey.Scope.Account);
@@ -64,6 +66,18 @@ public interface TemplateManager {
6466
true,
6567
ConfigKey.Scope.Global);
6668

69+
ConfigKey<Integer> PublicTemplateSecStorageCopy = new ConfigKey<Integer>("Advanced", Integer.class,
70+
PublicTemplateSecStorageCopyCK, "0",
71+
"Maximum number of secondary storage pools to which a public template is copied. " +
72+
"0 means copy to all secondary storage pools (default behavior).",
73+
true, ConfigKey.Scope.Zone);
74+
75+
ConfigKey<Integer> PrivateTemplateSecStorageCopy = new ConfigKey<Integer>("Advanced", Integer.class,
76+
PrivateTemplateSecStorageCopyCK, "1",
77+
"Maximum number of secondary storage pools to which a private template is copied. " +
78+
"Default is 1 to preserve existing behavior.",
79+
true, ConfigKey.Scope.Zone);
80+
6781
static final String VMWARE_TOOLS_ISO = "vmware-tools.iso";
6882
static final String XS_TOOLS_ISO = "xs-tools.iso";
6983

server/src/main/java/com/cloud/template/TemplateManagerImpl.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2493,7 +2493,9 @@ public ConfigKey<?>[] getConfigKeys() {
24932493
return new ConfigKey<?>[] {AllowPublicUserTemplates,
24942494
TemplatePreloaderPoolSize,
24952495
ValidateUrlIsResolvableBeforeRegisteringTemplate,
2496-
TemplateDeleteFromPrimaryStorage};
2496+
TemplateDeleteFromPrimaryStorage,
2497+
PublicTemplateSecStorageCopy,
2498+
PrivateTemplateSecStorageCopy};
24972499
}
24982500

24992501
public List<TemplateAdapter> getTemplateAdapters() {

0 commit comments

Comments
 (0)