Hi, Updates to cloud-init have made the old way of using the bash script obsolete in CentOS 7 and other distros. To get it working all you need to do is replace "set-password" line, i.e.: sed -i s/"set-passwords"/"[set-passwords, always]"/g /etc/cloud/cloud.cfg
Check my template here http://dl.openvm.eu/cloudstack/config/centos/centos7-kvm.cfg Swen , you should update your templates as well. -- Sent from the Delta quadrant using Borg technology! Nux! www.nux.ro ----- Original Message ----- > From: "Fariborz Navidan" <mdvlinqu...@gmail.com> > To: "users" <users@cloudstack.apache.org> > Sent: Thursday, 18 April, 2019 17:09:13 > Subject: Re: cloud-init password reset issue > Hello, > > I tried this but unfortunately it does not work. I cleared > /var/log/messages and shut teh VM down and started it just after requesting > new password fromcloudstack. It did not set new password for root and in > messages log it shows "VM has already saved password". To work around, I > have also removed set-passwords module from cloud-init and repeated steps > but still no chance. To note that I have already set $user=root in the > script > > Please advise > > Thanks > > > On Wed, Apr 17, 2019 at 12:20 PM Swen - swen.io <m...@swen.io> wrote: > >> Hi Fariborz, >> >> take a look at this: >> >> https://gitlab.proio.com/s.brueseke/megonacloudtemplates/blob/master/CentOS/centos7.cfg >> at line 235. >> As far as I remember there is an issue with cloud-init password reset >> within cloudstack so we solved it with this script and using cloud-init per >> boot option. >> >> cu Swen >> >> >> >> -----Ursprüngliche Nachricht----- >> Von: Fariborz Navidan <mdvlinqu...@gmail.com> >> Gesendet: Dienstag, 16. April 2019 21:55 >> An: users@cloudstack.apache.org >> Betreff: cloud-init password reset issue >> >> Hi, >> >> I have created a CentOS 7 template with cloud-init installed. It works for >> the first time boot. But if I shutdown the VM and request password reset in >> CloudStack UI, it gives me a password but on the next boot it does not set >> the new password. However if I issue "cloud-init clean " command before >> shutdown and then request password reset, it works. >> >> Do you know anyway to force cloud-init to check for existence of new >> password on every boot? >> >> Best Regards >> >>