-
Notifications
You must be signed in to change notification settings - Fork 189
HTTP 400 Bad Request\n - cvc-complex-type.2.4.a: Invalid content was found starting with element 'CustomizationScript' when updating guest customization #635
Comments
can any one help on this? Error is very cryptic and not giving proper information as to what is wrong in the request |
If I understand correctly, updates are successful in 18.2.2 for Windows 2012 server/ Windows 2016 server/Windows 2016 server-specter/Windows 2019 server. Could you please enable pycloud logs and compare the request body between 18.2.2 and 21.0.0? |
I have a similar problem, but with EdgeGateway. I'm trying to set Rate Limits for a Gateway Interface. After some digging, I found the reason. Yet to find a workaround. vCloud Director API request parser expects a specific attribute order. pyvcloud messes this order up somehow. In my specific case, the request fails because of the attribute marked by an arrow below. Why it got there, no idea.
|
A follow up to my previous comment. |
found a hacky workaround to reorder the elements so the vCD accepts the request.
I'm sure this will bite again, the proper solution is either fix vCD deserializer to accept any order of elements. Or rewrite the pyvcloud part that uses lxml to always use the order that vCD expects. |
I found the same problem while trying to update AdminPassword field. As @artw explained the problem is that vCD expects an specific order in the fields, however that order is messed up by pyvcloud. When updating guest customization first a get request is performed, however that get request does not have AdminPasswordField (is not set) then pyvcloud just adds the field at the end of the fields obtained via get which is not the right place.
I am pretty sure that there are more problems like this in pvcloud, the problem is that pvcloud adds missing fields to the end and that might not be the expected place for vCD. |
Hi,
I'm using pyvcloud to update computer_name via guest customization for few Windows machines. But I get the following error when I try to do the same for Windows server editions like Windows 2012 server/ Windows 2016 server/Windows 2016 server-specter/Windows 2019 server
{code}
fatal: [win-xagt5 -> localhost]: FAILED! => {"changed": false, "msg": "Status code: 400/BAD_REQUEST, [ 3196610e-a0c0-4235-a093-6c1347753bc5 ] HTTP 400 Bad Request\n - cvc-complex-type.2.4.a: Invalid content was found starting with element 'CustomizationScript'. One of '{"http://www.vmware.com/vcloud/v1.5\":Link, WC[##other:"http://www.vmware.com/vcloud/v1.5"]}' is expected. (request id: 3196610e-a0c0-4235-a093-6c1347753bc5)"}
{code}
I can successfully update for any other windows/linux/OSX VMs.
I also see same issue if I try to enable Admin Password by passing parameters admin_password_enabled=True and admin_password={str}
pyvcloud version: 21.0.0
vcloud Director api ver: 31.0
My code is following the test https://github.com/vmware/pyvcloud/blob/d9100f8a23b10659b382338fefe670f4e30131c4/system_tests/vm_tests.py#L683
Also I could successfully update computer_name for above mentioned OSs when using pyvcloud version 18.2.2
The text was updated successfully, but these errors were encountered: