Skip to content

Conversation

@sandeeplocharla
Copy link
Collaborator

@sandeeplocharla sandeeplocharla commented Feb 6, 2026

CSTACKEX-46: Create, Delete iSCSI type Cloudstack volumes, Enter, Cancel Maintenance mode

Description

This PR has the following changes:

  1. Create iSCSI type cloudstack volume
  2. Delete iSCSI type cloudstack volume
  3. Enter and Cancel Maintenance when storagepool has CS volumes

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • 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
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

  1. https://netapp.zoom.us/rec/share/r0rh_HhXD_lZNuppLeGGMk4Y4jg8-p9DXwIB_GD2e-uEslEH5geYzchrYcBDY7PJ.WjzaTxXoGt0B8nqe?startTime=1768919430000
    Passcode: n=AE=.C9
  • Create ISCSI type Primary storage pool
  • Create Compute & Disk offering.
  • Create an instance with compute & disk offering to create both ROOT & DATA disks via ontap plugin.
  • Add additional CS Volume with ontap plugin and allocate it to the instance created.
  • Disable, Re-Enable Storage Pool (with CS Volumes)
  • Enter, Cancel Maintenance of Storage Pool (with CS Volumes)
  • Delete Instance + Expunge Volumes
  • Disable, Re-Enable Storage Pool (without CS Volumes)
  • Enter, Cancel Maintenance of Storage Pool (without CS Volumes)
  • Delete Storage Pool
  1. https://netapp.zoom.us/rec/share/Ax74XcCVkQtXglaNwNb9rTcn_1k1TvxplvaLmXTdFxjz7DeQixmiqj-uwX0QXjz0.EwnlsurMGr3jLku3?startTime=1768920957000
    Passcode: $%j3+K4B
  • Create an instance with compute & disk offering to create both ROOT & DATA disks via Default Primary & ontap plugins.
  • Add additional CS Volume with ontap plugin and allocate it to the instance created.
  • Disable, Re-Enable Storage Pool (with CS Volumes)
  • Enter, Cancel Maintenance of Storage Pool (with CS Volumes)
  • Delete Instance + Expunge Volumes
  • Disable, Re-Enable Storage Pool (without CS Volumes)
  • Enter, Cancel Maintenance of Storage Pool (without CS Volumes)
  • Delete Storage Pool

Observations:

Though we have increased retries to wait for discovery of luns, the additional volume attachment still times out, so, it needs a manual retry.
When placed into Maintenance mode, Instance is getting Stopped in the first case while it remains in Running state in the second case. We currently don't have any code attributing to this behaviour in our plugin code. Need to understand why cloudstack is behaving this way.

I've also tested force delete of storage pool when CS volumes were present, but, haven't covered it in these recordings.

Find the Code coverage reports of all the classes in plugin:
Screenshot 2026-02-10 at 5 40 00 PM
Screenshot 2026-02-10 at 5 40 34 PM
Screenshot 2026-02-10 at 5 40 56 PM
Screenshot 2026-02-10 at 5 41 40 PM

…cel Maintenance mode and changes added in the community PR

private void waitForDiskToBecomeAvailable(String volumeUuid, KVMStoragePool pool) {
int numberOfTries = 10;
int numberOfTries = 30;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have to highlight this change since this is common code and going to impact all the vendors. Can we stay with numberOfTried as 10?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10 is not at all working for us, I don't think its a option. This code was written long back and it needs to be updated. I've sent a mail to the community that I've made some changes in this file. I haven't made much changes which could probably fix this issue in a better way, as this is a common code for across vendors. We need to anticipate some discussion and suggestions around this file, when we raise this code upstream.

if (response != null && response.getRecords() != null && !response.getRecords().isEmpty()) {
// For simplicity, return the first interface's name
IpInterface ipInterface = response.getRecords().get(0);
IpInterface ipInterface = null;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@piyush5netapp this is what I was looking for. lets keep a todo here to enable load balancing of the LIFs consumption instead of going with the first one always. We need to take this up in subsequent PR for NFS workflows

throw new CloudRuntimeException("getAccessGroup: Invalid accessGroup object - accessGroup is null");
}
// @Override
// public AccessGroup getAccessGroup(AccessGroup accessGroup) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason to comment this code ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method hasn't been implemented according to the definition in StorageStrategy. Further, as this wasn't being used currently, I've commented the code, so that it could be properly fixed by reusing the logic that we already wrote.

public class Constants {

public static final String ONTAP_PLUGIN_NAME = "ONTAP";
public static final int NFS3_PORT = 2049;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets put the source of this information to keep these ports hardcoded

Copy link
Collaborator Author

@sandeeplocharla sandeeplocharla Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are standard ports, which I referenced from other vendor implementation and this confluence https://cwiki.apache.org/confluence/display/CLOUDSTACK/Ports+used+by+CloudStack
Shall I refer this confluence in the code?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add coverage you saw with the below addd unit test code?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the current code coverage status as screenshots in this PR's description.
I've included the coverage of all the classes, not just the one's that are part of this PR, for reference.

@rajiv-jain-netapp rajiv-jain-netapp self-requested a review February 10, 2026 11:56
@sandeeplocharla sandeeplocharla self-assigned this Feb 10, 2026
@sandeeplocharla sandeeplocharla merged commit b26542f into main Feb 11, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants