"admin_password" parameter in config disk's meta_data.json is ignored
I would like to set up root's password at deployment time.
Looking at the code of nova zvm connector, they pass it via admin_pass in the metadata file of the config disk. So I tried to do the same:
{
"uuid": "NAME",
+ "admin_pass": "ADMIN_PASS",
"public_keys": {
"Public Key": "PUBLIC_KEY"
},
(...)
I'd like to contribute a fix to this problem, but there's something I do not understand. When I call the "Deploy Guest" API call, it uploads the "transport file" and then sends it to the VM's punch. Then it's used by cloud-init inside the Linux guest. But I could not find the code that manages this option.
@SeanHQF do you know the details in this area?
It's a known issue:
https://github.com/canonical/cloud-init/issues/2402
There are hacks out there to work around it:
http://madorn.com/cloud-init-admin-pass.html
So it was never going to work.
Actions
- If you'd like me to remove this (unrelated) dead code, just ask me:
def get_change_passwd_command(self, admin_password):
"""construct change password command
:admin_password: the password to be changed to
"""
return "echo 'root:%s' | chpasswd" % admin_password
(in zvmsdk/dist.py), plus the testing code in zvmsdk/tests/fvt/test_guest.py:
f.write('{"admin_pass": "sMcTNh8b65dM",\
-
Also, feel free to remove that option from the zvm nova driver.
-
Feel free to close this issue.