Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
1524363
Updates to change PUre and Primera to host-centric vlun assignments; …
Mar 29, 2024
41ef2ee
Updates to change PUre and Primera to host-centric vlun assignments; …
Apr 1, 2024
cb1f0fa
Updates to change PUre and Primera to host-centric vlun assignments; …
Apr 1, 2024
e5c61bc
Updates to change PUre and Primera to host-centric vlun assignments; …
Apr 2, 2024
7c12b06
update to add timestamp when deleting pure volumes to avoid future co…
Apr 2, 2024
5bd6909
update to migrate to properly check disk offering is valid for the ta…
Apr 3, 2024
7d041c4
update to migrate to properly check disk offering is valid for the ta…
Apr 3, 2024
c761869
update to migrate to properly check disk offering is valid for the ta…
Apr 3, 2024
3e8cb96
update to migrate to properly check disk offering is valid for the ta…
Apr 4, 2024
73a6fd9
Updates to change PUre and Primera to host-centric vlun assignments; …
Mar 29, 2024
c622afe
Updates to change PUre and Primera to host-centric vlun assignments; …
Apr 1, 2024
d9f1016
Updates to change PUre and Primera to host-centric vlun assignments; …
Apr 1, 2024
94cf706
Updates to change PUre and Primera to host-centric vlun assignments; …
Apr 2, 2024
2dcfdb9
update to add timestamp when deleting pure volumes to avoid future co…
Apr 2, 2024
35b76c9
update to migrate to properly check disk offering is valid for the ta…
Apr 3, 2024
638a30f
update to migrate to properly check disk offering is valid for the ta…
Apr 3, 2024
71cb21d
update to migrate to properly check disk offering is valid for the ta…
Apr 3, 2024
ad331ff
update to migrate to properly check disk offering is valid for the ta…
Apr 4, 2024
2916954
Merge branch '4.19' of https://github.com/rg9975/cloudstack into 4.19
Apr 5, 2024
1151ddf
improve error handling when copying volumes to add precision to which…
Apr 5, 2024
eb72474
rename pure volume before delete to avoid conflicts if the same name …
Apr 5, 2024
98225b7
rename pure volume before delete to avoid conflicts if the same name …
Apr 5, 2024
da6eb37
remove dead code in AdaptiveDataStoreLifeCycleImpl.java
Apr 6, 2024
bb0c3ee
remove dead code in AdaptiveDataStoreLifeCycleImpl.java
Apr 6, 2024
64af7a9
Fix issues found in PR checks
Apr 8, 2024
11bfad7
Merge branch 'apache:4.19' into 4.19
Apr 8, 2024
a2f57e4
Merge branch 'apache:4.19' into 4.19
Apr 23, 2024
d03169c
fix session refresh TTL logic
Apr 26, 2024
f5069bc
Merge branch 'apache:4.19' into 4.19
Apr 27, 2024
179267e
updates from PR comments
Apr 26, 2024
d8a307d
logic to delete by path ONLY on supported OUI
Apr 29, 2024
f1ebd80
fix to StorageSystemDataMotionStrategy compile error
Apr 29, 2024
0b69bae
change noisy debug message to trace message
Apr 29, 2024
52f5c97
fix double callback call in handleVolumeMigrationFromNonManagedStorag…
Apr 29, 2024
293a0f6
fix for flash array delete error
Apr 30, 2024
6c0cb48
fix typo in StorageSystemDataMotionStrategy
Apr 30, 2024
dc1979b
change copyVolume to use writeback to speed up copy ops
Apr 30, 2024
485c305
Merge branch 'apache:4.19' into 4.19
May 15, 2024
59d5089
merge upstream changes
May 30, 2024
d4e6751
remove returning PrimaryStorageDownloadAnswer when connectPhysicalDis…
May 31, 2024
a1b4a60
remove returning PrimaryStorageDownloadAnswer when connectPhysicalDis…
Jun 6, 2024
4323252
remove change to only set UUID on snapshot if it is a vmSnapshot
Jun 6, 2024
9f8daa2
reverting change to UserVmManagerImpl.configureCustomRootDiskSize
Jun 6, 2024
b5c3bb8
Merge branch 'apache:4.19' into 4.19
Jun 11, 2024
310a35b
add error checking/simplification per comments from @slavkap
Jun 11, 2024
027c7be
Merge branch '4.19' into 4.19
Jun 18, 2024
51a90dc
merge upstream changes
Jun 19, 2024
89d7a2c
Update engine/storage/datamotion/src/main/java/org/apache/cloudstack/…
Jun 21, 2024
c55dfc9
Update framework/spring/module/src/main/java/org/apache/cloudstack/sp…
Jun 21, 2024
42780e7
address PR comments from @sureshanaparti
Jun 21, 2024
018e556
address PR comments from @sureshanaparti
Jun 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1504,18 +1504,17 @@ public void prepareForMigration(VirtualMachineProfile vm, DeployDestination dest

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

disk.setDetails(getDetails(volumeInfo, dataStore));

PrimaryDataStore primaryDataStore = (PrimaryDataStore)dataStore;
// This might impact other managed storages, enable requires access for migration in relevant datastore driver (currently enabled for PowerFlex storage pool only)
if (primaryDataStore.isManaged() && volService.requiresAccessForMigration(volumeInfo, dataStore)) {
volService.grantAccess(volFactory.getVolume(vol.getId()), dest.getHost(), dataStore);
}

// make sure this is done AFTER grantAccess, as grantAccess may change the volume's state
DataTO volTO = volumeInfo.getTO();
DiskTO disk = storageMgr.getDiskWithThrottling(volTO, vol.getVolumeType(), vol.getDeviceId(), vol.getPath(), vm.getServiceOfferingId(), vol.getDiskOfferingId());
disk.setDetails(getDetails(volumeInfo, dataStore));
vm.addDisk(disk);
}

Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ public void with(ModuleDefinition def, Stack<ModuleDefinition> parents) {
log.debug(String.format("Trying to obtain module [%s] context.", moduleDefinitionName));
ApplicationContext context = getApplicationContext(moduleDefinitionName);
try {
if (context.containsBean("moduleStartup")) {
if (context == null) {
log.warn(String.format("Application context not found for module definition [%s]", moduleDefinitionName));
} else if (context.containsBean("moduleStartup")) {
Runnable runnable = context.getBean("moduleStartup", Runnable.class);
log.info(String.format("Starting module [%s].", moduleDefinitionName));
runnable.run();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ public boolean checkAccess(Account account, String commandName) {
}

if (accountRole.getRoleType() == RoleType.Admin && accountRole.getId() == RoleType.Admin.getId()) {
LOGGER.info(String.format("Account [%s] is Root Admin or Domain Admin, all APIs are allowed.", account));
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(String.format("Account [%s] is Root Admin or Domain Admin, all APIs are allowed.", account));
}
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ public List<String> getApisAllowedToUser(Role role, User user, List<String> apiN

Project project = CallContext.current().getProject();
if (project == null) {
LOGGER.warn(String.format("Project is null, ProjectRoleBasedApiAccessChecker only applies to projects, returning APIs [%s] for user [%s] as allowed.", apiNames, user));
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(String.format("Project is null, ProjectRoleBasedApiAccessChecker only applies to projects, returning APIs [%s] for user [%s] as allowed.", apiNames, user));
}
return apiNames;
}

Expand Down Expand Up @@ -114,8 +116,10 @@ public boolean checkAccess(User user, String apiCommandName) throws PermissionDe

Project project = CallContext.current().getProject();
if (project == null) {
LOGGER.warn(String.format("Project is null, ProjectRoleBasedApiAccessChecker only applies to projects, returning API [%s] for user [%s] as allowed.", apiCommandName,
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(String.format("Project is null, ProjectRoleBasedApiAccessChecker only applies to projects, returning API [%s] for user [%s] as allowed.", apiCommandName,
user));
}
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,15 +302,27 @@ protected MigrateVolumeAnswer migrateRegularVolume(final MigrateVolumeCommand co
(destVolumeObjectTO.getPath() != null ? destVolumeObjectTO.getPath() : UUID.randomUUID().toString());

try {
storagePoolManager.connectPhysicalDisk(srcPrimaryDataStore.getPoolType(), srcPrimaryDataStore.getUuid(), srcPath, srcDetails);
KVMStoragePool sourceStoragePool = storagePoolManager.getStoragePool(srcPrimaryDataStore.getPoolType(), srcPrimaryDataStore.getUuid());

if (!sourceStoragePool.connectPhysicalDisk(srcPath, srcDetails)) {
return new MigrateVolumeAnswer(command, false, "Unable to connect source volume on hypervisor", srcPath);
}

KVMPhysicalDisk srcPhysicalDisk = storagePoolManager.getPhysicalDisk(srcPrimaryDataStore.getPoolType(), srcPrimaryDataStore.getUuid(), srcPath);
if (srcPhysicalDisk == null) {
return new MigrateVolumeAnswer(command, false, "Unable to get handle to source volume on hypervisor", srcPath);
}

KVMStoragePool destPrimaryStorage = storagePoolManager.getStoragePool(destPrimaryDataStore.getPoolType(), destPrimaryDataStore.getUuid());

storagePoolManager.connectPhysicalDisk(destPrimaryDataStore.getPoolType(), destPrimaryDataStore.getUuid(), destPath, destDetails);
if (!destPrimaryStorage.connectPhysicalDisk(destPath, destDetails)) {
return new MigrateVolumeAnswer(command, false, "Unable to connect destination volume on hypervisor", srcPath);
}

storagePoolManager.copyPhysicalDisk(srcPhysicalDisk, destPath, destPrimaryStorage, command.getWaitInMillSeconds());
KVMPhysicalDisk newDiskCopy = storagePoolManager.copyPhysicalDisk(srcPhysicalDisk, destPath, destPrimaryStorage, command.getWaitInMillSeconds());
if (newDiskCopy == null) {
return new MigrateVolumeAnswer(command, false, "Copy command failed to return handle to copied physical disk", destPath);
}
}
catch (Exception ex) {
return new MigrateVolumeAnswer(command, false, ex.getMessage(), null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,36 @@
// under the License.
package com.cloud.hypervisor.kvm.storage;

import java.net.InetAddress;
import java.net.UnknownHostException;

import org.apache.log4j.Logger;

import com.cloud.storage.Storage;
import com.cloud.utils.exception.CloudRuntimeException;

@StorageAdaptorInfo(storagePoolType=Storage.StoragePoolType.FiberChannel)
public class FiberChannelAdapter extends MultipathSCSIAdapterBase {

private Logger LOGGER = Logger.getLogger(getClass());

private String hostname = null;
private String hostnameFq = null;

public FiberChannelAdapter() {
LOGGER.info("Loaded FiberChannelAdapter for StorageLayer");
// get the hostname - we need this to compare to connid values
try {
InetAddress inetAddress = InetAddress.getLocalHost();
hostname = inetAddress.getHostName(); // basic hostname
if (hostname.indexOf(".") > 0) {
hostname = hostname.substring(0, hostname.indexOf(".")); // strip off domain
}
hostnameFq = inetAddress.getCanonicalHostName(); // fully qualified hostname
LOGGER.info("Loaded FiberChannelAdapter for StorageLayer on host [" + hostname + "]");
} catch (UnknownHostException e) {
LOGGER.error("Error getting hostname", e);
}
}

@Override
Expand Down Expand Up @@ -72,6 +95,11 @@ public AddressInfo parseAndValidatePath(String inPath) {
address = value;
} else if (key.equals("connid")) {
connectionId = value;
} else if (key.startsWith("connid.")) {
String inHostname = key.substring(7);
if (inHostname != null && (inHostname.equals(this.hostname) || inHostname.equals(this.hostnameFq))) {
connectionId = value;
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ public Answer copyTemplateToPrimaryStorage(final CopyCommand cmd) {

Map<String, String> details = primaryStore.getDetails();

String path = details != null ? details.get("managedStoreTarget") : null;
String path = derivePath(primaryStore, destData, details);

if (!storagePoolMgr.connectPhysicalDisk(primaryStore.getPoolType(), primaryStore.getUuid(), path, details)) {
s_logger.warn("Failed to connect physical disk at path: " + path + ", in storage pool id: " + primaryStore.getUuid());
Expand Down Expand Up @@ -326,6 +326,16 @@ public Answer copyTemplateToPrimaryStorage(final CopyCommand cmd) {
}
}

private String derivePath(PrimaryDataStoreTO primaryStore, DataTO destData, Map<String, String> details) {
String path = null;
if (primaryStore.getPoolType() == StoragePoolType.FiberChannel) {
path = destData.getPath();
} else {
path = details != null ? details.get("managedStoreTarget") : null;
}
return path;
}

// this is much like PrimaryStorageDownloadCommand, but keeping it separate. copies template direct to root disk
private KVMPhysicalDisk templateToPrimaryDownload(final String templateUrl, final KVMStoragePool primaryPool, final String volUuid, final Long size, final int timeout) {
final int index = templateUrl.lastIndexOf("/");
Expand Down Expand Up @@ -405,7 +415,7 @@ public Answer cloneVolumeFromBaseTemplate(final CopyCommand cmd) {
vol = templateToPrimaryDownload(templatePath, primaryPool, volume.getUuid(), volume.getSize(), cmd.getWaitInMillSeconds());
} if (primaryPool.getType() == StoragePoolType.PowerFlex) {
Map<String, String> details = primaryStore.getDetails();
String path = details != null ? details.get("managedStoreTarget") : null;
String path = derivePath(primaryStore, destData, details);

if (!storagePoolMgr.connectPhysicalDisk(primaryStore.getPoolType(), primaryStore.getUuid(), templatePath, details)) {
s_logger.warn("Failed to connect base template volume at path: " + templatePath + ", in storage pool id: " + primaryStore.getUuid());
Expand Down Expand Up @@ -1046,7 +1056,7 @@ public Answer backupSnapshot(final CopyCommand cmd) {
srcVolume.clearPassphrase();
if (isCreatedFromVmSnapshot) {
s_logger.debug("Ignoring removal of vm snapshot on primary as this snapshot is created from vm snapshot");
} else if (primaryPool.getType() != StoragePoolType.RBD) {
} else if (primaryPool != null && primaryPool.getType() != StoragePoolType.RBD) {
deleteSnapshotOnPrimary(cmd, snapshot, primaryPool);
}

Expand Down Expand Up @@ -2463,8 +2473,7 @@ public Answer copyVolumeFromPrimaryToPrimary(CopyCommand cmd) {
if (!storagePoolMgr.connectPhysicalDisk(destPrimaryStore.getPoolType(), destPrimaryStore.getUuid(), destVolumePath, destPrimaryStore.getDetails())) {
s_logger.warn("Failed to connect dest volume at path: " + destVolumePath + ", in storage pool id: " + destPrimaryStore.getUuid());
}
String managedStoreTarget = destPrimaryStore.getDetails() != null ? destPrimaryStore.getDetails().get("managedStoreTarget") : null;
destVolumeName = managedStoreTarget != null ? managedStoreTarget : destVolumePath;
destVolumeName = derivePath(destPrimaryStore, destData, destPrimaryStore.getDetails());
} else {
final String volumeName = UUID.randomUUID().toString();
destVolumeName = volumeName + "." + destFormat.getFileExtension();
Expand Down
Loading