GitHub user wilderrodrigues opened a pull request: https://github.com/apache/cloudstack/pull/559
CLOUDSTACK-8607 - As an Operator I want to be able to change the host password on the host itself via the updateHostPassword API The changes in this PR will cover the following: - Make sure the new password replaces the old one in the queue - Updated the patch files for XenServer - Updated the script path on LibvirtComputing class - Adding update_host_passwd to VRScripts - Add implementation to CitrixUpdateHostPasswordCommandWrapper - Improve testUpdateHostPasswordCommand() unit test on CitrixRequestWrapperTest - Adding update_host_passwd.sh script - Adding the host IP address as an instance variable on UpdateHostPasswordCommand - Improving the Unit Test (LibvirtComputingResourceTest) to get it covering the new code - Make sure doUpdateHostPassword() doesn't get called if flag is set to false - Do not update XenServer hosts if the cluster ID is not informed Test Environment: XenServer cluster: 2 hosts 1 KVM host Management Server running on CentOS 7.1 Shared Storage Cloudmonkey :: Update Single Xen Host :: update hostpassword hostid=ce516ca6-9294-46c8-995c-406672aecf3f username=root password=admin update_passwd_on_host=true Result: Error 431: Single host update is not supported by XenServer hypervisors. Please try again informing the Cluster ID. :: Update Xen Cluster :: update hostpassword clusterid=479cd3f1-2f94-4ae9-b1bb-08be1da1b460 username=root update_passwd_on_host=true password=admin Result: success = true Successfully SSH into both hosts with new password :: Update Single KVM Host :: update hostpassword hostid=5683cf21-6cb0-4ed0-8498-f77411e89e9a username=root update_passwd_on_host=true password=admin Result: success = true Successfully SSH into KVM host with new password I also reverted the passwords of the hosts to the original, all worked fine. The "update_passwd_on_host" parameter is not required and is defaulted to "false", which means if operators want to proceed as before, updating only the database and the hosts manually that will be fine. In case we face problems with the DB update, nothing will change - not even the hosts. In case we are updating a host and it fails due to connection problem, for example, the DB changes will not be rolled back. That's not okay, but I want to fix the consistence in a separate issue, since it would be out of scope for our sprint - which finished next week. @remibergsma: could you have a look at that before you go on holidays? :) @DaanHoogland, @karuturi and @bhaisaab, your comments are also appreciated Thanks in advance. Cheers, Wilder You can merge this pull request into a Git repository by running: $ git pull https://github.com/schubergphilis/cloudstack improvement/CLOUDSTACK-8607 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cloudstack/pull/559.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #559 ---- commit a74971df06e04ee2df993a9876bb274d58c9662d Author: wilderrodrigues <wrodrig...@schubergphilis.com> Date: 2015-07-02T09:12:08Z CLOUDSTACK-8607 - Adding shouldUpdateHost flag - Make sure doUpdateHostPassword() doesn't get called if flag is set to false - Do not update XenServer hosts if the cluster ID is not informed commit 47c7a1083fc4be9e74cb3fd73fce069c5e85c1cc Author: wilderrodrigues <wrodrig...@schubergphilis.com> Date: 2015-07-02T12:54:51Z CLOUDSTACK-8607 - Adding update_host_passwd.sh script - Modifying the LibvirtUpdateHostPasswordCommandWrapper in order to execute the script on the host - Adding the script path to LibvirtComputingResource - Adding the host IP address as an instance variable on UpdateHostPasswordCommand - Improving the Unit Test (LibvirtComputingResourceTest) to get it covering the new code commit 0dd02ce04341b8026f49fd84be01bfcb7f18bf3d Author: wilderrodrigues <wrodrig...@schubergphilis.com> Date: 2015-07-03T08:24:44Z CLOUDSTACK-8607 - Adding support to update host passwd on XenServer hypervisors - Adding update_host_passwd to VRScripts - Add accessor method to host password on CitrixResourceBase - Add implementation to CitrixUpdateHostPasswordCommandWrapper - Improve testUpdateHostPasswordCommand() unit test on CitrixRequestWrapperTest - Add line to patch files on xenserver directory Concerning the LibVirt change: - I forgot to assing the return of the getDefaultHypervisorScriptsDir() method to the hypervisorScriptsDir variable commit 6c92ccf8d1ef5b824d6e36ea727bbebf05a95001 Author: wilderrodrigues <wrodrig...@schubergphilis.com> Date: 2015-07-03T09:43:56Z CLOUDSTACK-8607 - Refactoring attribute name - Refactoring attribute name from shouldUpdateHost to updatePasswdOnHost - Fixing ApiConstants class because it had an error in the constant name commit efa34361df72e351cdc1f719a5dba705eab771ef Author: wilderrodrigues <wrodrig...@schubergphilis.com> Date: 2015-07-03T12:29:57Z CLOUDSTACK-8607 - Changed update script to return exit code based on the result - Changed location of the update_host_passwd script - Updated the patch files for XenServer - Updated the script path on LibvirtComputing class - Removed the hostIP from the LibvirtUpdateHostPasswordCommandWrapper execute() method commit 86297e70be8cd587ab07ba3109042ea782772624 Author: wilderrodrigues <wrodrig...@schubergphilis.com> Date: 2015-07-04T09:33:52Z CLOUDSTACK-8607 - Make sure the new password replaces the old one in the queue - Added log info to show details of the operation - Renamed the addPwdToQueue to replaceOldPasswdInQueue ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---