Skip to content

Commit e6ba3be

Browse files
Version changes
1 parent c48b755 commit e6ba3be

File tree

14 files changed

+40
-28
lines changed

14 files changed

+40
-28
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,9 @@ public class ApiConstants {
498498
public static final String STORAGE_TAGS = "storagetags";
499499
public static final String STORAGE_ACCESS_GROUPS = "storageaccessgroups";
500500
public static final String STORAGE_ACCESS_GROUP = "storageaccessgroup";
501+
public static final String CLUSTER_STORAGE_ACCESS_GROUPS = "clusterstorageaccessgroups";
502+
public static final String POD_STORAGE_ACCESS_GROUPS = "podstorageaccessgroups";
503+
public static final String ZONE_STORAGE_ACCESS_GROUPS = "zonestorageaccessgroups";
501504
public static final String SUCCESS = "success";
502505
public static final String SUITABLE_FOR_VM = "suitableforvirtualmachine";
503506
public static final String SUPPORTS_STORAGE_SNAPSHOT = "supportsstoragesnapshot";

api/src/main/java/org/apache/cloudstack/api/command/admin/cluster/ListClustersCmd.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ public class ListClustersCmd extends BaseListCmd {
7474
since = "4.20.1")
7575
private String arch;
7676

77-
@Parameter(name = ApiConstants.STORAGE_ACCESS_GROUP, type = CommandType.STRING, description = "the name of the storage access group")
77+
@Parameter(name = ApiConstants.STORAGE_ACCESS_GROUP, type = CommandType.STRING,
78+
description = "the name of the storage access group",
79+
since = "4.21.0")
7880
private String storageAccessGroup;
7981

8082
/////////////////////////////////////////////////////

api/src/main/java/org/apache/cloudstack/api/command/admin/host/ListHostsCmd.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ public class ListHostsCmd extends BaseListCmd {
113113
@Parameter(name = ApiConstants.ARCH, type = CommandType.STRING, description = "CPU Arch of the host", since = "4.20.1")
114114
private String arch;
115115

116-
@Parameter(name = ApiConstants.STORAGE_ACCESS_GROUP, type = CommandType.STRING, description = "the name of the storage access group")
116+
@Parameter(name = ApiConstants.STORAGE_ACCESS_GROUP, type = CommandType.STRING,
117+
description = "the name of the storage access group",
118+
since = "4.21.0")
117119
private String storageAccessGroup;
118120

119121
/////////////////////////////////////////////////////

api/src/main/java/org/apache/cloudstack/api/command/admin/pod/ListPodsByCmd.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ public class ListPodsByCmd extends BaseListCmd {
5555
@Parameter(name = ApiConstants.SHOW_CAPACITIES, type = CommandType.BOOLEAN, description = "flag to display the capacity of the pods")
5656
private Boolean showCapacities;
5757

58-
@Parameter(name = ApiConstants.STORAGE_ACCESS_GROUP, type = CommandType.STRING, description = "the name of the storage access group")
58+
@Parameter(name = ApiConstants.STORAGE_ACCESS_GROUP, type = CommandType.STRING,
59+
description = "the name of the storage access group",
60+
since = "4.21.0")
5961
private String storageAccessGroup;
6062

6163
/////////////////////////////////////////////////////

api/src/main/java/org/apache/cloudstack/api/command/admin/storage/ConfigureStorageAccessCmd.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ public class ConfigureStorageAccessCmd extends BaseAsyncCmd {
6060
private Long storageId;
6161

6262
@Parameter(name = ApiConstants.STORAGE_ACCESS_GROUPS, type = CommandType.LIST, collectionType = CommandType.STRING,
63-
description = "comma separated list of storage access groups for connecting the storage pools and the hosts")
63+
description = "comma separated list of storage access groups for connecting the storage pools and the hosts",
64+
since = "4.21.0")
6465
private List<String> storageAccessGroups;
6566

6667

api/src/main/java/org/apache/cloudstack/api/command/user/zone/ListZonesCmd.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ public class ListZonesCmd extends BaseListCmd implements UserCmd {
6969
@Parameter(name = ApiConstants.SHOW_RESOURCE_ICON, type = CommandType.BOOLEAN, description = "flag to display the resource image for the zones")
7070
private Boolean showIcon;
7171

72-
@Parameter(name = ApiConstants.STORAGE_ACCESS_GROUP, type = CommandType.STRING, description = "the name of the storage access group")
72+
@Parameter(name = ApiConstants.STORAGE_ACCESS_GROUP, type = CommandType.STRING,
73+
description = "the name of the storage access group",
74+
since = "4.21.0")
7375
private String storageAccessGroup;
7476

7577
/////////////////////////////////////////////////////

api/src/main/java/org/apache/cloudstack/api/response/ClusterResponse.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,15 @@ public class ClusterResponse extends BaseResponseWithAnnotations {
9696
private String arch;
9797

9898
@SerializedName(ApiConstants.STORAGE_ACCESS_GROUPS)
99-
@Param(description = "comma-separated list of storage access groups for the host", since = "4.20.1")
99+
@Param(description = "comma-separated list of storage access groups for the host", since = "4.21.0")
100100
private String storageAccessGroups;
101101

102-
@SerializedName("podstorageaccessgroups")
103-
@Param(description = "comma-separated list of storage access groups on the pod", since = "4.20.1")
102+
@SerializedName(ApiConstants.POD_STORAGE_ACCESS_GROUPS)
103+
@Param(description = "comma-separated list of storage access groups on the pod", since = "4.21.0")
104104
private String podStorageAccessGroups;
105105

106-
@SerializedName("zonestorageaccessgroups")
107-
@Param(description = "comma-separated list of storage access groups on the zone", since = "4.20.1")
106+
@SerializedName(ApiConstants.ZONE_STORAGE_ACCESS_GROUPS)
107+
@Param(description = "comma-separated list of storage access groups on the zone", since = "4.21.0")
108108
private String zoneStorageAccessGroups;
109109

110110
public String getId() {

api/src/main/java/org/apache/cloudstack/api/response/HostResponse.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -303,19 +303,19 @@ public class HostResponse extends BaseResponseWithAnnotations {
303303
private String arch;
304304

305305
@SerializedName(ApiConstants.STORAGE_ACCESS_GROUPS)
306-
@Param(description = "comma-separated list of storage access groups for the host", since = "4.20.1")
306+
@Param(description = "comma-separated list of storage access groups for the host", since = "4.21.0")
307307
private String storageAccessGroups;
308308

309-
@SerializedName("clusterstorageaccessgroups")
310-
@Param(description = "comma-separated list of storage access groups on the cluster", since = "4.20.1")
309+
@SerializedName(ApiConstants.CLUSTER_STORAGE_ACCESS_GROUPS)
310+
@Param(description = "comma-separated list of storage access groups on the cluster", since = "4.21.0")
311311
private String clusterStorageAccessGroups;
312312

313-
@SerializedName("podstorageaccessgroups")
314-
@Param(description = "comma-separated list of storage access groups on the pod", since = "4.20.1")
313+
@SerializedName(ApiConstants.POD_STORAGE_ACCESS_GROUPS)
314+
@Param(description = "comma-separated list of storage access groups on the pod", since = "4.21.0")
315315
private String podStorageAccessGroups;
316316

317-
@SerializedName("zonestorageaccessgroups")
318-
@Param(description = "comma-separated list of storage access groups on the zone", since = "4.20.1")
317+
@SerializedName(ApiConstants.ZONE_STORAGE_ACCESS_GROUPS)
318+
@Param(description = "comma-separated list of storage access groups on the zone", since = "4.21.0")
319319
private String zoneStorageAccessGroups;
320320

321321
@Override

api/src/main/java/org/apache/cloudstack/api/response/PodResponse.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public class PodResponse extends BaseResponseWithAnnotations {
8989
@Param(description = "comma-separated list of storage access groups for the pod", since = "4.21.0")
9090
private String storageAccessGroups;
9191

92-
@SerializedName("zonestorageaccessgroups")
92+
@SerializedName(ApiConstants.ZONE_STORAGE_ACCESS_GROUPS)
9393
@Param(description = "comma-separated list of storage access groups on the zone", since = "4.21.0")
9494
private String zoneStorageAccessGroups;
9595

api/src/main/java/org/apache/cloudstack/api/response/StoragePoolResponse.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public class StoragePoolResponse extends BaseResponseWithAnnotations {
110110
private String tags;
111111

112112
@SerializedName(ApiConstants.STORAGE_ACCESS_GROUPS)
113-
@Param(description = "the storage access groups for the storage pool")
113+
@Param(description = "the storage access groups for the storage pool", since = "4.21.0")
114114
private String storageAccessGroups;
115115

116116
@SerializedName(ApiConstants.NFS_MOUNT_OPTIONS)

api/src/main/java/org/apache/cloudstack/api/response/ZoneResponse.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ public class ZoneResponse extends BaseResponseWithAnnotations implements SetReso
162162
private boolean routedModeEnabled = false;
163163

164164
@SerializedName(ApiConstants.STORAGE_ACCESS_GROUPS)
165-
@Param(description = "comma-separated list of storage access groups for the zone", since = "4.20.1")
165+
@Param(description = "comma-separated list of storage access groups for the zone", since = "4.21.0")
166166
private String storageAccessGroups;
167167

168168

server/src/main/java/com/cloud/api/query/ViewResponseHelper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -617,15 +617,15 @@ public static List<ServiceOfferingResponse> createServiceOfferingResponse(Servic
617617

618618
public static List<ZoneResponse> createDataCenterResponse(ResponseView view, Boolean showCapacities, Boolean showResourceImage, DataCenterJoinVO... dcs) {
619619
List<ZoneResponse> respList = new ArrayList<ZoneResponse>();
620-
for (DataCenterJoinVO vt : dcs){
620+
for (DataCenterJoinVO vt : dcs) {
621621
respList.add(ApiDBUtils.newDataCenterResponse(view, vt, showCapacities, showResourceImage));
622622
}
623623
return respList;
624624
}
625625

626626
public static List<ZoneResponse> createMinimalDataCenterResponse(ResponseView view, DataCenterJoinVO... dcs) {
627627
List<ZoneResponse> respList = new ArrayList<ZoneResponse>();
628-
for (DataCenterJoinVO vt : dcs){
628+
for (DataCenterJoinVO vt : dcs) {
629629
respList.add(ApiDBUtils.newMinimalDataCenterResponse(view, vt));
630630
}
631631
return respList;

server/src/main/java/com/cloud/resource/ResourceManagerImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2255,15 +2255,15 @@ public void updateStoragePoolConnectionsOnHosts(Long poolId, List<String> storag
22552255
}
22562256

22572257
if (!hostsToConnect.isEmpty()) {
2258-
logger.debug(String.format("Hosts to connect to storage pool [%s]: %s", storagePool.getUuid(), hostsToConnect));
22592258
for (HostVO host : hostsToConnect) {
2259+
logger.debug(String.format("Connecting host [%s] to storage pool [%s]: %s", host, storagePool.getUuid()));
22602260
connectHostToStoragePool(host, storagePool);
22612261
}
22622262
}
22632263

22642264
if (!hostsToDisconnect.isEmpty()) {
2265-
logger.debug(String.format("Hosts to disconnect from storage pool [%s]: %s", storagePool.getUuid(), hostsToDisconnect));
22662265
for (HostVO host : hostsToDisconnect) {
2266+
logger.debug(String.format("Disconnecting host [%s] from storage pool [%s]: %s", host, storagePool.getUuid()));
22672267
disconnectHostFromStoragePool(host, storagePool);
22682268
}
22692269
}

server/src/main/java/com/cloud/vm/UserVmManagerImpl.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6648,7 +6648,7 @@ public VirtualMachine vmStorageMigration(Long vmId, StoragePool destPool) {
66486648
VMInstanceVO vm = preVmStorageMigrationCheck(vmId);
66496649
Map<Long, Long> volumeToPoolIds = new HashMap<>();
66506650
checkDestinationHypervisorType(destPool, vm);
6651-
checkIfDestinationPoolHasSameStoragePool(destPool, vm);
6651+
checkIfDestinationPoolHasSameStorageAccessGroups(destPool, vm);
66526652
List<VolumeVO> volumes = _volsDao.findByInstance(vm.getId());
66536653
StoragePoolVO destinationPoolVo = _storagePoolDao.findById(destPool.getId());
66546654
Long destPoolPodId = ScopeType.CLUSTER.equals(destinationPoolVo.getScope()) || ScopeType.HOST.equals(destinationPoolVo.getScope()) ?
@@ -6703,12 +6703,12 @@ public VirtualMachine vmStorageMigration(Long vmId, Map<String, String> volumeTo
67036703
return findMigratedVm(vm.getId(), vm.getType());
67046704
}
67056705

6706-
private void checkIfDestinationPoolHasSameStoragePool(StoragePool destPool, VMInstanceVO vm) {
6706+
private void checkIfDestinationPoolHasSameStorageAccessGroups(StoragePool destPool, VMInstanceVO vm) {
67076707
Long hostId = vm.getHostId();
67086708
if (hostId != null) {
67096709
Host host = _hostDao.findById(hostId);
67106710
if (!storageManager.checkIfHostAndStoragePoolHasCommonStorageAccessGroups(host, destPool)) {
6711-
throw new InvalidParameterValueException(String.format("Destination pool %s does not have matching storage tags as host %s", destPool.getName(), host.getName()));
6711+
throw new InvalidParameterValueException(String.format("Destination pool %s does not have matching storage access groups as host %s", destPool.getName(), host.getName()));
67126712
}
67136713
}
67146714
}
@@ -7296,7 +7296,7 @@ private Map<Long, Long> getVolumePoolMappingForMigrateVmWithStorage(VMInstanceVO
72967296
}
72977297
HostVO host = _hostDao.findById(vm.getHostId());
72987298
if (!storageManager.checkIfHostAndStoragePoolHasCommonStorageAccessGroups(host, pool)) {
7299-
throw new InvalidParameterValueException(String.format("Destination pool %s for the volume %s does not have matching storage tags as host %s", pool.getName(), volume.getName(), host.getName()));
7299+
throw new InvalidParameterValueException(String.format("Destination pool %s for the volume %s does not have matching storage access groups as host %s", pool.getName(), volume.getName(), host.getName()));
73007300
}
73017301

73027302
HypervisorType hypervisorType = _volsDao.getHypervisorType(volume.getId());

0 commit comments

Comments
 (0)