Skip to content

Commit 167df35

Browse files
authored
Merge branch 'main' into FWinVPCpublicIP
2 parents 680c134 + a0aafe2 commit 167df35

92 files changed

Lines changed: 4391 additions & 865 deletions

File tree

Some content is hidden

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

.asf.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ github:
5151

5252
collaborators:
5353
- ingox
54-
- gpordeus
54+
- gp-santos
5555
- erikbocks
5656
- Imvedansh
5757
- Damans227

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ jobs:
283283
# https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2004-Readme.md#mysql
284284
sudo apt-get install -y mysql-server
285285
sudo systemctl start mysql
286-
sudo mysql -uroot -proot -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY ''; FLUSH PRIVILEGES;"
286+
sudo mysql -uroot -proot -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY ''; FLUSH PRIVILEGES;"
287287
sudo systemctl restart mysql
288288
sudo mysql -uroot -e "SELECT VERSION();"
289289

.github/workflows/merge-conflict-checker.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,14 @@
1717

1818
name: "PR Merge Conflict Check"
1919
on:
20-
push:
21-
pull_request:
22-
types: [opened, synchronize, reopened]
20+
schedule:
21+
- cron: '*/10 * * * *'
22+
workflow_dispatch:
2323

24-
permissions: # added using https://github.com/step-security/secure-workflows
25-
contents: read
24+
permissions: {}
2625

2726
concurrency:
28-
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
29-
cancel-in-progress: true
27+
group: "gh-aw-${{ github.workflow }}"
3028

3129
jobs:
3230
triage:

