Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

When use add-vm with SUSE SLES15, "auto generate password" always have been set #404

Open
gm12367 opened this issue Apr 4, 2019 · 1 comment

Comments

@gm12367
Copy link

gm12367 commented Apr 4, 2019

Dear author
We just upgrade our VCD to version9.5, because there is an bug with version9.1, cause network and VM address can not be set after VM provisioning.

But another issue still persist, the "Auto generate password" parameter always have been set after VM provisioning.

Environment:
OS: CentOS Linux release 7.6.1810 (Core)
Kernel: 3.10.0-957.5.1.el7.x86_64
vcd version: vcd-cli, VMware vCloud Director Command Line Interface, 21.1.0
pyvcloud version: 20.1.0

My execution command as below:
vcd vapp add-vm -c KaaS -t SLES15-test -o SLES15-test -n network001 -i pool SUSE-test SUSE SLES15-4.12.14-25.28-default
My template have not set that parameter, and command not include "--password-auto", but it always set. I found below code in vapp.py in module pyvcloud:

        if needs_customization:
            guest_customization_param = E.GuestCustomizationSection(
                E_OVF.Info(),
                E.Enabled(True),
            )
            if 'password' in spec:
                guest_customization_param.append(E.AdminPasswordEnabled(True))
                guest_customization_param.append(E.AdminPasswordAuto(False))
                guest_customization_param.append(
                    E.AdminPassword(spec['password']))
            else:
                if 'password_auto' in spec:
                    guest_customization_param.append(
                        E.AdminPasswordEnabled(True))
                    guest_customization_param.append(E.AdminPasswordAuto(True))
                else:
                    guest_customization_param.append(
                        E.AdminPasswordEnabled(False))

Then I set both False in the judgement, then the parameter password auto generate have not been set.

            else:
                if 'password_auto' in spec:
                    guest_customization_param.append(
                        E.AdminPasswordEnabled(False))
                    guest_customization_param.append(E.AdminPasswordAuto(False))

Usually if we don't use "--password-auto" in "vcd vapp add-vm", this parameter should not be set, so I suppose this is a bug. If I am wrong or missed anything, please correct me.

Appreciated

@matt-horwood-mayden
Copy link

I too have this issue, after looking at the code I cant work out how this happens.

Please review and fix?

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

No branches or pull requests

3 participants
@gm12367 @matt-horwood-mayden and others