Skip to content

Commit

Permalink
Merge branch 'main' of github.com:apache/cloudstack into vmware-apply…
Browse files Browse the repository at this point in the history
…-iops-in-resize-migrate
  • Loading branch information
BryanMLima committed Sep 10, 2024
2 parents 47f0cd1 + 638c152 commit acb645c
Show file tree
Hide file tree
Showing 794 changed files with 40,957 additions and 4,155 deletions.
1 change: 1 addition & 0 deletions .asf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ github:
- hsato03
- bernardodemarco
- abh1sar
- FelipeM525

protected_branches: ~

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.8'
python-version: '3.10'
architecture: 'x64'

- name: Install Build Dependencies
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.8'
python-version: '3.10'
architecture: 'x64'

- name: Install Build Dependencies
Expand Down Expand Up @@ -284,7 +284,7 @@ jobs:
- name: Start CloudStack Management Server with Simulator
run: |
export MAVEN_OPTS="-Xmx4096m -XX:MaxPermSize=800m -Djava.security.egd=file:/dev/urandom -javaagent:jacoco/lib/jacocoagent.jar=address=*,port=36320,output=tcpserver"
export MAVEN_OPTS="-Xmx4096m -XX:MaxMetaspaceSize=800m -Djava.security.egd=file:/dev/urandom -javaagent:jacoco/lib/jacocoagent.jar=address=*,port=36320,output=tcpserver --add-opens=java.base/java.lang=ALL-UNNAMED --add-exports=java.base/sun.security.x509=ALL-UNNAMED --add-opens=java.base/jdk.internal.reflect=ALL-UNNAMED"
echo -e "\nStarting simulator"
set +e
mvn -Dsimulator -Dorg.eclipse.jetty.annotations.maxWait=120 -pl :cloud-client-ui jetty:run 2>&1 > /tmp/jetty-log || true &
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ jobs:
with:
fetch-depth: 0

- name: Set up JDK11
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
java-version: '17'
cache: 'maven'

- name: Build CloudStack with Quality Checks
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main-sonar-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ jobs:
with:
fetch-depth: 0

- name: Set up JDK11
- name: Set up JDK17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
java-version: '17'
cache: 'maven'

- name: Cache SonarCloud packages
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/rat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '17'
distribution: 'adopt'
architecture: x64
cache: maven
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sonar-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ jobs:
ref: "refs/pull/${{ github.event.number }}/merge"
fetch-depth: 0

- name: Set up JDK11
- name: Set up JDK17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
java-version: '17'
cache: 'maven'

- name: Cache SonarCloud packages
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 14
node-version: 16

- name: Env details
run: |
Expand Down
2 changes: 1 addition & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Clear old database (if any) and deploy the database schema:

Export the following variable if you need to run and debug the management server:

$ export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=500m -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"
$ export MAVEN_OPTS="-Xmx1024m -XX:MaxMetaspaceSize=500m -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"

Start the management server:

Expand Down
2 changes: 1 addition & 1 deletion agent/conf/log4j-cloud.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ under the License.
<Policies>
<TimeBasedTriggeringPolicy/>
</Policies>
<PatternLayout pattern="%d{ISO8601} %-5p [%c{3}] (%t:%x) (logid:%X{logcontextid}) %m%ex%n"/>
<PatternLayout pattern="%d{DEFAULT} %-5p [%c{3}] (%t:%x) (logid:%X{logcontextid}) %m%ex%n"/>
</RollingFile>

<!-- ============================== -->
Expand Down
17 changes: 17 additions & 0 deletions agent/src/main/java/com/cloud/agent/Agent.java
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,13 @@ protected void setupStartupCommand(final StartupCommand startup) {
startup.setGuid(getResourceGuid());
startup.setResourceName(getResourceName());
startup.setVersion(getVersion());
startup.setArch(getAgentArch());
}

protected String getAgentArch() {
final Script command = new Script("/usr/bin/arch", 500, logger);
final OutputInterpreter.OneLineParser parser = new OutputInterpreter.OneLineParser();
return command.execute(parser);
}

@Override
Expand Down Expand Up @@ -858,11 +865,21 @@ public void processReadyCommand(final Command cmd) {
setId(ready.getHostId());
}

verifyAgentArch(ready.getArch());
processManagementServerList(ready.getMsHostList(), ready.getLbAlgorithm(), ready.getLbCheckInterval());

logger.info("Ready command is processed for agent id = {}", getId());
}

private void verifyAgentArch(String arch) {
if (StringUtils.isNotBlank(arch)) {
String agentArch = getAgentArch();
if (!arch.equals(agentArch)) {
logger.error("Unexpected arch {}, expected {}", agentArch, arch);
}
}
}