api/src/main/java/com/cloud/agent/api/to/VirtualMachineTO.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public class VirtualMachineTO {
5151

5252
private long minRam;
5353
private long maxRam;
54+
private long requestedRam;
5455
private String hostName;
5556
private String arch;
5657
private String os;
@@ -207,15 +208,20 @@ public long getMinRam() {
207208
return minRam;
208209
}
209210

210-
public void setRam(long minRam, long maxRam) {
211+
public void setRam(long minRam, long maxRam, long requestedRam) {
211212
this.minRam = minRam;
212213
this.maxRam = maxRam;
214+
this.requestedRam = requestedRam;
213215
}
214216

215217
public long getMaxRam() {
216218
return maxRam;
217219
}
218220

221+
public long getRequestedRam() {
222+
return requestedRam;
223+
}
224+
219225
public String getHostName() {
220226
return hostName;
221227
}

api/src/main/java/org/apache/cloudstack/api/command/admin/ca/ProvisionCertificateCmd.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ public class ProvisionCertificateCmd extends BaseAsyncCmd {
6363
description = "Name of the CA service provider, otherwise the default configured provider plugin will be used")
6464
private String provider;
6565

66+
@Parameter(name = ApiConstants.FORCED, type = CommandType.BOOLEAN,
67+
description = "When true, uses SSH to re-provision the agent's certificate, bypassing the NIO agent connection. " +
68+
"Use this when agents are disconnected due to a CA change. Supported for KVM hosts and SystemVMs. Default is false",
69+
since = "4.23.0")
70+
private Boolean forced;
71+
6672
/////////////////////////////////////////////////////
6773
/////////////////// Accessors ///////////////////////
6874
/////////////////////////////////////////////////////
@@ -79,6 +85,10 @@ public String getProvider() {
7985
return provider;
8086
}
8187

88+
public boolean isForced() {
89+
return forced != null && forced;
90+
}
91+
8292
/////////////////////////////////////////////////////
8393
/////////////// API Implementation///////////////////
8494
/////////////////////////////////////////////////////
@@ -90,7 +100,7 @@ public void execute() {
90100
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Unable to find host by ID: " + getHostId());
91101
}
92102

93-
boolean result = caManager.provisionCertificate(host, getReconnect(), getProvider());
103+
boolean result = caManager.provisionCertificate(host, getReconnect(), getProvider(), isForced());
94104
SuccessResponse response = new SuccessResponse(getCommandName());
95105
response.setSuccess(result);
96106
setResponseObject(response);

api/src/main/java/org/apache/cloudstack/api/command/admin/user/GetUserCmd.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import org.apache.cloudstack.api.BaseCmd;
2323
import org.apache.cloudstack.api.Parameter;
2424
import org.apache.cloudstack.api.response.UserResponse;
25-
25+
import org.apache.cloudstack.api.ApiArgValidator;
2626
import com.cloud.exception.InvalidParameterValueException;
2727
import com.cloud.user.UserAccount;
2828

@@ -35,7 +35,7 @@ public class GetUserCmd extends BaseCmd {
3535
//////////////// API parameters /////////////////////
3636
/////////////////////////////////////////////////////
3737

38-
@Parameter(name = ApiConstants.USER_API_KEY, type = CommandType.STRING, required = true, description = "API key of the user")
38+
@Parameter(name = ApiConstants.USER_API_KEY, type = CommandType.STRING, required = true, description = "API key of the user", validations = {ApiArgValidator.NotNullOrEmpty})
3939
private String apiKey;
4040

4141
/////////////////////////////////////////////////////

api/src/main/java/org/apache/cloudstack/ca/CAManager.java

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
import java.util.List;
2424
import java.util.Map;
2525

26+
import com.trilead.ssh2.Connection;
27+
2628
import org.apache.cloudstack.framework.ca.CAProvider;
2729
import org.apache.cloudstack.framework.ca.CAService;
2830
import org.apache.cloudstack.framework.ca.Certificate;
@@ -39,7 +41,10 @@ public interface CAManager extends CAService, Configurable, PluggableService {
3941
ConfigKey<String> CAProviderPlugin = new ConfigKey<>("Advanced", String.class,
4042
"ca.framework.provider.plugin",
4143
"root",
42-
"The CA provider plugin that is used for secure CloudStack management server-agent communication for encryption and authentication. Restart management server(s) when changed.", true);
44+
"The CA provider plugin used for CloudStack internal certificate management (MS-agent encryption and authentication). " +
45+
"The default 'root' provider auto-generates a CA on first startup, but also supports user-provided custom CA material " +
46+
"via the ca.plugin.root.private.key, ca.plugin.root.public.key, and ca.plugin.root.ca.certificate settings. " +
47+
"Restart management server(s) when changed.", false);
4348

4449
ConfigKey<Integer> CertKeySize = new ConfigKey<>("Advanced", Integer.class,
4550
"ca.framework.cert.keysize",
@@ -85,6 +90,12 @@ public interface CAManager extends CAService, Configurable, PluggableService {
8590
"The actual implementation will depend on the configured CA provider.",
8691
false);
8792

93+
ConfigKey<Boolean> CaInjectDefaultTruststore = new ConfigKey<>("Advanced", Boolean.class,
94+
"ca.framework.inject.default.truststore", "true",
95+
"When true, injects the CA provider's certificate into the JVM default truststore on management server startup. " +
96+
"This allows outgoing HTTPS connections from the management server to trust servers with certificates signed by the configured CA. " +
97+
"Restart management server(s) when changed.", false);
98+
8899
/**
89100
* Returns a list of available CA provider plugins
90101
* @return returns list of CAProvider
@@ -130,12 +141,26 @@ public interface CAManager extends CAService, Configurable, PluggableService {
130141
boolean revokeCertificate(final BigInteger certSerial, final String certCn, final String provider);
131142

132143
/**
133-
* Provisions certificate for given active and connected agent host
144+
* Provisions certificate for given agent host.
145+
* When forced=true, uses SSH to re-provision bypassing the NIO agent connection (for disconnected agents).
134146
* @param host
147+
* @param reconnect
135148
* @param provider
149+
* @param forced when true, provisions via SSH instead of NIO; supports KVM hosts and SystemVMs
136150
* @return returns success/failure as boolean
137151
*/
138-
boolean provisionCertificate(final Host host, final Boolean reconnect, final String provider);
152+
boolean provisionCertificate(final Host host, final Boolean reconnect, final String provider, final boolean forced);
153+
154+
/**
155+
* Provisions certificate for a KVM host using an existing SSH connection.
156+
* Runs keystore-setup to generate a CSR, issues a certificate, then runs keystore-cert-import.
157+
* Used during host discovery and for forced re-provisioning when the NIO agent is unreachable.
158+
* @param sshConnection active SSH connection to the KVM host
159+
* @param agentIp IP address of the KVM host agent
160+
* @param agentHostname hostname of the KVM host agent
161+
* @param caProvider optional CA provider plugin name (null uses default)
162+
*/
163+
void provisionCertificateViaSsh(Connection sshConnection, String agentIp, String agentHostname, String caProvider);
139164

140165
/**
141166
* Setups up a new keystore and generates CSR for a host

client/pom.xml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -716,17 +716,17 @@
716716
</dependency>
717717
<dependency>
718718
<groupId>org.bouncycastle</groupId>
719-
<artifactId>bcprov-jdk15on</artifactId>
719+
<artifactId>bcprov-jdk18on</artifactId>
720720
<version>${cs.bcprov.version}</version>
721721
</dependency>
722722
<dependency>
723723
<groupId>org.bouncycastle</groupId>
724-
<artifactId>bcpkix-jdk15on</artifactId>
724+
<artifactId>bcpkix-jdk18on</artifactId>
725725
<version>${cs.bcprov.version}</version>
726726
</dependency>
727727
<dependency>
728728
<groupId>org.bouncycastle</groupId>
729-
<artifactId>bctls-jdk15on</artifactId>
729+
<artifactId>bctls-jdk18on</artifactId>
730730
<version>${cs.bcprov.version}</version>
731731
</dependency>
732732
</dependencies>
@@ -906,13 +906,13 @@
906906
</artifactItem>
907907
<artifactItem>
908908
<groupId>org.bouncycastle</groupId>
909-
<artifactId>bcprov-jdk15on</artifactId>
909+
<artifactId>bcprov-jdk18on</artifactId>
910910
<overWrite>false</overWrite>
911911
<outputDirectory>${project.build.directory}/lib</outputDirectory>
912912
</artifactItem>
913913
<artifactItem>
914914
<groupId>org.bouncycastle</groupId>
915-
<artifactId>bcpkix-jdk15on</artifactId>
915+
<artifactId>bcpkix-jdk18on</artifactId>
916916
<overWrite>false</overWrite>
917917
<outputDirectory>${project.build.directory}/lib</outputDirectory>
918918
</artifactItem>
@@ -936,7 +936,7 @@
936936
</artifactItem>
937937
<artifactItem>
938938
<groupId>org.bouncycastle</groupId>
939-
<artifactId>bctls-jdk15on</artifactId>
939+
<artifactId>bctls-jdk18on</artifactId>
940940
<overWrite>false</overWrite>
941941
<outputDirectory>${project.build.directory}/lib</outputDirectory>
942942
</artifactItem>
@@ -971,9 +971,9 @@
971971
<exclude>org.apache.tomcat.embed:tomcat-embed-core</exclude>
972972
<exclude>org.apache.geronimo.specs:geronimo-servlet_3.0_spec</exclude>
973973
<exclude>org.apache.geronimo.specs:geronimo-javamail_1.4_spec</exclude>
974-
<exclude>org.bouncycastle:bcprov-jdk15on</exclude>
975-
<exclude>org.bouncycastle:bcpkix-jdk15on</exclude>
976-
<exclude>org.bouncycastle:bctls-jdk15on</exclude>
974+
<exclude>org.bouncycastle:bcprov-jdk18on</exclude>
975+
<exclude>org.bouncycastle:bcpkix-jdk18on</exclude>
976+
<exclude>org.bouncycastle:bctls-jdk18on</exclude>
977977
<exclude>com.mysql:mysql-connector-j</exclude>
978978
<exclude>org.apache.cloudstack:cloud-plugin-storage-volume-storpool</exclude>
979979
<exclude>org.apache.cloudstack:cloud-plugin-storage-volume-linstor</exclude>

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public class ScaleVmCommand extends Command {
3030
Integer maxSpeed;
3131
long minRam;
3232
long maxRam;
33+
private boolean limitCpuUseChange;
3334

3435
public VirtualMachineTO getVm() {
3536
return vm;
@@ -43,7 +44,7 @@ public int getCpus() {
4344
return cpus;
4445
}
4546

46-
public ScaleVmCommand(String vmName, int cpus, Integer minSpeed, Integer maxSpeed, long minRam, long maxRam, boolean limitCpuUse) {
47+
public ScaleVmCommand(String vmName, int cpus, Integer minSpeed, Integer maxSpeed, long minRam, long maxRam, boolean limitCpuUse, Double cpuQuotaPercentage, boolean limitCpuUseChange) {
4748
super();
4849
this.vmName = vmName;
4950
this.cpus = cpus;
@@ -52,6 +53,8 @@ public ScaleVmCommand(String vmName, int cpus, Integer minSpeed, Integer maxSpee
5253
this.minRam = minRam;
5354
this.maxRam = maxRam;
5455
this.vm = new VirtualMachineTO(1L, vmName, null, cpus, minSpeed, maxSpeed, minRam, maxRam, null, null, false, limitCpuUse, null);
56+
this.vm.setCpuQuotaPercentage(cpuQuotaPercentage);
57+
this.limitCpuUseChange = limitCpuUseChange;
5558
}
5659

5760
public void setCpus(int cpus) {
@@ -102,6 +105,10 @@ public VirtualMachineTO getVirtualMachine() {
102105
return vm;
103106
}
104107

108+
public boolean getLimitCpuUseChange() {
109+
return limitCpuUseChange;
110+
}
111+
105112
@Override
106113
public boolean executeInSequence() {
107114
return true;

debian/changelog

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,19 @@ cloudstack (4.23.0.0-SNAPSHOT) unstable; urgency=low
22

33
* Update the version to 4.23.0.0-SNAPSHOT
44

5-
-- the Apache CloudStack project <dev@cloudstack.apache.org> Thu, 30 Oct 2025 19:23:55 +0530
5+
-- the Apache CloudStack project <dev@cloudstack.apache.org> Fri, 22 May 2026 10:20:00 -0300
6+
7+
cloudstack (4.22.1.0) unstable; urgency=low
8+
9+
* Update the version to 4.22.1.0
610

7-
cloudstack (4.23.0.0-SNAPSHOT-SNAPSHOT) unstable; urgency=low
11+
-- the Apache CloudStack project <dev@cloudstack.apache.org> Mon, 11 May 2026 20:26:07 +0530
812

9-
* Update the version to 4.23.0.0-SNAPSHOT-SNAPSHOT
13+
cloudstack (4.22.0.0) unstable; urgency=low
1014

11-
-- the Apache CloudStack project <dev@cloudstack.apache.org> Thu, Aug 28 11:58:36 2025 +0530
15+
* Update the version to 4.22.0.0
16+
17+
-- the Apache CloudStack project <dev@cloudstack.apache.org> Thu, 30 Oct 2025 19:23:55 +0530
1218

1319
cloudstack (4.21.0.0) unstable; urgency=low
1420

0 commit comments

Comments
 (0)