| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
| //this method to get all svms and also filtered svms based on query params as a part of URL | ||
| @RequestMapping(method = RequestMethod.GET) | ||
| OntapResponse<Svm> getSvmResponse(URI baseURL, @RequestHeader("Authorization") String header); | ||
| OntapResponse<Svm> getSvms(URI baseURL, @RequestHeader("Authorization") String header); |
There was a problem hiding this comment.
we kept this naming convention for other feign client and this can return only one record also
Sorry, something went wrong.
There was a problem hiding this comment.
Reverted it back
Sorry, something went wrong.
| public static String Username; | ||
| public static String Password; | ||
| public static String ManagementLIF; | ||
| public static String Svm; |
There was a problem hiding this comment.
svm is an object which can not be string use svmName instead
Sorry, something went wrong.
There was a problem hiding this comment.
sure, will rename it
Sorry, something went wrong.
| public static String Password; | ||
| public static String ManagementLIF; | ||
| public static String Svm; | ||
| public static String Protocol; |
There was a problem hiding this comment.
Can we have type as enum with supported protocols?
Sorry, something went wrong.
There was a problem hiding this comment.
Done
Sorry, something went wrong.
| @SuppressWarnings("unchecked") | ||
| Map<String, String> details = (Map<String, String>)dsInfos.get("details"); | ||
| // Validations | ||
| if (podId != null && clusterId == null) { |
There was a problem hiding this comment.
we can combine this check into one check bcz both are required, also clusterId can be empty
Sorry, something went wrong.
There was a problem hiding this comment.
Yeah, in my previous review to this change i nanother PR, I gave comment to use trim command and then empty check. Please add them for each mandatory parameter
Sorry, something went wrong.
There was a problem hiding this comment.
Taken care of it, done
Sorry, something went wrong.
| } | ||
|
|
||
| PrimaryDataStoreParameters parameters = new PrimaryDataStoreParameters(); | ||
| if (clusterId != null) { |
There was a problem hiding this comment.
why this check is required again? it is already checked above
Sorry, something went wrong.
There was a problem hiding this comment.
Customer has an option to not send both cluster and pod ids, in case of creating a zone level primary storage pool.
Sorry, something went wrong.
| details.put(Constants.MANAGEMENTLIF, url); | ||
|
|
||
| // Validate the ONTAP details | ||
| if(details.get(Constants.ISDISAGGREGATED) == null || details.get(Constants.ISDISAGGREGATED).isEmpty()) { |
There was a problem hiding this comment.
add _ for ISDISAGGREGATED constant like IS_DISAGGREGATED
Sorry, something went wrong.
There was a problem hiding this comment.
done
Sorry, something went wrong.
| // Call the SVM API to check if the SVM exists | ||
| Svm svm = null; | ||
| URI url = URI.create(Constants.HTTPS + storage.getManagementLIF() + Constants.GETSVMs); | ||
| OntapResponse<Svm> svms = svmFeignClient.getSvms(url, authHeader); |
There was a problem hiding this comment.
add a check for svms null check object
Sorry, something went wrong.
There was a problem hiding this comment.
done
Sorry, something went wrong.
| public class Constants { | ||
| public static final String NFS = "nfs"; | ||
| public static final String ISCSI = "iscsi"; | ||
| public static final String PROTOCOL = "protocol"; |
There was a problem hiding this comment.
add _ where ever possible
Sorry, something went wrong.
There was a problem hiding this comment.
done
Sorry, something went wrong.
| // Create URI for POST CreateVolume API | ||
| URI url = utils.generateURI(Constants.CREATEVOLUME); | ||
| // Call the VolumeFeignClient to create the volume | ||
| JobResponse jobResponse = volumeFeignClient.createVolumeWithJob(url, authHeader, volumeRequest); |
There was a problem hiding this comment.
add null checks
Sorry, something went wrong.
There was a problem hiding this comment.
done, thanks
Sorry, something went wrong.
| url = utils.generateURI(Constants.GETJOBBYUUID); | ||
| int jobRetryCount = 0, maxJobRetries = Constants.JOBMAXRETRIES; | ||
| Job createVolumeJob = null; | ||
| while(createVolumeJob == null || createVolumeJob.getState().equals(Constants.JOBRUNNING) || createVolumeJob.getState().equals(Constants.JOBQUEUE) || createVolumeJob.getState().equals(Constants.JOBPAUSED)) { |
There was a problem hiding this comment.
instead of checking for all state of job, check for not success
Sorry, something went wrong.
There was a problem hiding this comment.
this seems to be lost during rebase, thanks, done
Sorry, something went wrong.
| Svm svm = null; | ||
| URI url = URI.create(Constants.HTTPS + storage.getManagementLIF() + Constants.GETSVMs); | ||
| OntapResponse<Svm> svms = svmFeignClient.getSvms(url, authHeader); | ||
| for (Svm storageVM : svms.getRecords()) { |
There was a problem hiding this comment.
Instead of getting all svm and picking based on name, better to call getSVMByName. We may need to add this method in svmFeignClient
Sorry, something went wrong.
There was a problem hiding this comment.
Yes, this approach is not optimized. fetch the SVM using name as query parameter instead fetch all then find for desired name.
Sorry, something went wrong.
There was a problem hiding this comment.
Made the necessary changes
Sorry, something went wrong.
|
|
||
| @RequestMapping(method = RequestMethod.DELETE, value="/{uuid}") | ||
| void deleteVolume(@RequestHeader("Authorization") String authHeader, @PathVariable("uuid") String uuid); | ||
| void deleteVolume(URI baseURL, @RequestHeader("Authorization") String authHeader, @PathVariable("uuid") String uuid); |
There was a problem hiding this comment.
with this change, why do we need to add url parameter at class level annotation?
Sorry, something went wrong.
There was a problem hiding this comment.
If we don't pass it explicitly, we need to set a property statically in application.properties or somewhere like that, which in our case is not feasible. Also, user might ask us to deal with multiple filers, so, the IP wouldn't be static
Sorry, something went wrong.
There was a problem hiding this comment.
I am not seeing any significant changes here, better remove this class from the PR
Sorry, something went wrong.
There was a problem hiding this comment.
This came in as part of rebase. It just has some space changes. Sure, will try to revert it
Sorry, something went wrong.
| @SuppressWarnings("unchecked") | ||
| Map<String, String> details = (Map<String, String>)dsInfos.get("details"); | ||
| // Validations | ||
| if (podId != null && clusterId == null) { |
There was a problem hiding this comment.
Yeah, in my previous review to this change i nanother PR, I gave comment to use trim command and then empty check. Please add them for each mandatory parameter
Sorry, something went wrong.
| Svm svm = null; | ||
| URI url = URI.create(Constants.HTTPS + storage.getManagementLIF() + Constants.GETSVMs); | ||
| OntapResponse<Svm> svms = svmFeignClient.getSvms(url, authHeader); | ||
| for (Svm storageVM : svms.getRecords()) { |
There was a problem hiding this comment.
Yes, this approach is not optimized. fetch the SVM using name as query parameter instead fetch all then find for desired name.
Sorry, something went wrong.
| ClusterVO clusterVO = _clusterDao.findById(clusterId); | ||
| Preconditions.checkNotNull(clusterVO, "Unable to locate the specified cluster"); | ||
| if (clusterVO.getHypervisorType() != Hypervisor.HypervisorType.KVM) { | ||
| throw new CloudRuntimeException("ONTAP primary storage is not supported for KVM hypervisor"); |
There was a problem hiding this comment.
change the message
Sorry, something went wrong.
There was a problem hiding this comment.
done
Sorry, something went wrong.
| import org.apache.cloudstack.storage.utils.Constants.ProtocolType; | ||
|
|
||
| public class OntapStorage { | ||
| public static String Username; |
There was a problem hiding this comment.
Follow naming convention for all fields
Sorry, something went wrong.
There was a problem hiding this comment.
why you added only inports in this class ?
Sorry, something went wrong.
| public class OntapStorage { | ||
| public static String _username; | ||
| public static String _password; | ||
| public static String _managementLIF; |
There was a problem hiding this comment.
Lets use camel casing for the variable name
Sorry, something went wrong.
| } | ||
| } | ||
|
|
||
| if (storagePoolName == null || storagePoolName.isEmpty()) { |
There was a problem hiding this comment.
empty check on the sting parameters must use trim method as well
Sorry, something went wrong.
| throw new CloudRuntimeException("iSCSI protocol is not enabled on SVM " + svmName); | ||
| } | ||
| List<Aggregate> aggrs = svm.getAggregates(); | ||
| if (aggrs == null || aggrs.isEmpty()) { |
There was a problem hiding this comment.
One use case to validate here is that if the passed credentials belong to the cluster, then by default, all the aggregates are mapped to the underlying SVMs. However, if credentials belong to an SVM user, then aggregates must be assigned to the SVM to access them.
@suryag1201 can you help @sandeeplocharla to close on this use case implementation.
Sorry, something went wrong.
There was a problem hiding this comment.
there are dependencies on these changes for other engineers, approving this PR for now. Ensure you are picking up the given comments in subsequent PR
Sorry, something went wrong.
# This is the 1st commit message: NFS Cloudstack volume and export policy utils # This is the commit message #2: Licencse add in files # This is the commit message #3: accessgroup create recode # This is the commit message #4: creatacessgroup for NFS impl # This is the commit message #5: storage pool mounting on host # This is the commit message #6: storage pool mounting on host 1 # This is the commit message #7: vm restart issue # This is the commit message #8: vm restart issue 1 # This is the commit message #9: vm restart issue 2 # This is the commit message #10: vm instance creation test1 # This is the commit message #11: vm instance creation test4
* CSTACKEX-7: ONTAP Primary storage pool --------- Co-authored-by: Locharla, Sandeep <Sandeep.Locharla@netapp.com>
* CSTACKEX-7: ONTAP Primary storage pool --------- Co-authored-by: Locharla, Sandeep <Sandeep.Locharla@netapp.com>
| Back | FazBrowse Home | New Git URL |
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?