Skip to content

Commit fdfc051

Browse files
authored
Merge branch '4.20' into 4.20-fiberchannel-patches
2 parents 017a332 + 028dd86 commit fdfc051

File tree

316 files changed

+2395
-823
lines changed

Some content is hidden

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

316 files changed

+2395
-823
lines changed

.github/workflows/ci.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ permissions:
2929
jobs:
3030
build:
3131
if: github.repository == 'apache/cloudstack'
32-
runs-on: ubuntu-22.04
32+
runs-on: ubuntu-24.04
3333

3434
strategy:
3535
fail-fast: false
@@ -232,7 +232,25 @@ jobs:
232232
- name: Install Build Dependencies
233233
run: |
234234
sudo apt-get update
235-
sudo apt-get install -y git uuid-runtime genisoimage netcat ipmitool build-essential libgcrypt20 libgpg-error-dev libgpg-error0 libopenipmi0 ipmitool libpython3-dev libssl-dev libffi-dev python3-openssl python3-dev python3-setuptools
235+
sudo apt-get install -y git uuid-runtime genisoimage netcat-openbsd ipmitool build-essential libgcrypt20 libgpg-error-dev libgpg-error0 libopenipmi0 ipmitool libpython3-dev libssl-dev libffi-dev python3-openssl python3-dev python3-setuptools
236+
237+
- name: Setup IPMI Tool for CloudStack
238+
run: |
239+
# Create cloudstack-common directory if it doesn't exist
240+
sudo mkdir -p /usr/share/cloudstack-common
241+
242+
# Copy ipmitool to cloudstack-common directory if it doesn't exist
243+
if [ ! -f /usr/share/cloudstack-common/ipmitool ]; then
244+
sudo cp /usr/bin/ipmitool /usr/share/cloudstack-common/ipmitool
245+
sudo chmod 755 /usr/share/cloudstack-common/ipmitool
246+
fi
247+
248+
# Create ipmitool-C3 wrapper script
249+
sudo tee /usr/bin/ipmitool > /dev/null << 'EOF'
250+
#!/bin/bash
251+
/usr/share/cloudstack-common/ipmitool -C3 $@
252+
EOF
253+
sudo chmod 755 /usr/bin/ipmitool
236254
237255
- name: Install Python dependencies
238256
run: |
@@ -271,7 +289,7 @@ jobs:
271289
- name: Setup Simulator Prerequisites
272290
run: |
273291
sudo python3 -m pip install --upgrade netaddr mysql-connector-python
274-
python3 -m pip install --user --upgrade tools/marvin/dist/Marvin-*.tar.gz
292+
python3 -m pip install --user --upgrade tools/marvin/dist/[mM]arvin-*.tar.gz
275293
mvn -q -Pdeveloper -pl developer -Ddeploydb
276294
mvn -q -Pdeveloper -pl developer -Ddeploydb-simulator
277295

agent/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<parent>
2525
<groupId>org.apache.cloudstack</groupId>
2626
<artifactId>cloudstack</artifactId>
27-
<version>4.20.2.0-SNAPSHOT</version>
27+
<version>4.20.3.0-SNAPSHOT</version>
2828
</parent>
2929
<dependencies>
3030
<dependency>

agent/src/main/java/com/cloud/agent/Agent.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@
9393
import com.cloud.utils.nio.NioClient;
9494
import com.cloud.utils.nio.NioConnection;
9595
import com.cloud.utils.nio.Task;
96-
import com.cloud.utils.script.OutputInterpreter;
9796
import com.cloud.utils.script.Script;
9897

