You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, for Ubuntu I cannot get it to work. Step 5 is not possible on Ubuntu so tried update-rc.d cloud-set-guest-password defaults
Even after trying the Change Password from Cloudstack UI, the password does not change and my old password which I used while creating template still works.
These steps worked fine for CentOS, but not working for Ubuntu
STEPS TO REPRODUCE
Create a Ubuntu Template
Follow the cloud-set-guest-password steps - https://docs.cloudstack.apache.org/en/latest/adminguide/templates/_password.html
Create a new VM from this template, - New password that pops up does not work
Chnage password does not work from Cloudstack UI
@kiranchavala Yes - the password enabled is selected.
Also tried the config you provided, but still not working
@weizhouapache - I tried running the cloud-set-guest-password manually, and it produces errors -- and then it hangs - never gives the shell back (have to Ctrl+C)
@kiranchavala Yes - the password enabled is selected. Also tried the config you provided, but still not working
@weizhouapache - I tried running the cloud-set-guest-password manually, and it produces errors -- and then it hangs - never gives the shell back (have to Ctrl+C)
if the password has been changed when you run the script manually - it means the script works.
if so, you can create a systemd service for the script and auto-start it on startup.
For Step 4,5,6 and 7 - Setup Cloud-init Integration ONLY. Do not follow the "Adding Password Management to Your Templates" or "Implementing a SSH-Key bash script".
I believe I was having issues earlier because I had followed both - "Adding Password Management" and "Cloud-Init Integration". And somehow those were conflicting.
NOTE 2 - If you are adding Password Management, one of the step is to add the "Specify the managed user" during Cloud Init Setup and create the /etc/cloud/cloud.cfg.d/80_user.cfg. In this step, I had to modify the below line. Reason was that in the instance when I tried to do sudo command, I always kept getting error about the ". Changing to the new line fixes this for me (only tested in Ubuntu 22.04 Server LTS.)
Original sudo: [\"ALL=(ALL) ALL\"] # User permissions
New sudo: [ALL=(ALL) ALL] # User permissions
Activity
nxsbi commentedon Mar 9, 2024
PS - I have also followed the steps in this link
https://docs.cloudstack.apache.org/en/latest/adminguide/templates/_cloud_init.html#linux-with-cloud-init
Created the files
It still does not work.
kiranchavala commentedon Mar 11, 2024
@nxsbi
Have you enabled the password option on the template
kiranchavala commentedon Mar 11, 2024
@nxsbi
could you please try with the following configuration
cat /etc/cloud/cloud.cfg
weizhouapache commentedon Mar 11, 2024
@nxsbi
if you run the script
cloud-set-guest-passwordmanually inside the VM, is the password changed ?nxsbi commentedon Mar 11, 2024
@kiranchavala Yes - the password enabled is selected.
Also tried the config you provided, but still not working
@weizhouapache - I tried running the cloud-set-guest-password manually, and it produces errors -- and then it hangs - never gives the shell back (have to Ctrl+C)
weizhouapache commentedon Mar 11, 2024
@nxsbi
try this script
https://raw.githubusercontent.com/apache/cloudstack/main/setup/bindir/cloud-set-guest-sshkey-password-userdata-configdrive.in
nxsbi commentedon Mar 11, 2024
@weizhouapache Thanks - I ran the script below is the output. Also tried resetting the password from UI after that but did not work.
weizhouapache commentedon Mar 11, 2024
@nxsbi
the output of the command looks ok to me.
if you change the password of a non-root user, you need to change the
usernamein the script.nxsbi commentedon Mar 12, 2024
Yes already did that - the username was changes to correct one. I have that working on my CentOS and Rocky Linux scripts so familair with that.
I am walking through all steps -- Questions:
https://docs.cloudstack.apache.org/en/latest/adminguide/templates/_password.html#adding-password-management-to-templates
weizhouapache commentedon Mar 12, 2024
@nxsbi
the doc is out of date
if the password has been changed when you run the script manually - it means the script works.
if so, you can create a systemd service for the script and auto-start it on startup.
nxsbi commentedon Mar 12, 2024
@weizhouapache If I run the script manually, it gives an error. Where does it log the output?
nxsbi commentedon Mar 12, 2024
I believe I found the problem and the solution. Documenting below for others for future reference.
Since my prior experience creating template revolved around CentOS/Rocky, I followed the steps shown in https://docs.cloudstack.apache.org/en/latest/adminguide/templates/_password.html (I had this URL saved from before)
However, I determined that was not the right place for Ubuntu...
Correct steps:
I believe I was having issues earlier because I had followed both - "Adding Password Management" and "Cloud-Init Integration". And somehow those were conflicting.
NOTE 2 - If you are adding Password Management, one of the step is to add the "Specify the managed user" during Cloud Init Setup and create the /etc/cloud/cloud.cfg.d/80_user.cfg. In this step, I had to modify the below line. Reason was that in the instance when I tried to do sudo command, I always kept getting error about the ". Changing to the new line fixes this for me (only tested in Ubuntu 22.04 Server LTS.)
Original
sudo: [\"ALL=(ALL) ALL\"] # User permissionsNew
sudo: [ALL=(ALL) ALL] # User permissions