public void processOtherTask(final Task task) {
final Object obj = task.get();
if (obj instanceof Response) {
Expand Down
50 changes: 50 additions & 0 deletions api/src/main/java/com/cloud/agent/api/to/BucketTO.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
package com.cloud.agent.api.to;

import org.apache.cloudstack.storage.object.Bucket;

public final class BucketTO {

private String name;

private String accessKey;

private String secretKey;

public BucketTO(Bucket bucket) {
this.name = bucket.getName();
this.accessKey = bucket.getAccessKey();
this.secretKey = bucket.getSecretKey();
}

public BucketTO(String name) {
this.name = name;
}

public String getName() {
return this.name;
}

public String getAccessKey() {
return this.accessKey;
}

public String getSecretKey() {
return this.secretKey;
}
}
4 changes: 1 addition & 3 deletions api/src/main/java/com/cloud/agent/api/to/FirewallRuleTO.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,7 @@ public FirewallRuleTO(FirewallRule rule, String srcVlanTag, String srcIp, Firewa
rule.getIcmpType(),
rule.getIcmpCode());
this.trafficType = trafficType;
if (FirewallRule.Purpose.Ipv6Firewall.equals(purpose)) {
this.destCidrList = rule.getDestinationCidrList();
}
this.destCidrList = rule.getDestinationCidrList();
}

public FirewallRuleTO(FirewallRule rule, String srcVlanTag, String srcIp, FirewallRule.Purpose purpose, FirewallRule.TrafficType trafficType,
Expand Down
18 changes: 18 additions & 0 deletions api/src/main/java/com/cloud/agent/api/to/VirtualMachineTO.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ public class VirtualMachineTO {
Map<String, String> extraConfig = new HashMap<>();
Map<Long, String> networkIdToNetworkNameMap = new HashMap<>();
DeployAsIsInfoTO deployAsIsInfo;
String metadataManufacturer;
String metadataProductName;

public VirtualMachineTO(long id, String instanceName, VirtualMachine.Type type, int cpus, Integer speed, long minRam, long maxRam, BootloaderType bootloader,
String os, boolean enableHA, boolean limitCpuUse, String vncPassword) {
Expand Down Expand Up @@ -429,6 +431,22 @@ public void setDeployAsIsInfo(DeployAsIsInfoTO deployAsIsInfo) {
this.deployAsIsInfo = deployAsIsInfo;
}

public String getMetadataManufacturer() {
return metadataManufacturer;
}

public void setMetadataManufacturer(String metadataManufacturer) {
this.metadataManufacturer = metadataManufacturer;
}

public String getMetadataProductName() {
return metadataProductName;
}

public void setMetadataProductName(String metadataProductName) {
this.metadataProductName = metadataProductName;
}

@Override
public String toString() {
return String.format("VM {id: \"%s\", name: \"%s\", uuid: \"%s\", type: \"%s\"}", id, name, uuid, type);
Expand Down
38 changes: 38 additions & 0 deletions api/src/main/java/com/cloud/bgp/ASNumber.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
package com.cloud.bgp;

import org.apache.cloudstack.acl.InfrastructureEntity;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity;

import java.util.Date;

public interface ASNumber extends InfrastructureEntity, InternalIdentity, Identity {

Long getAccountId();
Long getDomainId();
long getAsNumber();
long getAsNumberRangeId();
long getDataCenterId();
Date getAllocatedTime();
boolean isAllocated();
Long getNetworkId();
Long getVpcId();
Date getCreated();
Date getRemoved();
}
31 changes: 31 additions & 0 deletions api/src/main/java/com/cloud/bgp/ASNumberRange.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
package com.cloud.bgp;

import org.apache.cloudstack.acl.InfrastructureEntity;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity;

import java.util.Date;

public interface ASNumberRange extends InfrastructureEntity, InternalIdentity, Identity {

long getStartASNumber();
long getEndASNumber();
long getDataCenterId();
Date getCreated();
}
39 changes: 39 additions & 0 deletions api/src/main/java/com/cloud/bgp/BGPService.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
package com.cloud.bgp;

import com.cloud.exception.ResourceUnavailableException;
import com.cloud.network.Network;
import com.cloud.network.vpc.Vpc;
import com.cloud.utils.Pair;
import org.apache.cloudstack.api.command.user.bgp.ListASNumbersCmd;

import java.util.List;

public interface BGPService {

ASNumberRange createASNumberRange(long zoneId, long startASNumber, long endASNumber);
List<ASNumberRange> listASNumberRanges(Long zoneId);
Pair<List<ASNumber>, Integer> listASNumbers(ListASNumbersCmd cmd);
boolean allocateASNumber(long zoneId, Long asNumber, Long networkId, Long vpcId);
Pair<Boolean, String> releaseASNumber(long zoneId, long asNumber, boolean isReleaseNetworkDestroy);
boolean deleteASRange(long id);

boolean applyBgpPeers(Network network, boolean continueOnError) throws ResourceUnavailableException;

boolean applyBgpPeers(Vpc vpc, boolean continueOnError) throws ResourceUnavailableException;
}
Loading

0 comments on commit acb645c

Please sign in to comment.