VMware {code} Community
chenze
Contributor
Contributor

admin password is not set automatically when launching vapp with composeVApp api

The AdminPasswordAuto is not working properly in vCloud 5.1 when launching vapp from a vapp temlate via compose api.

vcloud.txt is the shell script i am using to compose a vapp from a vapp template. vcloud.xml is the xml payload. Put vcloud.txt and vcloud.xml in the same dir and run the vcloud.txt will reproduce this issue.

And as you see in the vcloud-result.png, the admin password for the vm inside this launched vapp is not being set.

It is only the api is not working properly. If i compose the vapp from the vcloud web console, it is working well.


And the same request and payload is working for vCloud 1.5. So is there a change from vCloud 1.5 to vCloud 5.1? or is this a bug?

I read this: http://pubs.vmware.com/vcd-51/topic/com.vmware.ICbase/PDF/vcd_51_api_guide.pdf , but still i cannot figure out whats the problem.

Also we tried this with two unrelated vCloud 5.1 providers. This issue can be reproduced on both of them.

Tags (2)
0 Kudos
8 Replies
listaction
Contributor
Contributor

I'm also having the same issue - as the op - why is it not setting the password - when it does so correctly when using the vcloud UI is beyond me.

can someone please confirm if this is a bug or if there is something that is new in 5.1 that is missing?

0 Kudos
IamTHEvilONE
Immortal
Immortal

You doing this during composevApp, or are you attempting to reconfigure a vApp?

if so, try providing all parameters even if not needed.

<Enabled>true</Enabled>
<ChangeSid>false</ChangeSid>
<VirtualMachineId>?</VirtualMachineId>
<JoinDomainEnabled>false</JoinDomainEnabled>
<UseOrgSettings>false</UseOrgSettings>
<DomainName />
<DomainUserName />
<DomainUserPassword />
<AdminPasswordEnabled>true</AdminPasswordEnabled>
<AdminPasswordAuto>true</AdminPasswordAuto>
<AdminPassword />
<ResetPasswordRequired>false</ResetPasswordRequired>
<CustomizationScript />
<ComputerName>CentOS55NoGUIba</ComputerName>

just make sure to update the ? with the appropraite VM machine ID.

the alternative is to compose the vApp, then set the customization parameters separately once the VM has been created.  I'd be interested to know if doing the steps separately work, vs combined in the composevApp.

0 Kudos
chenze
Contributor
Contributor

As the attached vcloud.txt and vcloud.xml show, I was doing composevApp.

As the attached vcloud-result.png shows, I am not able to configure the vm(neither api nor web console) after I composed the vApp via the api.

Also I tried "all parameters", "some parameters" and "no parameters" and many possible combinations i could try.

It has been 25 days since I posted this problem, I am wondering has VMware been able to reproduce this problem with my script attached? Or did anyone from VMware even look at my script attached?

Thanks

0 Kudos
Todor_Todorov
Hot Shot
Hot Shot

Hi,

It looks like this is a defect in the vCD API that will be fixed in the next release. The current workaround is to modify the GuestCustomizationSection of the VM after the composeVApp operation is finished.

From your screenshot, it looks like your vApp/VM is started/deployed, that's why you cannot change the Guest OS Customization settings.

You can try the following:

1) pass 'false' to the 'powerOn' and 'deploy' attributes in <ComposeVAppParams>

2) once the Compose vApp operation succeeds, change the Guest OS Customization settings of the VM

3) power on the vApp/VM

Regards,

Todor Todorov

0 Kudos
chenze
Contributor
Contributor

I know I have to power off the vm to modify the guest os customization settings. I did try that.

I also tried what you suggest - setting powerOn as false whe requesting compose api.

I tried all these possible things before posting the problem and script here.

Can we just go to the deep part? Looks like we keep talking about the manual things. Come on I even posted the test script and data to reproduce this issue, it cannot be more detailed. So someone just try and confirm it is a bug in vCD API?

0 Kudos
Todor_Todorov
Hot Shot
Hot Shot

I already confirmed that there's a bug in the ComposeVApp operation - the passed settings in the GuestCustomizationSection are not taken into account. However, the workaround that I posted (powering off the VM and changing the GuestCustomizationSettings with another API call) is working.

Regards,

Todor Todorov

0 Kudos
chenze
Contributor
Contributor

Thanks Todor, that works.

The point was when composing, the deploy has to be false. And then make the http put request to GuestCustomizationSection and then deploy.

Setting deploy=true when composing and powering off later and then setting GuestCustomizationSection will not work.

0 Kudos
Todor_Todorov
Hot Shot
Hot Shot

Hi,

If a vApp was already deployed and then you need to make changes in the GuestCustomizationSection, you can set "forceCustomization = true" when deploying the vApp again. This will ensure that the guest customization process happens again.

Regards,

Todor Todorv

0 Kudos