You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2020/05/15 15:11:53 UTC

[GitHub] [cloudstack] Spaceman1984 opened a new pull request #4084: Added nfs minor version support on SSVM

Spaceman1984 opened a new pull request #4084:
URL: https://github.com/apache/cloudstack/pull/4084


   ## Description
   <!--- Describe your changes in detail -->
   
   This PR adds minor version support when mounting nfs on the SSVM as requested in #2861 
   
   The global setting "secstorage.nfs.version" is renamed to "secstorage.nfs.major.version" and
   the global setting "secstorage.nfs.minor.version" is added which allows nfs version 4.1 and 4.2 to be specified when the SSVM mounts secondary storage.
   
   <!-- 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: # -->
   
   ## Types of changes
   <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
   - [ ] 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)
   - [x] Enhancement (improves an existing feature and functionality)
   - [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
   
   ## Screenshots (if appropriate):
   
   ## How Has This Been Tested?
   <!-- Please describe in detail how you tested your changes. -->
   <!-- Include details of your testing environment, and the tests you ran to -->
   <!-- see how your change affects other areas of the code, etc. -->
   
   This was tested by changing the global setting values and restarting the SSVM, then verifying if the secondary storage was mounted with the specified version by logging into the SSVM and typing "mount" at the cli.
   
   Tested with SSVM running on KVM, Xenserver and VMWare hosts.
   
   <!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/master/CONTRIBUTING.md) document -->
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] rhtyd commented on pull request #4084: Added nfs minor version support on SSVM

Posted by GitBox <gi...@apache.org>.
rhtyd commented on pull request #4084:
URL: https://github.com/apache/cloudstack/pull/4084#issuecomment-648553680


   ping @Spaceman1984 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] Spaceman1984 commented on pull request #4084: Added nfs minor version support on SSVM

Posted by GitBox <gi...@apache.org>.
Spaceman1984 commented on pull request #4084:
URL: https://github.com/apache/cloudstack/pull/4084#issuecomment-650113996


   @blueorangutan package


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #4084: Added nfs minor version support on SSVM

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #4084:
URL: https://github.com/apache/cloudstack/pull/4084#issuecomment-650114519


   @Spaceman1984 a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] Spaceman1984 commented on a change in pull request #4084: Added nfs minor version support on SSVM

Posted by GitBox <gi...@apache.org>.
Spaceman1984 commented on a change in pull request #4084:
URL: https://github.com/apache/cloudstack/pull/4084#discussion_r436520983



##########
File path: engine/components-api/src/main/java/com/cloud/capacity/CapacityManager.java
##########
@@ -73,16 +73,26 @@
                     "If set to true, creates VMs as full clones on ESX hypervisor",
                     true,
                     ConfigKey.Scope.StoragePool);
-    static final ConfigKey<Integer> ImageStoreNFSVersion =
+    static final ConfigKey<Integer> ImageStoreNFSMajorVersion =

Review comment:
       @rhtyd If I was to split on `.` I would have to change the Integer data type to String, basically undoing all the changes I have made. Doing it this way preserves backward compatibility if a value has already been stored for NFS version and adding a second variable for minor version is as per the suggestion in the original issue.

