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/06/22 20:02:20 UTC

[GitHub] [cloudstack] GabrielBrascher opened a new pull request #4165: Allow renaming cluster, host, and storage

GabrielBrascher opened a new pull request #4165:
URL: https://github.com/apache/cloudstack/pull/4165


   ## Description
   <!--- Describe your changes in detail -->
   
   This PR adds implementation for changing host and storage name, additionally, it fixes a Bug on cluster updateCluster API command. This PRs also enhances the UI by allowing editing field name on Host and Storage pool. Due to the fact that there is no support to editing cluster via UI, it was not edited.
   
   TODO:  I will address Host,  Cluster, and Storage Pool name edition on CloudStack Primate once the API implementation gets merged.
   
   **Details:** 
   Prior to this PR the following API commands did not offer support for updating name:
   - [updateHost](https://cloudstack.apache.org/api/apidocs-4.14/apis/updateHost.html) **(enhancement)**
   - [updateStoragePool](https://cloudstack.apache.org/api/apidocs-4.14/apis/updateStoragePool.html)  **(enhancement)**
   
   Additionally, [updateCluster](https://cloudstack.apache.org/api/apidocs-4.14/apis/updateCluster.html) claims to support changing a cluster name (via `clustername` parameter); however, such operation did not work.  **(bug)**
   
   
   <!-- 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)
   - [X] 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)
   
   ## 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. -->
   - Via API,  change host, cluster, and storage pool names.
   - Via UI, change host and storage pool names.
   
   <!-- 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] blueorangutan commented on pull request #4165: Allow renaming cluster, host, and storage

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


   Packaging result: ✖centos7 ✔debian. JID-1605


----------------------------------------------------------------
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 #4165: Allow renaming cluster, host, and storage

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


   @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] GabrielBrascher commented on a change in pull request #4165: Allow renaming cluster, host, and storage

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



##########
File path: server/src/main/java/com/cloud/resource/ResourceManagerImpl.java
##########
@@ -1026,12 +1027,26 @@ public void doInTransactionWithoutResult(final TransactionStatus status) {
 
     @Override
     @DB
-    public Cluster updateCluster(final Cluster clusterToUpdate, final String clusterType, final String hypervisor, final String allocationState, final String managedstate) {
+    public Cluster updateCluster(UpdateClusterCmd cmd) {
+        ClusterVO cluster = (ClusterVO) getCluster(cmd.getId());
+        String clusterType = cmd.getClusterType();
+        String hypervisor = cmd.getHypervisor();
+        String allocationState = cmd.getAllocationState();
+        String managedstate = cmd.getManagedstate();
+        String name = cmd.getClusterName();
 
-        final ClusterVO cluster = (ClusterVO)clusterToUpdate;
         // Verify cluster information and update the cluster if needed
         boolean doUpdate = false;
 
+        if (org.apache.commons.lang.StringUtils.isNotBlank(name)) {
+            if(cluster.getHypervisorType() == HypervisorType.VMware) {

Review comment:
       @rhtyd considering your concerns with issues caused by renaming VMware clusters I added this line.




----------------------------------------------------------------
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 #4165: Allow renaming cluster, host, and storage

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


   @rhtyd 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] blueorangutan commented on pull request #4165: Allow renaming cluster, host, and storage

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


   Packaging result: ✔centos7 ✔debian. JID-1528


----------------------------------------------------------------
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] GabrielBrascher commented on a change in pull request #4165: Allow renaming cluster, host, and storage

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



##########
File path: server/src/main/java/com/cloud/resource/RollingMaintenanceManagerImpl.java
##########
@@ -114,12 +115,15 @@ public boolean configure(String name, Map<String, Object> params) throws Configu
         return true;
     }
 
-    private void updateCluster(long clusterId, String state) {
+    private void updateCluster(long clusterId, String allocationState) {

Review comment:
       @nvazquez can you please take a look at it?
   
   I changed API parameter handling from separate parameters on the method call to an object of UpdateClusterCmd class. Therefore, I needed to change this tiny piece of RollingMaintenanceManagerImpl.




----------------------------------------------------------------
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 #4165: Allow renaming cluster, host, and storage

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


   @rhtyd 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] rhtyd commented on pull request #4165: Allow renaming cluster, host, and storage

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


   Renaming of cluster on VMware could cause a problem if the cluster on VCenter is not mapped; on XenServer I'm not sure if there'll be any side-effects. On KVM LGTM


----------------------------------------------------------------
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] wido commented on pull request #4165: Allow renaming cluster, host, and storage

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


   Looks good to me based on the code


----------------------------------------------------------------
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 #4165: Allow renaming cluster, host, and storage

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


   @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 #4165: Allow renaming cluster, host, and storage

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


   @rhtyd 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] rhtyd commented on pull request #4165: Allow renaming cluster, host, and storage

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


   @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] GabrielBrascher commented on a change in pull request #4165: Allow renaming cluster, host, and storage

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



