Hello,
I am trying to change the password of my vm using rest API call :
<GuestCustomizationSection href="https://xxx/api/vApp/vm-20dad588-96b4-4479-8ddb-91f1cb55df27/guestCustomizationSection/" type="application/vnd.vmware.vcloud.guestCustomizationSection+xml" xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" xmlns="http://www.vmware.com/vcloud/v1.5">
<ovf:Info>Specifies Guest OS Customization Settings</ovf:Info>
<Enabled>true</Enabled>
<JoinDomainEnabled>false</JoinDomainEnabled>
<UseOrgSettings>false</UseOrgSettings>
<AdminPasswordEnabled>true</AdminPasswordEnabled>
<AdminPasswordAuto>false</AdminPasswordAuto>
<AdminPassword>***********</AdminPassword>
<ResetPasswordRequired>true</ResetPasswordRequired>
<CustomizationScript>
@ECHO OFF
</CustomizationScript>
<ComputerName>myvm</ComputerName>
<Link rel="edit" type="application/vnd.vmware.vcloud.guestCustomizationSection+xml" href="https://xxxx/api/vApp/vm-20dad588-96b4-4479-8ddb-91f1cb55df27/guestCustomizationSection/"/>
</GuestCustomizationSection>
And then I power on the vm using : https://xxxxxxx/api/vApp/vm-20dad588-96b4-4479-8ddb-91f1cb55df27/power/action/powerOn
VM parameter are correctly set on vCloud Director, vm is powered on, but Guest OS Customization is not happening.
Is there a way to "power on and force guest os customization" using rest API like in vCD UI ? Or do I need to do it differently?
Thanks for your help !
Hello Marc,
Here is more explanation on what is happening and why you have this behavior :
You may also have the following usecase : you have an already deployed VM and you want to initiate the equivalent of the function “PowerON and Force Recustomization” that is available on the GUI. In order to this on the API, please follow these steps :
This will Recustomize the VM.
After VM's guest customization has beed done you can just send empty POST request to /vApp/{id}/action/customizeAtNextPowerOn. This feature has worked since vCD version 5.6 as documentation says.
Thanks for helping.
Yes I have seen that in the documentation, but my cloud provider is using vCD 5.5
1. Are you sure you have a correct version of VMware tools installed inside the VM?
2. Have you tried powering off/on the whole vApp to see if it forces re-customization?
VMware tools are installed inside the VM but i don't know if it the last version. If I perform the steps directly in vCloud Director UI and power on vm using "power on and force recustomization", it works correctly.
I will try to restart the vapp to see what happens.
Hello Marc,
Here is more explanation on what is happening and why you have this behavior :
You may also have the following usecase : you have an already deployed VM and you want to initiate the equivalent of the function “PowerON and Force Recustomization” that is available on the GUI. In order to this on the API, please follow these steps :
This will Recustomize the VM.
Thank you, it seems to be fixed now !