weizhouapache commented on PR #10061: URL: https://github.com/apache/cloudstack/pull/10061#issuecomment-2528536490
> > @phsm have you tested the scenario below ? > > ``` > > * create vm with password in config drive > > > > * when vm is started, it gets the userdata from config drive ISO and change the password > > > > * reset the root password again inside the vm > > > > * reboot the vm (not stop/start), will the vm password be reset to the password in config drive ISO ? > > ``` > > Hi Wei, > > I tested what you've asked and a bit more on the top of it. > > Test 1: change the password, and rebooting the VM > > 1. change the password from within the Virtual Machine. > 2. reboot the virtual machine. > 3. The new password works. So it was not reverted back > > Test 2: Stop and start the VM after the test 1 > > 1. After the password was changed in the test 1, stop the virtual machine. > 2. Start the virtual machine. > 3. Try logging in using the new password that was manually set in the Test 1. It worked. > > Test 3: Change password from Cloudstack UI/API > > 1. Reset the password for the VM from Cloudstack. > 2. Try to login using the new password. Does not work. Therefore, the password reset does not happen. > 3. Try to login using the password that was manually set in the test 1. Works. > > A bit more details about the Test 3: The configdrive ISO was actually updated with the new password. However, the default behavior for the `set_password` cloud-init module is that it only runs once per instance, i.e. only during the first boot. I tried changing the frequency for the cloud-init `set_password` module to always, but cloud-init just uses the password cached deep in the /var/lib/cloud directory. Conclusion: not working password reset is not Cloudstack's fault, but cloud-init's. thanks @phsm for the testing Test1 and Test2 look fine. For Test3, yes, it is a cloud-init issue. You can try with `cloud-init clean --machine-id -s`, stop the VM, reset password and then start the VM. -- 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. To unsubscribe, e-mail: commits-unsubscr...@cloudstack.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org