##########
File path: server/src/main/java/com/cloud/resource/ResourceManagerImpl.java
##########
@@ -1026,12 +1027,26 @@ public void doInTransactionWithoutResult(final TransactionStatus status) {
 
     @Override
     @DB
-    public Cluster updateCluster(final Cluster clusterToUpdate, final String clusterType, final String hypervisor, final String allocationState, final String managedstate) {
+    public Cluster updateCluster(UpdateClusterCmd cmd) {
+        ClusterVO cluster = (ClusterVO) getCluster(cmd.getId());
+        String clusterType = cmd.getClusterType();
+        String hypervisor = cmd.getHypervisor();
+        String allocationState = cmd.getAllocationState();
+        String managedstate = cmd.getManagedstate();
+        String name = cmd.getClusterName();
 
-        final ClusterVO cluster = (ClusterVO)clusterToUpdate;
         // Verify cluster information and update the cluster if needed
         boolean doUpdate = false;
 
+        if (org.apache.commons.lang.StringUtils.isNotBlank(name)) {
+            if(cluster.getHypervisorType() == HypervisorType.VMware) {

Review comment:
       @rhtyd considering your conserns with issues caused by renaming VMware clusters I added this line.




----------------------------------------------------------------
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 merged pull request #4165: Allow renaming cluster, host, and storage

Posted by GitBox <gi...@apache.org>.
rhtyd merged pull request #4165:
URL: https://github.com/apache/cloudstack/pull/4165


   


----------------------------------------------------------------
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 #4165: Allow renaming cluster, host, and storage

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


   @blueorangutan test


----------------------------------------------------------------
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 #4165: Allow renaming cluster, host, and storage

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


   @rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests


----------------------------------------------------------------
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] GabrielBrascher commented on pull request #4165: Allow renaming cluster, host, and storage

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


   @rhtyd thanks for the feedback, I will prevent cluster renaming on VMware then (maybe on Xenserver as well).


----------------------------------------------------------------
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 #4165: Allow renaming cluster, host, and storage

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


   Packaging result: ✔centos7 ✔debian. JID-1607


----------------------------------------------------------------
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] GabrielBrascher commented on pull request #4165: Allow renaming cluster, host, and storage

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


   @nvazquez thanks for the review!
   
   I think that I already did the necessary changes in the method `updateCluster` at `RollingMaintenanceManagerImpl`. Please let me know if I am missing something.


----------------------------------------------------------------
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 #4165: Allow renaming cluster, host, and storage

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


   <b>Trillian test result (tid-2205)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 66215 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4165-t2205-kvm-centos7.zip
   Intermittent failure detected: /marvin/tests/smoke/test_kubernetes_clusters.py
   Intermittent failure detected: /marvin/tests/smoke/test_vm_life_cycle.py
   Smoke tests completed. 81 look OK, 2 have error(s)
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_05_deploy_and_upgrade_kubernetes_ha_cluster | `Failure` | 2121.32 | test_kubernetes_clusters.py
   ContextSuite context=Test01DeployVM>:setup | `Error` | 0.00 | test_vm_life_cycle.py
   ContextSuite context=Test02VMLifeCycle>:setup | `Error` | 0.00 | test_vm_life_cycle.py
   ContextSuite context=Test03SecuredVmMigration>:setup | `Error` | 0.00 | test_vm_life_cycle.py
   


----------------------------------------------------------------
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] nvazquez commented on a change in pull request #4165: Allow renaming cluster, host, and storage

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



##########
File path: server/src/main/java/com/cloud/resource/RollingMaintenanceManagerImpl.java
##########
@@ -114,12 +115,15 @@ public boolean configure(String name, Map<String, Object> params) throws Configu
         return true;
     }
 
-    private void updateCluster(long clusterId, String state) {
+    private void updateCluster(long clusterId, String allocationState) {

Review comment:
       Thanks @GabrielBrascher, looks good to me. The change needed in RollingMaintenanceManagerImpl will be just the same as you've done below




----------------------------------------------------------------
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