Skip to content

Commit d7f9576

Browse files
authored
CSTACKEX-234: Enabling storage pool resize (grow and shrink) (#87)
### Description storage pool resize (Grow and shrink) This PR... <!--- Describe your changes in DETAIL - And how has behaviour functionally changed. --> [updateStoragePool] API now resizes the ONTAP FlexVolume backing the pool. When called with a new [capacityBytes], StorageManagerImpl (previously never called the lifecycle hook) now invokes [OntapPrimaryDatastoreLifecycle.updateStoragePool()], which calls the ONTAP REST API (PATCH /api/storage/volumes/{uuid}) and polls the async job to completion. No validation is applied — the new size is passed directly to ONTAP, which enforces all constraints and returns any errors as-is. This also includes UT's. <!-- For new features, provide link to FS, dev ML discussion etc. --> <!-- In case of bug fix, the expected and actual behaviours, steps to reproduce. --> <!-- When "Fixes: #<id>" is specified, the issue/PR will automatically be closed when this PR gets merged --> <!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" --> <!-- Fixes: # --> <!--- ******************************************************************************* --> <!--- NOTE: AUTOMATION USES THE DESCRIPTIONS TO SET LABELS AND PRODUCE DOCUMENTATION. --> <!--- PLEASE PUT AN 'X' in only **ONE** box --> <!--- ******************************************************************************* --> ### Types of changes - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [x] New feature (non-breaking change which adds functionality) - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] Enhancement (improves an existing feature and functionality) - [ ] Cleanup (Code refactoring and cleanup, that may add test cases) - [ ] Build/CI - [ ] Test (unit or integration test code) ### Feature/Enhancement Scale or Bug Severity #### Feature/Enhancement Scale - [ ] Major - [x] Minor #### Bug Severity - [ ] BLOCKER - [ ] Critical - [ ] Major - [ ] Minor - [ ] Trivial ### Screenshots (if appropriate): ### How Has This Been Tested? the flex volume is created with size 20GiB: <img width="1550" height="870" alt="Screenshot 2026-08-07 at 2 53 44 PM" src="https://github.com/user-attachments/assets/b312f4ec-b4b7-420a-9b1e-81e392a882c4" /> case 1: when A valid input for resize is filled by user: <img width="1458" height="681" alt="Screenshot 2026-08-07 at 2 54 17 PM" src="https://github.com/user-attachments/assets/bb0caf98-df9b-4d6f-ae76-0ca4f7659a0f" /> <img width="1255" height="736" alt="Screenshot 2026-08-07 at 2 54 44 PM" src="https://github.com/user-attachments/assets/7c0b8f49-213f-4163-971a-3a39c1d49936" /> after successful resize: <img width="1555" height="836" alt="Screenshot 2026-08-07 at 3 23 15 PM" src="https://github.com/user-attachments/assets/b7de8bfb-d8ca-4983-ae58-6c0c2503d943" /> case 2: capacity bytes given is smaller than ontap volume minimum size <img width="1476" height="846" alt="Screenshot 2026-08-07 at 2 49 58 PM" src="https://github.com/user-attachments/assets/a670be26-ab86-4e79-be50-86dd68bf39e9" /> case 3: capacity bytes given is smaller than ontap volume maximum size <img width="1469" height="874" alt="Screenshot 2026-08-07 at 2 52 11 PM" src="https://github.com/user-attachments/assets/da10b5c8-f9a3-4651-a1c2-404a908f4832" /> UT's for it : Ran just the update storage pool tests in storagestrategytest and primarydatastorelifecycletest <img width="856" height="773" alt="Screenshot 2026-08-14 at 4 07 37 PM" src="https://github.com/user-attachments/assets/b3d23c36-b635-48da-9403-aad5cd5685a6" /> Ran all tests in both the files: <img width="868" height="788" alt="Screenshot 2026-08-14 at 4 09 12 PM" src="https://github.com/user-attachments/assets/956e7c0c-190c-478f-be79-5a77623cb0bc" /> <!-- Please describe in detail how you tested your changes. --> <!-- Include details of your testing environment, and the tests you ran to --> #### How did you try to break this feature and the system with this change? <!-- see how your change affects other areas of the code, etc. --> <!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md) document -->
1 parent f2e93d7 commit d7f9576

8 files changed

Lines changed: 260 additions & 7 deletions

File tree

plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/client/VolumeFeignClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,5 @@ public interface VolumeFeignClient {
5252

5353
@RequestLine("PATCH /api/storage/volumes/{uuid}")
5454
@Headers({ "Authorization: {authHeader}"})
55-
JobResponse updateVolumeRebalancing(@Param("authHeader") String authHeader, @Param("uuid") String uuid, Volume volumeRequest);
55+
JobResponse updateVolume(@Param("authHeader") String authHeader, @Param("uuid") String uuid, Volume volumeRequest);
5656
}

plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/lifecycle/OntapPrimaryDatastoreLifecycle.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,34 @@ public boolean migrateToObjectStore(DataStore store) {
551551

552552
@Override
553553
public void updateStoragePool(StoragePool storagePool, Map<String, String> details) {
554+
String newCapacityStr = details.get(PrimaryDataStoreLifeCycle.CAPACITY_BYTES);
555+
if (newCapacityStr == null) {
556+
logger.debug("No capacity change requested for pool: {}, skipping FlexVolume resize", storagePool.getName());
557+
return;
558+
}
559+
560+
long currentCapacityBytes = storagePool.getCapacityBytes();
561+
long newCapacityBytes = Long.parseLong(newCapacityStr);
562+
StorageStrategy storageStrategy = OntapStorageUtils.getStrategyByStoragePoolDetails(details);
563+
564+
String volumeUuid = details.get(OntapStorageConstants.VOLUME_UUID);
565+
if (volumeUuid == null || volumeUuid.isEmpty()) {
566+
logger.error("Volume UUID or name not found in details for pool: {}, cannot resize", storagePool.getName());
567+
throw new CloudRuntimeException("Volume UUID or name not found in details, cannot resize ONTAP FlexVolume");
568+
}
554569

570+
Volume volume = new Volume();
571+
volume.setUuid(volumeUuid);
572+
volume.setName(details.get(OntapStorageConstants.VOLUME_NAME));
573+
volume.setSize(newCapacityBytes);
574+
try {
575+
storageStrategy.updateStorageVolume(volume);
576+
logger.info("Successfully resized ONTAP FlexVolume '{}' (UUID: {}) for pool '{}' from {} bytes to {} bytes",
577+
volume.getName(), volume.getUuid(), storagePool.getName(), currentCapacityBytes, newCapacityBytes);
578+
} catch (Exception e) {
579+
logger.error("Exception while resizing FlexVolume for pool: {}. Error: {}", storagePool.getName(), e.getMessage(), e);
580+
throw new CloudRuntimeException("Failed to resize ONTAP FlexVolume for pool: " + storagePool.getName() + ". " + e.getMessage(), e);
581+
}
555582
}
556583

557584
@Override

plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/StorageStrategy.java

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,25 @@ public Volume createStorageVolume(String volumeName, Long size) {
384384
* @return the updated Volume object
385385
*/
386386
public Volume updateStorageVolume(Volume volume) {
387-
return null;
387+
logger.info("Resizing ONTAP FlexVolume '{}' (UUID: {}) to {} bytes", volume.getName(), volume.getUuid(), volume.getSize());
388+
String authHeader = OntapStorageUtils.generateAuthHeader(storage.getUsername(), storage.getPassword());
389+
try {
390+
Volume resizeRequest = new Volume();
391+
resizeRequest.setSize(volume.getSize());
392+
JobResponse jobResponse = volumeFeignClient.updateVolume(authHeader, volume.getUuid(), resizeRequest);
393+
pollJobIfPresent(jobResponse, "resize FlexVolume [" + volume.getUuid() + "]",
394+
OntapStorageConstants.ONTAP_VOLUME_JOB_MAX_RETRIES, OntapStorageConstants.ONTAP_VOLUME_JOB_POLL_INTERVAL_MS);
395+
logger.info("FlexVolume '{}' (UUID: {}) resized successfully to {} bytes", volume.getName(), volume.getUuid(), volume.getSize());
396+
} catch (FeignException e) {
397+
if (OntapStorageUtils.isOntapObjectNotFoundError(e)) {
398+
String msg = String.format("Cannot resize FlexVolume '%s' (UUID: %s): volume not found on ONTAP (404). ", volume.getName(), volume.getUuid());
399+
logger.error(msg);
400+
throw new CloudRuntimeException(msg, e);
401+
}
402+
logger.error("Exception while resizing FlexVolume '{}' (UUID: {}): {}", volume.getName(), volume.getUuid(), e.getMessage(), e);
403+
throw new CloudRuntimeException("Failed to resize ONTAP FlexVolume: " + e.getMessage(), e);
404+
}
405+
return volume;
388406
}
389407

390408
/**

plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/UnifiedNASStrategy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ private void assignExportPolicyToVolume(String volumeUuid, String policyName) {
391391
volumeUpdate.setNas(nas);
392392

393393
try {
394-
JobResponse jobResponse = volumeFeignClient.updateVolumeRebalancing(authHeader, volumeUuid, volumeUpdate);
394+
JobResponse jobResponse = volumeFeignClient.updateVolume(authHeader, volumeUuid, volumeUpdate);
395395
if (jobResponse == null || jobResponse.getJob() == null) {
396396
throw new CloudRuntimeException("Failed to attach policy " + policyName + "to volume " + volumeUuid);
397397
}

plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/utils/OntapStorageConstants.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ public class OntapStorageConstants {
127127
public static final int ONTAP_SFSR_JOB_POLL_INTERVAL_MS = 2000;
128128
public static final int ONTAP_SNAPSHOT_DELETE_JOB_MAX_RETRIES = 30;
129129
public static final int ONTAP_SNAPSHOT_DELETE_JOB_POLL_INTERVAL_MS = 2000;
130+
/** Retry settings for FlexVolume create/resize/delete job polling. */
131+
public static final int ONTAP_VOLUME_JOB_MAX_RETRIES = 10;
132+
public static final int ONTAP_VOLUME_JOB_POLL_INTERVAL_MS = 1000;
130133
public static final int ONTAP_FLEXVOL_JOB_POLL_INTERVAL_MS = 2000;
131134
public static final int ONTAP_FLEXVOL_RESOLVE_MAX_RETRIES = 30;
132135

plugins/storage/volume/ontap/src/test/java/org/apache/cloudstack/storage/lifecycle/OntapPrimaryDatastoreLifecycleTest.java

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,15 @@
5757
import static org.mockito.Mockito.verify;
5858
import static org.mockito.Mockito.times;
5959
import static org.mockito.Mockito.withSettings;
60+
import static org.mockito.Mockito.mock;
61+
import static org.mockito.Mockito.never;
6062
import static org.mockito.ArgumentMatchers.contains;
6163
import static org.junit.jupiter.api.Assertions.assertThrows;
6264
import static org.junit.jupiter.api.Assertions.assertTrue;
6365
import static org.junit.jupiter.api.Assertions.assertFalse;
6466
import java.util.HashMap;
67+
import com.cloud.storage.StoragePool;
68+
import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreLifeCycle;
6569
import org.apache.cloudstack.storage.provider.StorageProviderFactory;
6670
import org.apache.cloudstack.storage.service.StorageStrategy;
6771
import org.apache.cloudstack.storage.volume.datastore.PrimaryDataStoreHelper;
@@ -1121,4 +1125,104 @@ public void testAttachZone_kvmHypervisorSetsAndUpdatesPool() throws Exception {
11211125
}
11221126
}
11231127

1128+
// ========== updateStoragePool() Tests ==========
1129+
1130+
@Test
1131+
public void testUpdateStoragePool_positive_resizesFlexVolume() {
1132+
// Setup
1133+
StoragePool storagePool = mock(StoragePool.class);
1134+
when(storagePool.getName()).thenReturn("test-pool");
1135+
when(storagePool.getCapacityBytes()).thenReturn(2147483648L); // 2 GB current
1136+
1137+
Map<String, String> details = new HashMap<>();
1138+
details.put(PrimaryDataStoreLifeCycle.CAPACITY_BYTES, String.valueOf(5368709120L)); // 5 GB new
1139+
details.put(OntapStorageConstants.VOLUME_UUID, "flex-vol-uuid-123");
1140+
details.put(OntapStorageConstants.VOLUME_NAME, "flexvol-name");
1141+
details.put("protocol", "NFS3");
1142+
1143+
Volume updatedVolume = new Volume();
1144+
updatedVolume.setUuid("flex-vol-uuid-123");
1145+
updatedVolume.setSize(5368709120L);
1146+
when(storageStrategy.updateStorageVolume(any(Volume.class))).thenReturn(updatedVolume);
1147+
1148+
try (MockedStatic<OntapStorageUtils> utilityMock = Mockito.mockStatic(OntapStorageUtils.class)) {
1149+
utilityMock.when(() -> OntapStorageUtils.getStrategyByStoragePoolDetails(any()))
1150+
.thenReturn(storageStrategy);
1151+
1152+
// Execute
1153+
ontapPrimaryDatastoreLifecycle.updateStoragePool(storagePool, details);
1154+
1155+
// Verify
1156+
verify(storageStrategy, times(1)).updateStorageVolume(any(Volume.class));
1157+
}
1158+
}
1159+
1160+
@Test
1161+
public void testUpdateStoragePool_noCapacityBytesInDetails_skipsResize() {
1162+
// Setup
1163+
StoragePool storagePool = mock(StoragePool.class);
1164+
when(storagePool.getName()).thenReturn("test-pool");
1165+
1166+
Map<String, String> details = new HashMap<>();
1167+
details.put(OntapStorageConstants.VOLUME_UUID, "flex-vol-uuid-123");
1168+
details.put("protocol", "NFS3");
1169+
// No CAPACITY_BYTES key — resize should be skipped
1170+
1171+
// Execute
1172+
ontapPrimaryDatastoreLifecycle.updateStoragePool(storagePool, details);
1173+
1174+
// Verify — storageStrategy should never be called
1175+
verify(storageStrategy, never()).updateStorageVolume(any());
1176+
}
1177+
1178+
@Test
1179+
public void testUpdateStoragePool_missingVolumeUuid_throwsCloudRuntimeException() {
1180+
// Setup
1181+
StoragePool storagePool = mock(StoragePool.class);
1182+
when(storagePool.getName()).thenReturn("test-pool");
1183+
when(storagePool.getCapacityBytes()).thenReturn(1073741824L);
1184+
1185+
Map<String, String> details = new HashMap<>();
1186+
details.put(PrimaryDataStoreLifeCycle.CAPACITY_BYTES, String.valueOf(3221225472L));
1187+
details.put("protocol", "NFS3");
1188+
// No VOLUME_UUID — cannot resize without it
1189+
1190+
try (MockedStatic<OntapStorageUtils> utilityMock = Mockito.mockStatic(OntapStorageUtils.class)) {
1191+
utilityMock.when(() -> OntapStorageUtils.getStrategyByStoragePoolDetails(any()))
1192+
.thenReturn(storageStrategy);
1193+
1194+
// Execute & Verify
1195+
assertThrows(CloudRuntimeException.class,
1196+
() -> ontapPrimaryDatastoreLifecycle.updateStoragePool(storagePool, details));
1197+
verify(storageStrategy, never()).updateStorageVolume(any());
1198+
}
1199+
}
1200+
1201+
@Test
1202+
public void testUpdateStoragePool_updateStorageVolumeThrows_propagatesCloudRuntimeException() {
1203+
// Setup
1204+
StoragePool storagePool = mock(StoragePool.class);
1205+
when(storagePool.getName()).thenReturn("test-pool");
1206+
when(storagePool.getCapacityBytes()).thenReturn(1073741824L);
1207+
1208+
Map<String, String> details = new HashMap<>();
1209+
details.put(PrimaryDataStoreLifeCycle.CAPACITY_BYTES, String.valueOf(3221225472L));
1210+
details.put(OntapStorageConstants.VOLUME_UUID, "flex-vol-uuid-err");
1211+
details.put(OntapStorageConstants.VOLUME_NAME, "flexvol-err");
1212+
details.put("protocol", "NFS3");
1213+
1214+
when(storageStrategy.updateStorageVolume(any(Volume.class)))
1215+
.thenThrow(new CloudRuntimeException("ONTAP resize failed"));
1216+
1217+
try (MockedStatic<OntapStorageUtils> utilityMock = Mockito.mockStatic(OntapStorageUtils.class)) {
1218+
utilityMock.when(() -> OntapStorageUtils.getStrategyByStoragePoolDetails(any()))
1219+
.thenReturn(storageStrategy);
1220+
1221+
// Execute & Verify
1222+
assertThrows(CloudRuntimeException.class,
1223+
() -> ontapPrimaryDatastoreLifecycle.updateStoragePool(storagePool, details));
1224+
verify(storageStrategy, times(1)).updateStorageVolume(any(Volume.class));
1225+
}
1226+
}
1227+
11241228
}

plugins/storage/volume/ontap/src/test/java/org/apache/cloudstack/storage/service/StorageStrategyTest.java

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,4 +1259,105 @@ void testDeleteFlexVolSnapshotForCloudStackVolume_Feign404_TreatedAsSuccess() {
12591259
verify(snapshotFeignClient).deleteSnapshot(anyString(), eq("fv-uuid-1"), eq("snap-uuid-1"));
12601260
verify(jobFeignClient, never()).getJobByUUID(anyString(), anyString());
12611261
}
1262+
1263+
// ========== updateStorageVolume() Tests ==========
1264+
1265+
@Test
1266+
public void testUpdateStorageVolume_positive() {
1267+
// Setup
1268+
Volume volume = new Volume();
1269+
volume.setUuid("vol-uuid-resize");
1270+
volume.setName("flexvol-resize");
1271+
volume.setSize(5368709120L); // 5 GB
1272+
1273+
Job job = new Job();
1274+
job.setUuid("resize-job-uuid");
1275+
JobResponse jobResponse = new JobResponse();
1276+
jobResponse.setJob(job);
1277+
1278+
when(volumeFeignClient.updateVolume(anyString(), eq("vol-uuid-resize"), any()))
1279+
.thenReturn(jobResponse);
1280+
1281+
Job completedJob = new Job();
1282+
completedJob.setUuid("resize-job-uuid");
1283+
completedJob.setState(OntapStorageConstants.JOB_SUCCESS);
1284+
when(jobFeignClient.getJobByUUID(anyString(), eq("resize-job-uuid")))
1285+
.thenReturn(completedJob);
1286+
1287+
// Execute
1288+
Volume result = storageStrategy.updateStorageVolume(volume);
1289+
1290+
// Verify
1291+
assertNotNull(result);
1292+
assertEquals(5368709120L, result.getSize());
1293+
verify(volumeFeignClient, times(1)).updateVolume(anyString(), eq("vol-uuid-resize"), any());
1294+
verify(jobFeignClient, atLeastOnce()).getJobByUUID(anyString(), eq("resize-job-uuid"));
1295+
}
1296+
1297+
@Test
1298+
public void testUpdateStorageVolume_jobFailed() {
1299+
// Setup
1300+
Volume volume = new Volume();
1301+
volume.setUuid("vol-uuid-resize");
1302+
volume.setName("flexvol-resize");
1303+
volume.setSize(5368709120L);
1304+
1305+
Job job = new Job();
1306+
job.setUuid("resize-job-uuid");
1307+
JobResponse jobResponse = new JobResponse();
1308+
jobResponse.setJob(job);
1309+
1310+
when(volumeFeignClient.updateVolume(anyString(), eq("vol-uuid-resize"), any()))
1311+
.thenReturn(jobResponse);
1312+
1313+
Job failedJob = new Job();
1314+
failedJob.setUuid("resize-job-uuid");
1315+
failedJob.setState(OntapStorageConstants.JOB_FAILURE);
1316+
failedJob.setMessage("Resize failed");
1317+
when(jobFeignClient.getJobByUUID(anyString(), eq("resize-job-uuid")))
1318+
.thenReturn(failedJob);
1319+
1320+
// Execute & Verify
1321+
Exception ex = assertThrows(CloudRuntimeException.class,
1322+
() -> storageStrategy.updateStorageVolume(volume));
1323+
assertTrue(ex.getMessage().contains("Job failed"));
1324+
}
1325+
1326+
@Test
1327+
public void testUpdateStorageVolume_feignException() {
1328+
// Setup
1329+
Volume volume = new Volume();
1330+
volume.setUuid("vol-uuid-fail");
1331+
volume.setName("flexvol-fail");
1332+
volume.setSize(3221225472L);
1333+
1334+
FeignException feignException = mock(FeignException.class);
1335+
when(feignException.status()).thenReturn(500);
1336+
when(volumeFeignClient.updateVolume(anyString(), eq("vol-uuid-fail"), any()))
1337+
.thenThrow(feignException);
1338+
1339+
// Execute & Verify
1340+
Exception ex = assertThrows(CloudRuntimeException.class,
1341+
() -> storageStrategy.updateStorageVolume(volume));
1342+
assertTrue(ex.getMessage().contains("Failed to resize ONTAP FlexVolume"));
1343+
}
1344+
1345+
@Test
1346+
public void testUpdateStorageVolume_notFound_404_throwsCloudRuntimeException() {
1347+
// Setup
1348+
Volume volume = new Volume();
1349+
volume.setUuid("vol-uuid-notfound");
1350+
volume.setName("flexvol-notfound");
1351+
volume.setSize(1073741824L);
1352+
1353+
FeignException feignEx = mock(FeignException.class);
1354+
when(feignEx.status()).thenReturn(404);
1355+
when(volumeFeignClient.updateVolume(anyString(), eq("vol-uuid-notfound"), any()))
1356+
.thenThrow(feignEx);
1357+
1358+
// Execute & Verify — 404 means volume not found on ONTAP, should throw
1359+
CloudRuntimeException ex = assertThrows(CloudRuntimeException.class,
1360+
() -> storageStrategy.updateStorageVolume(volume));
1361+
assertTrue(ex.getMessage().contains("not found on ONTAP"));
1362+
}
12621363
}

