fmaximus commented on a change in pull request #2743: CLOUDSTACK-10380: Fix
startvm giving another pw after pw reset
URL: https://github.com/apache/cloudstack/pull/2743#discussion_r206073665
##########
File path: server/src/com/cloud/network/element/VirtualRouterElement.java
##########
@@ -703,7 +703,14 @@ public boolean savePassword(final Network network, final
NicProfile nic, final V
// save the password in DB
for (final VirtualRouter router : routers) {
if (router.getState() == State.Running) {
- return networkTopology.savePasswordToRouter(network, nic,
uservm, router);
+ final boolean result =
networkTopology.savePasswordToRouter(network, nic, uservm, router);
+ if (result) {
+ // Explicit password reset, while VM hasn't generated a
password yet.
+ final UserVmVO userVmVO = _userVmDao.findById(vm.getId());
+ userVmVO.setUpdateParameters(false);
Review comment:
Context: Basically `updateParameters` means that a new password needs to be
generated when the VM starts.
This is set to `true` when resetPassword is called, while there is no VR
running.
Also the default is `true` for a new VM. When the template was not password
enabled during VM creation,
this stays `true`. So if `resetPassword` is executed after making the
template password enabled, and VR is running,
we set if to `false`, as we successfully did a password reset, thus no
password reset needs to happen during start VM.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services