New Question
0

Windows 2012R2 inject password / reset password

asked 2015-09-28 14:51:32 +0300

DavidB gravatar image

Hi everyone,

I've played a lot with your cloudbase init product, thanks for this. But I m facing an issue, from the moment I set Administrator on cloudbase-init, on our cloud the cloudbase-init is working well but 3min after the session is opened; the Administrator user password get auto-reseted by cloudbase-init.

We may be doing something bad as when the instance first boot asks for a new password even without asking the old password which should be the one from the metadata.

Can you help me finding a solution on how to correctely set cloudbase-init to fit my purpose ?

Will be much appreciated.

Best regards,

David.

edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted
0

answered 2015-09-29 13:57:16 +0300

ader1990 gravatar image

Hello,

Firstly, if you used the cloudbase-init installer with the sysprep part, the password for the Administrator password is being reset. If you have set Administrator as the default username, its password will be randomly generated by cloudbase-init or taken from the metadata service.

Secondly, there is a delay between the boot process finish and the actual plugin execution, which leads to the behavior you are getting, as the cloudbase-init process takes some time to retrieve the metadata providers. In a cloud scenario, the user does not have access to the vm's console, thus will be unable to connect to that vm until cloudbase-init finishes the createuser and setuserpassword plugins. For example, if you are using OpenStack with http metadata service, the user can retrieve the password using "nova get-password" and use the default username to connect to that Windows vm.

Thanks.

edit flag offensive delete link more

Comments

Thanks a lot ;) I was doing it wrong since the begining and the help provided saved me ;) http://qwikfix.co.uk/swiftcover-contact-number/

mariakatosvich gravatar imagemariakatosvich ( 2016-09-12 13:04:40 +0300 )edit

Here is another way to reset login password on windows server: http://www.uukeys.com/reset-domain-password-on-windows-server.html

lionspurs gravatar imagelionspurs ( 2016-10-26 13:39:49 +0300 )edit
0

answered 2015-09-29 14:18:40 +0300

DavidB gravatar image

updated 2015-09-29 14:19:42 +0300

If you have set Administrator as the default username, its password will be randomly generated by cloudbase-init or taken from the metadata service.

The problem here is that the password is never taken from the metadata. This is why after 2min cloudbaseinit reset it for the user Administrator, but this is not what we want to.

Thank you for the delay explanation; we are using http metadata, my powershell script is executing well but after it ends, cloudbaseinit reset the admin password. I would like to make my inject password through metadata working, can you help ?

Here are 3 examples of the configurations I tried ;) ; each times I get the admin password reset at the end of the cloudinit exec, I would like to ensure metadata password injection is working and activating rdp too for example.

http://pastebin.com/XzugysSi

If you could help or share your working examples it would be really appreciated. Also I would like to set network differently than this: (by uising cloudbase init network module, can you show me how ? ) :

ps1_sysnative

Set-Content -Path "C:\TESTINIT.txt" -Value "Welcome to an OpenStack Windows instance" Import-Module NetAdapter \$winnetadapter2 = Get-NetAdapter -Name 'Ethernet 2' \$winnetadapter2 | Set-NetIPInterface -DHCP Disabled \$winnetadapter2 | New-NetIPAddress -AddressFamily IPv4 -IPAddress $publicNetworkFreeIpLocked -PrefixLength 24 -DefaultGateway X.X.X.X \$winnetadapter2 | Set-DnsClientServerAddress -ServerAddresses 8.8.8.8 route delete 0.0.0.0 10.0.0.1 Set-Content -Path "C:\TESTEND.txt" -Value "Init scripts done"

edit flag offensive delete link more

Comments

When you spawn an instance, to set a specific password, you need to use: "nova boot <other options=""> --meta admin_pass=myStrongPassw0rd". If you are already using this, can you provide the cloudbase-init logs on a pastebin, for further debugging?

ader1990 gravatar imageader1990 ( 2015-09-29 15:10:44 +0300 )edit

Thanks a lot guys, you were right ;) I was doing it wrong since the begining and the help provided saved me ;) (I was giving admin_pass in the user_data not in a meta argument, again thanks. Now final question, how to set correctly networking in the instance using cloudbase network plugin ?

DavidB gravatar imageDavidB ( 2015-10-05 20:56:13 +0300 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2015-09-28 14:51:32 +0300

Seen: 5,070 times

Last updated: Sep 29 '15