9998
/**
@@ -598,9 +597,9 @@ protected void setupStartupCommand(final StartupCommand startup) {
598597
}
599598

600599
protected String getAgentArch() {
601-
final Script command = new Script("/usr/bin/arch", 500, logger);
602-
final OutputInterpreter.OneLineParser parser = new OutputInterpreter.OneLineParser();
603-
return command.execute(parser);
600+
String arch = Script.runSimpleBashScript(Script.getExecutableAbsolutePath("arch"), 2000);
601+
logger.debug("Arch for agent: {} found: {}", _name, arch);
602+
return arch;
604603
}
605604

606605
@Override

api/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<parent>
2525
<groupId>org.apache.cloudstack</groupId>
2626
<artifactId>cloudstack</artifactId>
27-
<version>4.20.2.0-SNAPSHOT</version>
27+
<version>4.20.3.0-SNAPSHOT</version>
2828
</parent>
2929
<dependencies>
3030
<dependency>

api/src/main/java/com/cloud/hypervisor/Hypervisor.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,22 @@
3131
import static com.cloud.hypervisor.Hypervisor.HypervisorType.Functionality.DirectDownloadTemplate;
3232
import static com.cloud.hypervisor.Hypervisor.HypervisorType.Functionality.RootDiskSizeOverride;
3333
import static com.cloud.hypervisor.Hypervisor.HypervisorType.Functionality.VmStorageMigration;
34+
import static com.cloud.hypervisor.Hypervisor.HypervisorType.Functionality.VmStorageMigrationWithSnapshots;
3435

3536
public class Hypervisor {
3637
public static class HypervisorType {
3738
public enum Functionality {
3839
DirectDownloadTemplate,
3940
RootDiskSizeOverride,
40-
VmStorageMigration
41+
VmStorageMigration,
42+
VmStorageMigrationWithSnapshots
4143
}
4244

4345
private static final Map<String, HypervisorType> hypervisorTypeMap = new LinkedHashMap<>();
4446
public static final HypervisorType None = new HypervisorType("None"); //for storage hosts
4547
public static final HypervisorType XenServer = new HypervisorType("XenServer", ImageFormat.VHD, EnumSet.of(RootDiskSizeOverride, VmStorageMigration));
4648
public static final HypervisorType KVM = new HypervisorType("KVM", ImageFormat.QCOW2, EnumSet.of(DirectDownloadTemplate, RootDiskSizeOverride, VmStorageMigration));
47-
public static final HypervisorType VMware = new HypervisorType("VMware", ImageFormat.OVA, EnumSet.of(RootDiskSizeOverride, VmStorageMigration));
49+
public static final HypervisorType VMware = new HypervisorType("VMware", ImageFormat.OVA, EnumSet.of(RootDiskSizeOverride, VmStorageMigration, VmStorageMigrationWithSnapshots));
4850
public static final HypervisorType Hyperv = new HypervisorType("Hyperv");
4951
public static final HypervisorType VirtualBox = new HypervisorType("VirtualBox");
5052
public static final HypervisorType Parralels = new HypervisorType("Parralels");

api/src/main/java/com/cloud/server/ManagementService.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import java.util.List;
2121
import java.util.Map;
2222

23-
import com.cloud.user.UserData;
2423
import org.apache.cloudstack.api.command.admin.cluster.ListClustersCmd;
2524
import org.apache.cloudstack.api.command.admin.config.ListCfgGroupsByCmd;
2625
import org.apache.cloudstack.api.command.admin.config.ListCfgsByCmd;
@@ -66,6 +65,7 @@
6665
import org.apache.cloudstack.api.command.user.vmgroup.UpdateVMGroupCmd;
6766
import org.apache.cloudstack.config.Configuration;
6867
import org.apache.cloudstack.config.ConfigurationGroup;
68+
import org.apache.cloudstack.framework.config.ConfigKey;
6969

7070
import com.cloud.alert.Alert;
7171
import com.cloud.capacity.Capacity;
@@ -85,6 +85,7 @@
8585
import com.cloud.storage.GuestOsCategory;
8686
import com.cloud.storage.StoragePool;
8787
import com.cloud.user.SSHKeyPair;
88+
import com.cloud.user.UserData;
8889
import com.cloud.utils.Pair;
8990
import com.cloud.utils.Ternary;
9091
import com.cloud.vm.InstanceGroup;
@@ -98,6 +99,14 @@
9899
public interface ManagementService {
99100
static final String Name = "management-server";
100101

102+
ConfigKey<Boolean> JsInterpretationEnabled = new ConfigKey<>("Hidden"
103+
, Boolean.class
104+
, "js.interpretation.enabled"
105+
, "false"
106+
, "Enable/Disable all JavaScript interpretation related functionalities to create or update Javascript rules."
107+
, false
108+
, ConfigKey.Scope.Global);
109+
101110
/**
102111
* returns the a map of the names/values in the configuration table
103112
*
@@ -481,4 +490,6 @@ VirtualMachine upgradeSystemVM(ScaleSystemVMCmd cmd) throws ResourceUnavailableE
481490

482491
Pair<Boolean, String> patchSystemVM(PatchSystemVMCmd cmd);
483492

493+
void checkJsInterpretationAllowedIfNeededForParameterValue(String paramName, boolean paramValue);
494+
484495
}

api/src/main/java/com/cloud/server/ResourceManagerUtil.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
public interface ResourceManagerUtil {
2020
long getResourceId(String resourceId, ResourceTag.ResourceObjectType resourceType);
21+
long getResourceId(String resourceId, ResourceTag.ResourceObjectType resourceType, boolean checkAccess);
2122
String getUuid(String resourceId, ResourceTag.ResourceObjectType resourceType);
2223
ResourceTag.ResourceObjectType getResourceType(String resourceTypeStr);
2324
void checkResourceAccessible(Long accountId, Long domainId, String exceptionMessage);

api/src/main/java/com/cloud/vm/UserVmService.java

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,31 @@ UserVm upgradeVirtualMachine(ScaleVMCmd cmd) throws ResourceUnavailableException
503503

504504
void collectVmNetworkStatistics (UserVm userVm);
505505

506-
UserVm importVM(final DataCenter zone, final Host host, final VirtualMachineTemplate template, final String instanceName, final String displayName, final Account owner, final String userData, final Account caller, final Boolean isDisplayVm, final String keyboard,
506+
/**
507+
* Import VM into CloudStack
508+
* @param zone importing zone
509+
* @param host importing host
510+
* @param template template for the imported VM
511+
* @param instanceNameInternal set to null to CloudStack to autogenerate from the next available VM ID on database
512+
* @param displayName display name for the imported VM
513+
* @param owner owner of the imported VM
514+
* @param userData user data for the imported VM
515+
* @param caller caller account
516+
* @param isDisplayVm true to display the imported VM
517+
* @param keyboard keyboard distribution for the imported VM
518+
* @param accountId account ID
519+
* @param userId user ID
520+
* @param serviceOffering service offering for the imported VM
521+
* @param sshPublicKey ssh key for the imported VM
522+
* @param hostName the name for the imported VM
523+
* @param hypervisorType hypervisor type for the imported VM
524+
* @param customParameters details for the imported VM
525+
* @param powerState power state of the imported VM
526+
* @param networkNicMap network to nic mapping
527+
* @return the imported VM
528+
* @throws InsufficientCapacityException in case of errors
529+
*/
530+
UserVm importVM(final DataCenter zone, final Host host, final VirtualMachineTemplate template, final String instanceNameInternal, final String displayName, final Account owner, final String userData, final Account caller, final Boolean isDisplayVm, final String keyboard,
507531
final long accountId, final long userId, final ServiceOffering serviceOffering, final String sshPublicKey,
508532
final String hostName, final HypervisorType hypervisorType, final Map<String, String> customParameters,
509533
final VirtualMachine.PowerState powerState, final LinkedHashMap<String, List<NicProfile>> networkNicMap) throws InsufficientCapacityException;

