Skip to content

Commit 1619e76

Browse files
piyush5netappSrivastava, Piyush
andauthored
bugfix/CSTACKEX-235: Updated job timing to be uniform across ONTAP (#93)
### Description This PR... <!--- Describe your changes in DETAIL - And how has behaviour functionally changed. --> <!-- 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) - [ ] New feature (non-breaking change which adds functionality) - [x] 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 - [ ] Minor #### Bug Severity - [ ] BLOCKER - [ ] Critical - [ ] Major - [ ] Minor - [ ] Trivial ### Screenshots (if appropriate): ### How Has This Been Tested? <!-- 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 --> --------- Co-authored-by: Srivastava, Piyush <Piyush.Srivastava@netapp.com>
1 parent 65cb855 commit 1619e76

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ public Volume createStorageVolume(String volumeName, Long size) {
316316
}
317317
String jobUUID = jobResponse.getJob().getUuid();
318318

319-
Boolean jobSucceeded = jobPollForSuccess(jobUUID,10, 1000);
319+
Boolean jobSucceeded = jobPollForSuccess(jobUUID,OntapStorageConstants.ONTAP_FLEXVOL_RESOLVE_MAX_RETRIES, OntapStorageConstants.ONTAP_FLEXVOL_JOB_POLL_INTERVAL_MS);
320320
if (!jobSucceeded) {
321321
logger.error("Volume creation job failed for volume: " + volumeName);
322322
throw new CloudRuntimeException("Volume creation job failed for volume: " + volumeName);
@@ -399,7 +399,7 @@ public void deleteStorageVolume(Volume volume) {
399399
String authHeader = OntapStorageUtils.generateAuthHeader(storage.getUsername(), storage.getPassword());
400400
try {
401401
JobResponse jobResponse = volumeFeignClient.deleteVolume(authHeader, volume.getUuid());
402-
Boolean jobSucceeded = jobPollForSuccess(jobResponse.getJob().getUuid(), 10, 1000);
402+
Boolean jobSucceeded = jobPollForSuccess(jobResponse.getJob().getUuid(), OntapStorageConstants.ONTAP_FLEXVOL_RESOLVE_MAX_RETRIES, OntapStorageConstants.ONTAP_FLEXVOL_JOB_POLL_INTERVAL_MS);
403403
if (!jobSucceeded) {
404404
logger.error("Volume deletion job failed for volume: " + volume.getName());
405405
throw new CloudRuntimeException("Volume deletion job failed for volume: " + volume.getName());

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ 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+
public static final int ONTAP_FLEXVOL_JOB_POLL_INTERVAL_MS = 2000;
131+
public static final int ONTAP_FLEXVOL_RESOLVE_MAX_RETRIES = 30;
130132

131133
/** vm_snapshot_details key for ONTAP FlexVolume-level VM snapshots. */
132134
public static final String ONTAP_FLEXVOL_SNAPSHOT = "ontapFlexVolSnapshot";

0 commit comments

Comments
 (0)