Repository navigation
Feature/cstackex 265: Netapp ONTAP iscsi provisioning using lun serial number instead of logical unit number - #114
piyush5netapp wants to merge 7 commits into
Conversation
🔴 Test Coverage Grade:
|
| Metric | Value |
|---|---|
| Line coverage | 24.74% |
| Branch coverage | 18.86% |
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
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
| OntapStorageConstants.SVM_DOT_NAME, svmName, | ||
| OntapStorageConstants.IGROUP_DOT_NAME, accessGroupName | ||
| ); | ||
| String lunNumber = getLogicalAccess(getMap); |
There was a problem hiding this comment.
Do change this code according to fetch the WWID instead.
| * | ||
| * @return the serial number, or null if the LUN no longer exists on the array | ||
| */ | ||
| public String getLunSerialNumber(String svmName, String lunName) { |
There was a problem hiding this comment.
This method might not be needed, as earlier LUN was fetched in ensureLunMapped, so the same implementation would be present there. Just change the query param accordingly.
| /** | ||
| * NetApp's IEEE OUI, which prefixes the NAA identifier of every ONTAP LUN. | ||
| * | ||
| * <p>A LUN's WWID is this followed by the hex of its 12-character serial number, giving the |
There was a problem hiding this comment.
Try to restrict the explanation to 1-2 lines highlighting the structure of the path
| } | ||
|
|
||
| @Override | ||
| public boolean zoneWideVolumesAvailableWithoutClusterMotion(){ |
There was a problem hiding this comment.
Maybe its better to raise a separate PR for this, as we would be cherry-picking the commits for upstream
| * | ||
| * So {@code OntapPrimaryDatastoreDriver} writes volume paths as {@code /<targetIQN>/<lunWwid>} and | ||
| * this adaptor reports devices as {@code /dev/disk/by-id/scsi-3<lunWwid>}. The WWID is derived from | ||
| * the LUN's own inquiry data (VPD page 0x83), so it is identical on every host and the domain XML |
There was a problem hiding this comment.
Most of this comment may not be necessary for future, so, consider pruning this to explain the adaptor in brief, instead.
| * udev's scsi_id builtin prepends the NAA designator type to the WWID, so a LUN whose WWID is | ||
| * {@code 600a0980...} is published as {@code scsi-3600a0980...}. | ||
| */ | ||
| private static final String BY_ID_SCSI_PREFIX = "/dev/disk/by-id/scsi-3"; |
There was a problem hiding this comment.
For future reference, add a comment here or in our spec that /dev/disk/by-id/scsi-3 is set here as ONTAP uses NAA and 600a098... is the NetApp OUI vendor prefix 00:a0:98
| return null; | ||
| } | ||
|
|
||
| private boolean createIscsiNode(String host, int port, String iqn, String volumePath) { |
There was a problem hiding this comment.
Add null checks for all the variables
| KVMStoragePool destPool, int timeout, byte[] passphrase) { | ||
| throw new UnsupportedOperationException("Creating a disk from a template is not yet supported for this configuration."); | ||
| private void waitForDeviceToDisappear(String devicePath) { | ||
| for (int attempt = 0; attempt < DEVICE_WAIT_TRIES && getDeviceSize(devicePath) > 0; attempt++) { |
There was a problem hiding this comment.
Is there any reason for 15s wait period for devices to respond everywhere in this file? Or was this pulled in from iSCSIAdmAdaptor?
| import org.apache.commons.lang3.StringUtils; | ||
| import org.apache.logging.log4j.Logger; | ||
| import org.apache.logging.log4j.LogManager; | ||
| import org.apache.logging.log4j.Logger; |
There was a problem hiding this comment.
could u run this command
udevadm info -q symlink -n /dev/sdb
will this show both forms in that output (Id and path )?
|
|
||
| @Override | ||
| public boolean connectPhysicalDisk(String volumeUuid, KVMStoragePool pool, Map<String, String> details, boolean isVMMigrate) { | ||
| public boolean connectPhysicalDisk(String volumePath, KVMStoragePool pool, Map<String, String> details, boolean isVMMigrate) { |
There was a problem hiding this comment.
please check this method: IscsiStorageCleanupMonitor, this used by-path param and if not exact match then iSCSI cleanup thread will log out live ONTAP sessions
|
|
||
| // ex. sudo iscsiadm -m node -T iqn.2012-03.com.test:volume1 -p 192.168.233.10:3260 -o new | ||
| Script iScsiAdmCmd = new Script(true, "iscsiadm", 0, logger); | ||
| if (!createIscsiNode(host, port, iqn, volumePath)) { |
There was a problem hiding this comment.
Perform this test also, when 2 VMs are running and if u stop 1 VM what happens?
does this logout the whole session ?
|
|
||
| import java.io.File; | ||
| import java.io.FileWriter; | ||
| import java.io.IOException; |
|
|
||
| physicalDisk.setSize(deviceSize); | ||
| physicalDisk.setVirtualSize(deviceSize); | ||
| if (!logoutAndForgetTarget(host, port, iqn, lunWwid)) { |
There was a problem hiding this comment.
If the session cannot be identified, do not log out. Remove only this SCSI device, or fail the disconnect so it can be retried. Logout should run only after the session is known and no other LUNs remain on it.
Description
This PR...
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?