Skip to content

Commit 3923f80

Browse files
committed
Merge branch '4.19'
2 parents f6ceeab + 620ed16 commit 3923f80

File tree

91 files changed

+1859
-1135
lines changed

Some content is hidden

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

91 files changed

+1859
-1135
lines changed

api/src/main/java/org/apache/cloudstack/api/command/admin/config/UpdateHypervisorCapabilitiesCmd.java

+14
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ public class UpdateHypervisorCapabilitiesCmd extends BaseCmd {
4343
@Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = HypervisorCapabilitiesResponse.class, description = "ID of the hypervisor capability")
4444
private Long id;
4545

46+
@Parameter(name = ApiConstants.HYPERVISOR, type = CommandType.STRING, description = "the hypervisor for which the hypervisor capabilities are to be updated", since = "4.19.1")
47+
private String hypervisor;
48+
49+
@Parameter(name = ApiConstants.HYPERVISOR_VERSION, type = CommandType.STRING, description = "the hypervisor version for which the hypervisor capabilities are to be updated", since = "4.19.1")
50+
private String hypervisorVersion;
51+
4652
@Parameter(name = ApiConstants.SECURITY_GROUP_EANBLED, type = CommandType.BOOLEAN, description = "set true to enable security group for this hypervisor.")
4753
private Boolean securityGroupEnabled;
4854

@@ -73,6 +79,14 @@ public Long getId() {
7379
return id;
7480
}
7581

82+
public String getHypervisor() {
83+
return hypervisor;
84+
}
85+
86+
public String getHypervisorVersion() {
87+
return hypervisorVersion;
88+
}
89+
7690
public Long getMaxGuestsLimit() {
7791
return maxGuestsLimit;
7892
}

