Commit 5e2f3fe
committed
CSTACKEX-234: Enabling storage pool resize (grow and shrink) (#87)
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 -->
<!---
*******************************************************************************
-->
- [ ] 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)
- [x] Major
- [] Minor
- [ ] BLOCKER
- [ ] Critical
- [ ] Major
- [ ] Minor
- [ ] Trivial
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 -->
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 602d9ec commit 5e2f3fe
8 files changed
Lines changed: 441 additions & 7 deletions
File tree
- plugins/storage/volume/ontap/src
- main/java/org/apache/cloudstack/storage
- feign/client
- lifecycle
- service
- utils
- test/java/org/apache/cloudstack/storage
- lifecycle
- service
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
Lines changed: 27 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
523 | 523 | | |
524 | 524 | | |
525 | 525 | | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
526 | 541 | | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
527 | 554 | | |
528 | 555 | | |
529 | 556 | | |
| |||
Lines changed: 19 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
342 | | - | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
343 | 361 | | |
344 | 362 | | |
345 | 363 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
259 | | - | |
| 259 | + | |
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
| |||
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
109 | 125 | | |
110 | 126 | | |
111 | 127 | | |
| |||
Lines changed: 105 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
57 | 60 | | |
58 | 61 | | |
59 | 62 | | |
60 | 63 | | |
| 64 | + | |
| 65 | + | |
61 | 66 | | |
62 | 67 | | |
63 | 68 | | |
| |||
854 | 859 | | |
855 | 860 | | |
856 | 861 | | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
857 | 962 | | |
0 commit comments