api/src/main/java/com/cloud/vm/snapshot/VMSnapshotService.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import java.util.List;
2121

22+
import com.cloud.utils.fsm.NoTransitionException;
2223
import org.apache.cloudstack.api.command.user.vmsnapshot.ListVMSnapshotCmd;
2324

2425
import com.cloud.exception.ConcurrentOperationException;
@@ -53,4 +54,6 @@ UserVm revertToSnapshot(Long vmSnapshotId) throws InsufficientServerCapacityExce
5354
* @param id vm id
5455
*/
5556
boolean deleteVMSnapshotsFromDB(Long vmId, boolean unmanage);
57+
58+
void updateOperationFailed(VMSnapshot vmSnapshot) throws NoTransitionException;
5659
}

api/src/main/java/org/apache/cloudstack/api/ApiConstants.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public class ApiConstants {
2626
public static final String ACTIVATION_RULE = "activationrule";
2727
public static final String ACTIVITY = "activity";
2828
public static final String ADAPTER_TYPE = "adaptertype";
29+
public static final String ADDITONAL_CONFIG_ENABLED = "additionalconfigenabled";
2930
public static final String ADDRESS = "address";
3031
public static final String ALGORITHM = "algorithm";
3132
public static final String ALIAS = "alias";

0 commit comments

Comments
 (0)