Skip to content

Commit 17db673

Browse files
authored
Merge branch 'main' into add-externaldetails-cleanup
2 parents 0536aab + 3d6ec29 commit 17db673

File tree

68 files changed

+267
-136
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+267
-136
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,12 @@ jobs:
3232
steps:
3333
- uses: actions/checkout@v4
3434

35-
- name: Set up JDK 11
35+
- name: Set up JDK 17
3636
uses: actions/setup-java@v4
3737
with:
38-
java-version: '11'
39-
distribution: 'adopt'
40-
architecture: x64
41-
cache: maven
38+
distribution: 'temurin'
39+
java-version: '17'
40+
cache: 'maven'
4241

4342
- name: Set up Python
4443
uses: actions/setup-python@v5

.github/workflows/ci.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -220,13 +220,12 @@ jobs:
220220
with:
221221
fetch-depth: 0
222222

223-
- name: Set up JDK
223+
- name: Set up JDK 17
224224
uses: actions/setup-java@v4
225225
with:
226-
java-version: '11'
227-
distribution: 'adopt'
228-
architecture: x64
229-
cache: maven
226+
distribution: 'temurin'
227+
java-version: '17'
228+
cache: 'maven'
230229

231230
- name: Set up Python
232231
uses: actions/setup-python@v5

agent/src/main/java/com/cloud/agent/resource/DummyResource.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import java.util.HashMap;
2121
import java.util.List;
2222
import java.util.Map;
23-
import java.util.UUID;
2423

2524
import com.cloud.agent.IAgentControl;
2625
import com.cloud.agent.api.Answer;
@@ -40,6 +39,7 @@
4039
import com.cloud.storage.Storage;
4140
import com.cloud.storage.Storage.StoragePoolType;
4241
import com.cloud.utils.StringUtils;
42+
import com.cloud.utils.UuidUtils;
4343

4444
public class DummyResource implements ServerResource {
4545
String _name;
@@ -133,7 +133,7 @@ protected StoragePoolInfo initializeLocalStorage() {
133133
String hostIp = getConfiguredProperty("private.ip.address", "127.0.0.1");
134134
String localStoragePath = getConfiguredProperty("local.storage.path", "/mnt");
135135
String lh = hostIp + localStoragePath;
136-
String uuid = UUID.nameUUIDFromBytes(lh.getBytes(StringUtils.getPreferredCharset())).toString();
136+
String uuid = UuidUtils.nameUUIDFromBytes(lh.getBytes(StringUtils.getPreferredCharset())).toString();
137137

138138
String capacity = getConfiguredProperty("local.storage.capacity", "1000000000");
139139
String available = getConfiguredProperty("local.storage.avail", "10000000");

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
}

core/src/main/java/com/cloud/agent/api/DeleteStoragePoolCommand.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121

2222
import java.io.File;
2323
import java.util.Map;
24-
import java.util.UUID;
2524

2625
import com.cloud.agent.api.to.StorageFilerTO;
2726
import com.cloud.storage.StoragePool;
27+
import com.cloud.utils.UuidUtils;
2828

2929
public class DeleteStoragePoolCommand extends Command {
3030
public static final String DATASTORE_NAME = "datastoreName";
@@ -49,7 +49,7 @@ public DeleteStoragePoolCommand(StoragePool pool, String localPath) {
4949
}
5050

5151
public DeleteStoragePoolCommand(StoragePool pool) {
52-
this(pool, LOCAL_PATH_PREFIX + File.separator + UUID.nameUUIDFromBytes((pool.getHostAddress() + pool.getPath()).getBytes()));
52+
this(pool, LOCAL_PATH_PREFIX + File.separator + UuidUtils.nameUUIDFromBytes((pool.getHostAddress() + pool.getPath()).getBytes()));
5353
}
5454

5555
public void setPool(StoragePool pool) {

core/src/main/java/com/cloud/agent/api/ModifyStoragePoolCommand.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121

2222
import java.io.File;
2323
import java.util.Map;
24-
import java.util.UUID;
2524

2625
import com.cloud.agent.api.to.StorageFilerTO;
2726
import com.cloud.storage.StoragePool;
27+
import com.cloud.utils.UuidUtils;
2828

2929
public class ModifyStoragePoolCommand extends Command {
3030
public static final String LOCAL_PATH_PREFIX = "/mnt/";
@@ -47,11 +47,11 @@ public ModifyStoragePoolCommand(boolean add, StoragePool pool, String localPath,
4747
}
4848

4949
public ModifyStoragePoolCommand(boolean add, StoragePool pool, Map<String, String> details) {
50-
this(add, pool, LOCAL_PATH_PREFIX + File.separator + UUID.nameUUIDFromBytes((pool.getHostAddress() + pool.getPath()).getBytes()), details);
50+
this(add, pool, LOCAL_PATH_PREFIX + File.separator + UuidUtils.nameUUIDFromBytes((pool.getHostAddress() + pool.getPath()).getBytes()), details);
5151
}
5252

5353
public ModifyStoragePoolCommand(boolean add, StoragePool pool) {
54-
this(add, pool, LOCAL_PATH_PREFIX + File.separator + UUID.nameUUIDFromBytes((pool.getHostAddress() + pool.getPath()).getBytes()));
54+
this(add, pool, LOCAL_PATH_PREFIX + File.separator + UuidUtils.nameUUIDFromBytes((pool.getHostAddress() + pool.getPath()).getBytes()));
5555
}
5656

5757
public boolean getAdd() {

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/java/com/cloud/storage/VMTemplateVO.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434

3535
import com.cloud.cpu.CPU;
3636
import com.cloud.user.UserData;
37+
import com.cloud.utils.UuidUtils;
3738
import org.apache.cloudstack.util.CPUArchConverter;
3839
import org.apache.cloudstack.util.HypervisorTypeConverter;
3940
import org.apache.cloudstack.utils.reflectiontostringbuilderutils.ReflectionToStringBuilderUtils;
@@ -344,7 +345,7 @@ private static String generateUniqueName(long id, long userId, String displayNam
344345
name.append("-");
345346
name.append(userId);
346347
name.append("-");
347-
name.append(UUID.nameUUIDFromBytes((displayName + System.currentTimeMillis()).getBytes()).toString());
348+
name.append(UuidUtils.nameUUIDFromBytes((displayName + System.currentTimeMillis()).getBytes()).toString());
348349
return name.toString();
349350
}
350351

0 commit comments

Comments
 (0)