plugins/storage/volume/ontap/src/test/java/org/apache/cloudstack/storage/service/UnifiedNASStrategyTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ public void testCreateAccessGroup_Success() throws Exception {
296296
when(accessGroup.getHostsToConnect()).thenReturn(hosts);
297297
doNothing().when(nasFeignClient).createExportPolicy(anyString(), any(ExportPolicy.class));
298298
when(nasFeignClient.getExportPolicyResponse(anyString(), anyMap())).thenReturn(policyResponse);
299-
when(volumeFeignClient.updateVolumeRebalancing(anyString(), anyString(), any())).thenReturn(jobResponse);
299+
when(volumeFeignClient.updateVolume(anyString(), anyString(), any())).thenReturn(jobResponse);
300300
when(jobFeignClient.getJobByUUID(anyString(), anyString())).thenReturn(job);
301301
doNothing().when(storagePoolDetailsDao).addDetail(anyLong(), anyString(), anyString(), eq(true));
302302

@@ -307,7 +307,7 @@ public void testCreateAccessGroup_Success() throws Exception {
307307
assertNotNull(result);
308308
verify(nasFeignClient).createExportPolicy(anyString(), any(ExportPolicy.class));
309309
verify(nasFeignClient).getExportPolicyResponse(anyString(), anyMap());
310-
verify(volumeFeignClient).updateVolumeRebalancing(anyString(), eq("vol-uuid-123"), any());
310+
verify(volumeFeignClient).updateVolume(anyString(), eq("vol-uuid-123"), any());
311311
verify(storagePoolDetailsDao, times(2)).addDetail(anyLong(), anyString(), anyString(), eq(true));
312312
}
313313

@@ -402,7 +402,7 @@ public void testCreateAccessGroup_JobFailure() throws Exception {
402402
when(accessGroup.getHostsToConnect()).thenReturn(hosts);
403403
doNothing().when(nasFeignClient).createExportPolicy(anyString(), any(ExportPolicy.class));
404404
when(nasFeignClient.getExportPolicyResponse(anyString(), anyMap())).thenReturn(policyResponse);
405-
when(volumeFeignClient.updateVolumeRebalancing(anyString(), anyString(), any())).thenReturn(jobResponse);
405+
when(volumeFeignClient.updateVolume(anyString(), anyString(), any())).thenReturn(jobResponse);
406406
when(jobFeignClient.getJobByUUID(anyString(), anyString())).thenReturn(job);
407407

408408
assertThrows(CloudRuntimeException.class, () -> {
@@ -446,7 +446,7 @@ public void testCreateAccessGroup_HostWithPrivateIP() throws Exception {
446446
when(accessGroup.getHostsToConnect()).thenReturn(hosts);
447447
doNothing().when(nasFeignClient).createExportPolicy(anyString(), any(ExportPolicy.class));
448448
when(nasFeignClient.getExportPolicyResponse(anyString(), anyMap())).thenReturn(policyResponse);
449-
when(volumeFeignClient.updateVolumeRebalancing(anyString(), anyString(), any())).thenReturn(jobResponse);
449+
when(volumeFeignClient.updateVolume(anyString(), anyString(), any())).thenReturn(jobResponse);
450450
when(jobFeignClient.getJobByUUID(anyString(), anyString())).thenReturn(job);
451451
doNothing().when(storagePoolDetailsDao).addDetail(anyLong(), anyString(), anyString(), eq(true));
452452

0 commit comments

Comments
 (0)