##########
File path: plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java
##########
@@ -831,8 +832,12 @@ protected String mount(String path, String parent, Integer nfsVersion) {
         String result = null;
         Script command = new Script(true, "mount", _timeout, s_logger);
         command.add("-t", "nfs");
-        if (nfsVersion != null){
-            command.add("-o", "vers=" + nfsVersion);
+        if (nfsMajorVersion != null){
+            String nfsVersion = "vers=" + nfsMajorVersion;
+            if (nfsMinorVersion != null && nfsMajorVersion >= 4) {

Review comment:
       This code does exactly that, I don't understand what you would want to change.
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] rhtyd commented on a change in pull request #4084: Added nfs minor version support on SSVM

Posted by GitBox <gi...@apache.org>.
rhtyd commented on a change in pull request #4084:
URL: https://github.com/apache/cloudstack/pull/4084#discussion_r439202556



##########
File path: plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java
##########
@@ -831,8 +832,12 @@ protected String mount(String path, String parent, Integer nfsVersion) {
         String result = null;
         Script command = new Script(true, "mount", _timeout, s_logger);
         command.add("-t", "nfs");
-        if (nfsVersion != null){
-            command.add("-o", "vers=" + nfsVersion);
+        if (nfsMajorVersion != null){
+            String nfsVersion = "vers=" + nfsMajorVersion;
+            if (nfsMinorVersion != null && nfsMajorVersion >= 4) {

Review comment:
       @Spaceman1984 why not simply pass the version (a single variable) than two?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] Spaceman1984 closed pull request #4084: Added nfs minor version support on SSVM

Posted by GitBox <gi...@apache.org>.
Spaceman1984 closed pull request #4084:
URL: https://github.com/apache/cloudstack/pull/4084


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] Spaceman1984 commented on a change in pull request #4084: Added nfs minor version support on SSVM

Posted by GitBox <gi...@apache.org>.
Spaceman1984 commented on a change in pull request #4084:
URL: https://github.com/apache/cloudstack/pull/4084#discussion_r444744441



##########
File path: plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java
##########
@@ -831,8 +832,12 @@ protected String mount(String path, String parent, Integer nfsVersion) {
         String result = null;
         Script command = new Script(true, "mount", _timeout, s_logger);
         command.add("-t", "nfs");
-        if (nfsVersion != null){
-            command.add("-o", "vers=" + nfsVersion);
+        if (nfsMajorVersion != null){
+            String nfsVersion = "vers=" + nfsMajorVersion;
+            if (nfsMinorVersion != null && nfsMajorVersion >= 4) {

Review comment:
       I'll change it to 1 field




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] Spaceman1984 commented on pull request #4084: Added nfs minor version support on SSVM

Posted by GitBox <gi...@apache.org>.
Spaceman1984 commented on pull request #4084:
URL: https://github.com/apache/cloudstack/pull/4084#issuecomment-650161359


   Closing PR due to git issue


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] rhtyd commented on a change in pull request #4084: Added nfs minor version support on SSVM

Posted by GitBox <gi...@apache.org>.
rhtyd commented on a change in pull request #4084:
URL: https://github.com/apache/cloudstack/pull/4084#discussion_r434950866



##########
File path: plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java
##########
@@ -831,8 +832,12 @@ protected String mount(String path, String parent, Integer nfsVersion) {
         String result = null;
         Script command = new Script(true, "mount", _timeout, s_logger);
         command.add("-t", "nfs");
-        if (nfsVersion != null){
-            command.add("-o", "vers=" + nfsVersion);
+        if (nfsMajorVersion != null){
+            String nfsVersion = "vers=" + nfsMajorVersion;
+            if (nfsMinorVersion != null && nfsMajorVersion >= 4) {

Review comment:
       Is minor version only supported for version 4 and above? If so, why not simply parse and pass the major version when it is less than `3`?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #4084: Added nfs minor version support on SSVM

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #4084:
URL: https://github.com/apache/cloudstack/pull/4084#issuecomment-650120336


   Packaging result: ✖centos7 ✖debian. JID-1470


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] rhtyd commented on a change in pull request #4084: Added nfs minor version support on SSVM

Posted by GitBox <gi...@apache.org>.
rhtyd commented on a change in pull request #4084:
URL: https://github.com/apache/cloudstack/pull/4084#discussion_r434950551



##########
File path: engine/components-api/src/main/java/com/cloud/capacity/CapacityManager.java
##########
@@ -73,16 +73,26 @@
                     "If set to true, creates VMs as full clones on ESX hypervisor",
                     true,
                     ConfigKey.Scope.StoragePool);
-    static final ConfigKey<Integer> ImageStoreNFSVersion =
+    static final ConfigKey<Integer> ImageStoreNFSMajorVersion =

Review comment:
       @Spaceman1984 can you revert the change, why not parse for the major and minor version? Something like `x.y` could be parsed by splitting on the `.` if provided.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org