CSTACKEX-261: enabling cloudstack volume resize (GROW) for iscsi and nfs - #100
sathvikaragi wants to merge 10 commits into
Conversation
🔴 Test Coverage Grade:
|
| Metric | Value |
|---|---|
| Line coverage | 24.71% |
| Branch coverage | 18.85% |
Grade Scale
| Grade | Line Coverage | Meaning |
|---|---|---|
| 🟢 A | ≥ 80% | Excellent - this code sleeps well at night 😴 |
| 🟡 B | 60-79% | Good - almost there, don't stop now 😉 |
| 🟠 C | 40-59% | Acceptable - your code is wearing a seatbelt, but no airbags 😬 |
| 🔴 D | 20-39% | Marginal - boldly shipping where no test has gone before 🖖 |
| ⛔ F | < 20% | Failing - tests? what tests? 🔥 |
Branch coverage is shown as a secondary signal. Grade is determined by line coverage.
View full Actions run
🔴 Test Coverage Grade:
|
| Metric | Value |
|---|---|
| Line coverage | 24.75% |
| Branch coverage | 18.89% |
Grade Scale
| Grade | Line Coverage | Meaning |
|---|---|---|
| 🟢 A | ≥ 80% | Excellent - this code sleeps well at night 😴 |
| 🟡 B | 60-79% | Good - almost there, don't stop now 😉 |
| 🟠 C | 40-59% | Acceptable - your code is wearing a seatbelt, but no airbags 😬 |
| 🔴 D | 20-39% | Marginal - boldly shipping where no test has gone before 🖖 |
| ⛔ F | < 20% | Failing - tests? what tests? 🔥 |
Branch coverage is shown as a secondary signal. Grade is determined by line coverage.
View full Actions run
🔴 Test Coverage Grade:
|
| Metric | Value |
|---|---|
| Line coverage | 24.76% |
| Branch coverage | 18.89% |
Grade Scale
| Grade | Line Coverage | Meaning |
|---|---|---|
| 🟢 A | ≥ 80% | Excellent - this code sleeps well at night 😴 |
| 🟡 B | 60-79% | Good - almost there, don't stop now 😉 |
| 🟠 C | 40-59% | Acceptable - your code is wearing a seatbelt, but no airbags 😬 |
| 🔴 D | 20-39% | Marginal - boldly shipping where no test has gone before 🖖 |
| ⛔ F | < 20% | Failing - tests? what tests? 🔥 |
Branch coverage is shown as a secondary signal. Grade is determined by line coverage.
View full Actions run
🔴 Test Coverage Grade:
|
| Metric | Value |
|---|---|
| Line coverage | 24.77% |
| Branch coverage | 18.90% |
Grade Scale
| Grade | Line Coverage | Meaning |
|---|---|---|
| 🟢 A | ≥ 80% | Excellent - this code sleeps well at night 😴 |
| 🟡 B | 60-79% | Good - almost there, don't stop now 😉 |
| 🟠 C | 40-59% | Acceptable - your code is wearing a seatbelt, but no airbags 😬 |
| 🔴 D | 20-39% | Marginal - boldly shipping where no test has gone before 🖖 |
| ⛔ F | < 20% | Failing - tests? what tests? 🔥 |
Branch coverage is shown as a secondary signal. Grade is determined by line coverage.
View full Actions run
|
|
||
| logger.debug("getUsedBytes: FlexVolume [{}] backing pool [{}] reports {} bytes used", | ||
| flexVolUuid, storagePool.getId(), flexVol.getSpace().getUsed()); | ||
| return flexVol.getSpace().getUsed(); |
There was a problem hiding this comment.
check the return type of getUsed and have the validation
There was a problem hiding this comment.
@JsonInclude(NON_NULL) only excludes null fields when sending JSON. if used is omitted or null during deserialization, primitive long defaults to 0.
| // Resolve LUN UUID from volume details when not pre-populated on the cloudstackVolume | ||
| if (cloudstackVolume.getLun() == null || cloudstackVolume.getLun().getUuid() == null) { | ||
| long volumeId = cloudstackVolume.getVolumeInfo().getId(); | ||
| VolumeDetailVO lunUuidDetail = volumeDetailsDao.findDetail(volumeId, OntapStorageConstants.LUN_DOT_UUID); |
There was a problem hiding this comment.
check findDetails by key is present or not,
if yes then replace this method call
There was a problem hiding this comment.
Here we are fetching the details by the key LUN UUID only
🔴 Test Coverage Grade:
|
| Metric | Value |
|---|---|
| Line coverage | 24.76% |
| Branch coverage | 18.90% |
Grade Scale
| Grade | Line Coverage | Meaning |
|---|---|---|
| 🟢 A | ≥ 80% | Excellent - this code sleeps well at night 😴 |
| 🟡 B | 60-79% | Good - almost there, don't stop now 😉 |
| 🟠 C | 40-59% | Acceptable - your code is wearing a seatbelt, but no airbags 😬 |
| 🔴 D | 20-39% | Marginal - boldly shipping where no test has gone before 🖖 |
| ⛔ F | < 20% | Failing - tests? what tests? 🔥 |
Branch coverage is shown as a secondary signal. Grade is determined by line coverage.
View full Actions run
🔴 Test Coverage Grade:
|
| Metric | Value |
|---|---|
| Line coverage | 24.76% |
| Branch coverage | 18.90% |
Grade Scale
| Grade | Line Coverage | Meaning |
|---|---|---|
| 🟢 A | ≥ 80% | Excellent - this code sleeps well at night 😴 |
| 🟡 B | 60-79% | Good - almost there, don't stop now 😉 |
| 🟠 C | 40-59% | Acceptable - your code is wearing a seatbelt, but no airbags 😬 |
| 🔴 D | 20-39% | Marginal - boldly shipping where no test has gone before 🖖 |
| ⛔ F | < 20% | Failing - tests? what tests? 🔥 |
Branch coverage is shown as a secondary signal. Grade is determined by line coverage.
View full Actions run
Description
Cloudstack volume resize supports grow for both NFS and Iscsi which on ontap leads to increase in size for a LUN in case of iscsi and file in case of NFS.Also consists of UT's for the changes and implementation for getusedbytes which is called in this flow to check if storagepool has enough space.
This PR...
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
Before resizing volumes:

Growing iscsi csvolume to 10GiB:

Lun on Ontap is grown to 10GiB:

Growing Nfs volume to 10GiB:

virtual size of file on host side grown to 10GiB:

maxsize by default is 1024 GiB in cloudstack for volume which is configurable if size greater than that throws an error:

considering the overprovisiong factor, used space and current space, cloud stack calculates and propagates error in case value is over that: here get used bytes gets triggered:

ISCSI CS-volume resize and get usedbytes here is triggered.
NFS CS-volume resize and get usedbytes here is triggered.

when Lun is deleted on ontap and cs volume is tried to resize , error is thrown:

when file is deleted on ONtap and resize is performed on volume:

when shrink is performed on Iscsi volume with shrinkOk as true:

when shrink is performed on NFS volume :

How did you try to break this feature and the system with this change?