Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"admin_password" parameter in config disk's meta_data.json is ignored #819

Open
Bischoff opened this issue May 16, 2024 · 2 comments
Open

Comments

@Bischoff
Copy link
Contributor

Bischoff commented May 16, 2024

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.

@bjhuangr
Copy link
Contributor

@SeanHQF do you know the details in this area?

@Bischoff
Copy link
Contributor Author

Bischoff commented May 17, 2024

It's a known issue:

canonical/cloud-init#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

  1. 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",\
  1. Also, feel free to remove that option from the zvm nova driver.

  2. Feel free to close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants