Skip to content

Commit b6b8a0f

Browse files
committed
Merge remote-tracking branch 'upstream/main' into draas
2 parents 090c222 + 3d6ec29 commit b6b8a0f

File tree

22 files changed

+107
-50
lines changed

22 files changed

+107
-50
lines changed

client/conf/server.properties.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,7 @@ access.log=/var/log/cloudstack/management/access.log
5858

5959
# The deployment mode for the extensions
6060
extensions.deployment.mode=@EXTENSIONSDEPLOYMENTMODE@
61+
62+
# Thread pool configuration
63+
#threads.min=10
64+
#threads.max=500

client/src/main/java/org/apache/cloudstack/ServerDaemon.java

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ public class ServerDaemon implements Daemon {
8686
private static final int DEFAULT_REQUEST_CONTENT_SIZE = 1048576;
8787
private static final String REQUEST_MAX_FORM_KEYS_KEY = "request.max.form.keys";
8888
private static final int DEFAULT_REQUEST_MAX_FORM_KEYS = 5000;
89+
private static final String THREADS_MIN = "threads.min";
90+
private static final String THREADS_MAX = "threads.max";
8991

9092
////////////////////////////////////////////////////////
9193
/////////////// Server Configuration ///////////////////
@@ -106,6 +108,8 @@ public class ServerDaemon implements Daemon {
106108
private String keystoreFile;
107109
private String keystorePassword;
108110
private String webAppLocation;
111+
private int minThreads;
112+
private int maxThreads;
109113

110114
//////////////////////////////////////////////////
111115
/////////////// Public methods ///////////////////
@@ -147,6 +151,8 @@ public void init(final DaemonContext context) {
147151
setSessionTimeout(Integer.valueOf(properties.getProperty(SESSION_TIMEOUT, "30")));
148152
setMaxFormContentSize(Integer.valueOf(properties.getProperty(REQUEST_CONTENT_SIZE_KEY, String.valueOf(DEFAULT_REQUEST_CONTENT_SIZE))));
149153
setMaxFormKeys(Integer.valueOf(properties.getProperty(REQUEST_MAX_FORM_KEYS_KEY, String.valueOf(DEFAULT_REQUEST_MAX_FORM_KEYS))));
154+
setMinThreads(Integer.valueOf(properties.getProperty(THREADS_MIN, "10")));
155+
setMaxThreads(Integer.valueOf(properties.getProperty(THREADS_MAX, "500")));
150156
} catch (final IOException e) {
151157
logger.warn("Failed to read configuration from server.properties file", e);
152158
} finally {
@@ -164,8 +170,8 @@ public void init(final DaemonContext context) {
164170
public void start() throws Exception {
165171
// Thread pool
166172
final QueuedThreadPool threadPool = new QueuedThreadPool();
167-
threadPool.setMinThreads(10);
168-
threadPool.setMaxThreads(500);
173+
threadPool.setMinThreads(minThreads);
174+
threadPool.setMaxThreads(maxThreads);
169175

170176
// Jetty Server
171177
server = new Server(threadPool);
@@ -394,4 +400,12 @@ public void setMaxFormContentSize(int maxFormContentSize) {
394400
public void setMaxFormKeys(int maxFormKeys) {
395401
this.maxFormKeys = maxFormKeys;
396402
}
403+
404+
public void setMinThreads(int minThreads) {
405+
this.minThreads = minThreads;
406+
}
407+
408+
public void setMaxThreads(int maxThreads) {
409+
this.maxThreads = maxThreads;
410+
}
397411
}

debian/rules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ override_dh_auto_install:
8787
cp client/target/lib/*jar $(DESTDIR)/usr/share/$(PACKAGE)-management/lib/
8888
cp -r engine/schema/dist/systemvm-templates/* $(DESTDIR)/usr/share/$(PACKAGE)-management/templates/systemvm/
8989
cp -r plugins/integrations/kubernetes-service/src/main/resources/conf/* $(DESTDIR)/usr/share/$(PACKAGE)-management/cks/conf/
90-
rm -rf $(DESTDIR)/usr/share/$(PACKAGE)-management/templates/systemvm/md5sum.txt
90+
rm -rf $(DESTDIR)/usr/share/$(PACKAGE)-management/templates/systemvm/sha512sum.txt
9191

9292
# Bundle cmk in cloudstack-management
9393
wget https://github.com/apache/cloudstack-cloudmonkey/releases/download/$(CMK_REL)/cmk.linux.x86-64 -O $(DESTDIR)/usr/bin/cmk

engine/schema/pom.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
templateList.add("systemvmtemplate-${csVersion}.${patch}-x86_64-xen")
107107
templateList.add("systemvmtemplate-${csVersion}.${patch}-x86_64-ovm")
108108
templateList.add("systemvmtemplate-${csVersion}.${patch}-x86_64-hyperv")
109-
File file = new File("./engine/schema/dist/systemvm-templates/md5sum.txt")
109+
File file = new File("./engine/schema/dist/systemvm-templates/sha512sum.txt")
110110
def lines = file.readLines()
111111
for (template in templateList) {
112112
def data = lines.findAll { it.contains(template) }
@@ -135,7 +135,7 @@
135135
<goal>wget</goal>
136136
</goals>
137137
<configuration>
138-
<url>${project.systemvm.template.location}/${cs.version}/md5sum.txt</url>
138+
<url>${project.systemvm.template.location}/${cs.version}/sha512sum.txt</url>
139139
<outputDirectory>${basedir}/dist/systemvm-templates/</outputDirectory>
140140
<skipCache>true</skipCache>
141141
<overwrite>true</overwrite>
@@ -205,7 +205,7 @@
205205
<checkSignature>true</checkSignature>
206206
<url>${project.systemvm.template.location}/${cs.version}/systemvmtemplate-${cs.version}.${patch.version}-x86_64-kvm.qcow2.bz2</url>
207207
<outputDirectory>${basedir}/dist/systemvm-templates/</outputDirectory>
208-
<md5>${kvm.checksum}</md5>
208+
<sha512>${kvm.checksum}</sha512>
209209
</configuration>
210210
</execution>
211211
</executions>
@@ -241,7 +241,7 @@
241241
<checkSignature>true</checkSignature>
242242
<url>${project.systemvm.template.location}/${cs.version}/systemvmtemplate-${cs.version}.${patch.version}-x86_64-vmware.ova</url>
243243
<outputDirectory>${basedir}/dist/systemvm-templates/</outputDirectory>
244-
<md5>${vmware.checksum}</md5>
244+
<sha512>${vmware.checksum}</sha512>
245245
</configuration>
246246
</execution>
247247
</executions>
@@ -277,7 +277,7 @@
277277
<checkSignature>true</checkSignature>
278278
<url>${project.systemvm.template.location}/${cs.version}/systemvmtemplate-${cs.version}.${patch.version}-x86_64-xen.vhd.bz2</url>
279279
<outputDirectory>${basedir}/dist/systemvm-templates/</outputDirectory>
280-
<md5>${xen.checksum}</md5>
280+
<sha512>${xen.checksum}</sha512>
281281
</configuration>
282282
</execution>
283283
</executions>
@@ -313,7 +313,7 @@
313313
<checkSignature>true</checkSignature>
314314
<url>${project.systemvm.template.location}/${cs.version}/systemvmtemplate-${cs.version}.${patch.version}-x86_64-ovm.raw.bz2</url>
315315
<outputDirectory>${basedir}/dist/systemvm-templates/</outputDirectory>
316-
<md5>${ovm.checksum}</md5>
316+
<sha512>${ovm.checksum}</sha512>
317317
</configuration>
318318
</execution>
319319
</executions>
@@ -349,7 +349,7 @@
349349
<checkSignature>true</checkSignature>
350350
<url>${project.systemvm.template.location}/${cs.version}/systemvmtemplate-${cs.version}.${patch.version}-x86_64-hyperv.vhd.zip</url>
351351
<outputDirectory>${basedir}/dist/systemvm-templates/</outputDirectory>
352-
<md5>${hyperv.checksum}</md5>
352+
<sha512>${hyperv.checksum}</sha512>
353353
</configuration>
354354
</execution>
355355
</executions>

engine/schema/src/main/resources/META-INF/db/schema-42100to42200.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,8 @@
1919
-- Schema upgrade from 4.21.0.0 to 4.22.0.0
2020
--;
2121

22+
-- Increase length of scripts_version column to 128 due to md5sum to sha512sum change
23+
CALL `cloud`.`IDEMPOTENT_CHANGE_COLUMN`('cloud.domain_router', 'scripts_version', 'scripts_version', 'VARCHAR(128)');
24+
2225
-- Add the column draas_enabled to cloud.backup_repository. if enabled it means that new Instance can be created on another Zones from Backups on this Repository.
2326
CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.backup_repository', 'draas_enabled', 'TINYINT(1) DEFAULT NULL COMMENT ''Backup Repository can be used for disaster recovery on another zone''');

engine/schema/templateConfig.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,5 +94,5 @@ PARENTPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )/dist/systemvm-
9494
mkdir -p $PARENTPATH
9595
METADATAFILE=${PARENTPATH}"metadata.ini"
9696
echo > $METADATAFILE
97-
SOURCEFILE=${PARENTPATH}'md5sum.txt'
97+
SOURCEFILE=${PARENTPATH}'sha512sum.txt'
9898
createMetadataFile

packaging/el8/cloud.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ install -D plugins/integrations/kubernetes-service/src/main/resources/conf/k8s-n
317317
# SystemVM template
318318
mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/%{name}-management/templates/systemvm
319319
cp -r engine/schema/dist/systemvm-templates/* ${RPM_BUILD_ROOT}%{_datadir}/%{name}-management/templates/systemvm
320-
rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}-management/templates/systemvm/md5sum.txt
320+
rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}-management/templates/systemvm/sha512sum.txt
321321

322322
# Sample Extensions
323323
mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/extensions

plugins/backup/dummy/src/main/java/org/apache/cloudstack/backup/DummyBackupProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ public boolean supportsInstanceFromBackup() {
196196

197197
@Override
198198
public Pair<Long, Long> getBackupStorageStats(Long zoneId) {
199-
return new Pair<>(8L * 1024 * 1024 * 1024, 10L * 1024 * 1024 * 1024);
199+
return new Pair<>(0L, 0L);
200200
}
201201

202202
@Override

server/src/main/java/com/cloud/storage/StorageManagerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4052,7 +4052,7 @@ public void doInTransactionWithoutResult(final TransactionStatus status) {
40524052
}
40534053
}
40544054
} catch (Exception e) {
4055-
logger.error("Failed to register systemVM template(s)");
4055+
logger.error("Failed to register systemVM template(s) due to: ", e);
40564056
} finally {
40574057
SystemVmTemplateRegistration.unmountStore(filePath);
40584058
txn.close();

server/src/main/java/org/apache/cloudstack/backup/BackupManagerImpl.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2186,6 +2186,9 @@ public BackupResponse createBackupResponse(Backup backup, Boolean listVmDetails)
21862186

21872187
@Override
21882188
public CapacityVO getBackupStorageUsedStats(Long zoneId) {
2189+
if (isDisabled(zoneId)) {
2190+
return new CapacityVO(null, zoneId, null, null, 0L, 0L, Capacity.CAPACITY_TYPE_BACKUP_STORAGE);
2191+
}
21892192
final BackupProvider backupProvider = getBackupProvider(zoneId);
21902193
Pair<Long, Long> backupUsage = backupProvider.getBackupStorageStats(zoneId);
21912194
return new CapacityVO(null, zoneId, null, null, backupUsage.first(), backupUsage.second(), Capacity.CAPACITY_TYPE_BACKUP_STORAGE);

0 commit comments

Comments
 (0)