api/src/main/java/org/apache/cloudstack/api/command/admin/vm/ImportUnmanagedInstanceCmd.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,8 @@ public Map<String, Long> getNicNetworkList() {
201201
for (Map<String, String> entry : (Collection<Map<String, String>>)nicNetworkList.values()) {
202202
String nic = entry.get(VmDetailConstants.NIC);
203203
String networkUuid = entry.get(VmDetailConstants.NETWORK);
204-
if (logger.isTraceEnabled()) {
205-
logger.trace(String.format("nic, '%s', goes on net, '%s'", nic, networkUuid));
204+
if (logger.isDebugEnabled()) {
205+
logger.debug(String.format("nic, '%s', goes on net, '%s'", nic, networkUuid));
206206
}
207207
if (StringUtils.isAnyEmpty(nic, networkUuid) || _entityMgr.findByUuid(Network.class, networkUuid) == null) {
208208
throw new InvalidParameterValueException(String.format("Network ID: %s for NIC ID: %s is invalid", networkUuid, nic));
@@ -219,8 +219,8 @@ public Map<String, Network.IpAddresses> getNicIpAddressList() {
219219
for (Map<String, String> entry : (Collection<Map<String, String>>)nicIpAddressList.values()) {
220220
String nic = entry.get(VmDetailConstants.NIC);
221221
String ipAddress = StringUtils.defaultIfEmpty(entry.get(VmDetailConstants.IP4_ADDRESS), null);
222-
if (logger.isTraceEnabled()) {
223-
logger.trace(String.format("nic, '%s', gets ip, '%s'", nic, ipAddress));
222+
if (logger.isDebugEnabled()) {
223+
logger.debug(String.format("nic, '%s', gets ip, '%s'", nic, ipAddress));
224224
}
225225
if (StringUtils.isEmpty(nic)) {
226226
throw new InvalidParameterValueException(String.format("NIC ID: '%s' is invalid for IP address mapping", nic));

api/src/main/java/org/apache/cloudstack/vm/UnmanagedVMsManager.java

+9
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@ public interface UnmanagedVMsManager extends VmImportService, UnmanageVMService,
3030
"If set to true, do not remove VM nics (and its MAC addresses) when unmanaging a VM, leaving them allocated but not reserved. " +
3131
"If set to false, nics are removed and MAC addresses can be reassigned", true, ConfigKey.Scope.Zone);
3232

33+
ConfigKey<Integer> RemoteKvmInstanceDisksCopyTimeout = new ConfigKey<>(Integer.class,
34+
"remote.kvm.instance.disks.copy.timeout",
35+
"Advanced",
36+
"30",
37+
"Timeout (in mins) to prepare and copy the disks of remote KVM instance while importing the instance from an external host",
38+
true,
39+
ConfigKey.Scope.Global,
40+
null);
41+
3342
static boolean isSupported(Hypervisor.HypervisorType hypervisorType) {
3443
return hypervisorType == VMware || hypervisorType == KVM;
3544
}

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

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
package com.cloud.agent.api;
1919

20-
@LogLevel(LogLevel.Log4jLevel.Trace)
2120
public class CheckVolumeAnswer extends Answer {
2221

2322
private long size;

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

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
import com.cloud.agent.api.to.StorageFilerTO;
2323

24-
@LogLevel(LogLevel.Log4jLevel.Trace)
2524
public class CheckVolumeCommand extends Command {
2625

2726
String srcFile;

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

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
package com.cloud.agent.api;
1919

20-
@LogLevel(LogLevel.Log4jLevel.Trace)
2120
public class CopyRemoteVolumeAnswer extends Answer {
2221

2322
private String remoteIp;

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

+1-4
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,13 @@
2121

2222
import com.cloud.agent.api.to.StorageFilerTO;
2323

24-
@LogLevel(LogLevel.Log4jLevel.Trace)
2524
public class CopyRemoteVolumeCommand extends Command {
26-
2725
String remoteIp;
2826
String username;
27+
@LogLevel(LogLevel.Log4jLevel.Off)
2928
String password;
3029
String srcFile;
31-
3230
String tmpPath;
33-
3431
StorageFilerTO storageFilerTO;
3532

3633
public CopyRemoteVolumeCommand(String remoteIp, String username, String password) {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
import java.util.HashMap;
2323
import java.util.List;
2424

25-
@LogLevel(LogLevel.Log4jLevel.Trace)
2625
public class GetRemoteVmsAnswer extends Answer {
2726

2827
private String remoteIp;
28+
@LogLevel(LogLevel.Log4jLevel.Trace)
2929
private HashMap<String, UnmanagedInstanceTO> unmanagedInstances;
3030

3131
List<String> vmNames;

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919

2020
package com.cloud.agent.api;
2121

22-
@LogLevel(LogLevel.Log4jLevel.Trace)
2322
public class GetRemoteVmsCommand extends Command {
2423

2524
String remoteIp;
2625
String username;
26+
@LogLevel(LogLevel.Log4jLevel.Off)
2727
String password;
2828

2929
public GetRemoteVmsCommand(String remoteIp, String username, String password) {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121

2222
import org.apache.cloudstack.vm.UnmanagedInstanceTO;
2323

24-
@LogLevel(LogLevel.Log4jLevel.Trace)
2524
public class GetUnmanagedInstancesAnswer extends Answer {
2625

2726
private String instanceName;
27+
@LogLevel(LogLevel.Log4jLevel.Trace)
2828
private HashMap<String, UnmanagedInstanceTO> unmanagedInstances;
2929

3030
GetUnmanagedInstancesAnswer() {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@
2828
* All managed instances will be filtered while trying to find unmanaged instances.
2929
*/
3030

31-
@LogLevel(LogLevel.Log4jLevel.Trace)
3231
public class GetUnmanagedInstancesCommand extends Command {
3332

3433
String instanceName;
34+
@LogLevel(LogLevel.Log4jLevel.Trace)
3535
List<String> managedInstancesNames;
3636

3737
public GetUnmanagedInstancesCommand() {

debian/control

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Description: CloudStack server library
2424

2525
Package: cloudstack-agent
2626
Architecture: all
27-
Depends: ${python:Depends}, ${python3:Depends}, openjdk-17-jre-headless | java17-runtime-headless | java17-runtime | zulu-17, cloudstack-common (= ${source:Version}), lsb-base (>= 9), openssh-client, qemu-kvm (>= 2.5) | qemu-system-x86 (>= 5.2), libvirt-bin (>= 1.3) | libvirt-daemon-system (>= 3.0), iproute2, ebtables, vlan, ipset, python3-libvirt, ethtool, iptables, cryptsetup, rng-tools, lsb-release, ufw, apparmor
27+
Depends: ${python:Depends}, ${python3:Depends}, openjdk-17-jre-headless | java17-runtime-headless | java17-runtime | zulu-17, cloudstack-common (= ${source:Version}), lsb-base (>= 9), openssh-client, qemu-kvm (>= 2.5) | qemu-system-x86 (>= 5.2), libvirt-bin (>= 1.3) | libvirt-daemon-system (>= 3.0), iproute2, ebtables, vlan, ipset, python3-libvirt, ethtool, iptables, cryptsetup, rng-tools, lsb-release, ufw, apparmor, cpu-checker
2828
Recommends: init-system-helpers
2929
Conflicts: cloud-agent, cloud-agent-libs, cloud-agent-deps, cloud-agent-scripts
3030
Description: CloudStack agent

engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java

+1-11
Original file line numberDiff line numberDiff line change
@@ -3064,17 +3064,7 @@ protected void checkL2OfferingServices(NetworkOfferingVO ntwkOff) {
30643064
@Override
30653065
@DB
30663066
public boolean shutdownNetwork(final long networkId, final ReservationContext context, final boolean cleanupElements) {
3067-
NetworkVO network = _networksDao.findById(networkId);
3068-
if (network.getState() == Network.State.Allocated) {
3069-
logger.debug("Network is already shutdown: {}", network);
3070-
return true;
3071-
}
3072-
3073-
if (network.getState() != Network.State.Implemented && network.getState() != Network.State.Shutdown) {
3074-
logger.debug("Network is not implemented: {}", network);
3075-
return false;
3076-
}
3077-
3067+
NetworkVO network = null;
30783068
try {
30793069
//do global lock for the network
30803070
network = _networksDao.acquireInLockTable(networkId, NetworkLockTimeout.value());

engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java

+4-5
Original file line numberDiff line numberDiff line change
@@ -1493,18 +1493,17 @@ public void prepareForMigration(VirtualMachineProfile vm, DeployDestination dest
14931493

14941494
for (VolumeVO vol : vols) {
14951495
VolumeInfo volumeInfo = volFactory.getVolume(vol.getId());
1496-
DataTO volTO = volumeInfo.getTO();
1497-
DiskTO disk = storageMgr.getDiskWithThrottling(volTO, vol.getVolumeType(), vol.getDeviceId(), vol.getPath(), vm.getServiceOfferingId(), vol.getDiskOfferingId());
14981496
DataStore dataStore = dataStoreMgr.getDataStore(vol.getPoolId(), DataStoreRole.Primary);
14991497

1500-
disk.setDetails(getDetails(volumeInfo, dataStore));
1501-
15021498
PrimaryDataStore primaryDataStore = (PrimaryDataStore)dataStore;
15031499
// This might impact other managed storages, enable requires access for migration in relevant datastore driver (currently enabled for PowerFlex storage pool only)
15041500
if (primaryDataStore.isManaged() && volService.requiresAccessForMigration(volumeInfo, dataStore)) {
15051501
volService.grantAccess(volFactory.getVolume(vol.getId()), dest.getHost(), dataStore);
15061502
}
1507-
1503+
// make sure this is done AFTER grantAccess, as grantAccess may change the volume's state
1504+
DataTO volTO = volumeInfo.getTO();
1505+
DiskTO disk = storageMgr.getDiskWithThrottling(volTO, vol.getVolumeType(), vol.getDeviceId(), vol.getPath(), vm.getServiceOfferingId(), vol.getDiskOfferingId());
1506+
disk.setDetails(getDetails(volumeInfo, dataStore));
15081507
vm.addDisk(disk);
15091508
}
15101509

0 commit comments

Comments
 (0)