VMware Cloud Community
jabmaster
Contributor
Contributor
Jump to solution

vCenter Service Crash when using API to create Windows Customization Spec

Hello.

 

I'm working with the vCenter 8 API. So far, I've successfully created a customization spec for Linux and managed to deploy a virtual machine running Debian from a template stored in the library. I achieved this by making a POST request to /api/vcenter/library-items/{item_item}?action=deploy endpoint and filling "guest_customization" field with the name of previosly created customization spec name. Everything worked fine for this scenario.

 

However, I encountered an issue when attempting a similar test to deploy a Windows virtual machine. After making the POST request to /api/vcenter/guest/customization-specs endpoint in order to create a customization spec for Windows, I received an HTTP status 503 - Service Unavailable response. This caused the entire vCenter, including the web administration interface, to crash, and I lost all access. The only workaround was to reboot the vCenter host VM.

 

I have included the JSON payload for the POST request that works correctly for a linux_config creation. Additionally, I'm attaching the JSON for the windows_config, which causes the vCenter to crash entirely.

 

Do you have any idea what might be happening? Is there a way to check logs or any other information that could help me troubleshoot this?

 

Thank you in advance for your assistance.

 

Best regards,
Jonás

Labels (3)
0 Kudos
1 Solution

Accepted Solutions
jabmaster
Contributor
Contributor
Jump to solution

Well... I found the issue! According to the documentation (https://developer.vmware.com/apis/vsphere-automation/latest/vcenter/data-structures/Guest/WindowsSys...), sending the "domain" object is optional for a Windows sysprep. However, it turns out that if this object is not sent, it causes the vCenter to crash.

 

The solution was to add the following:

 

"domain": {

          "workgroup": "TEST-WG",

          "type": "WORKGROUP"

}

 

By including the "domain" at same level that "gui_unattended" and "user_data" properties, the sysprep works perfectly. The customization spec is created, and, most importantly, vCenter doesn't crash.

 

I think my JSON could be improved, and possibly it's not entirely correct since I've seen that for Windows, the DNS should be like this:

 

"windows": {

          "dns_servers": [

                  "1.1.1.1",

                  "8.8.8.8"

          ]

}

 

But that's not the main issue here. The main point is that vCenter should handle such cases gracefully and not crash due to missing optional properties. This highlights the need for better error handling and possibly improving the documentation to provide clearer guidance on the required and optional properties.

 

I hope this information is helpful to you all!

 

Best regards,

Jonás

View solution in original post

0 Kudos
2 Replies
jabmaster
Contributor
Contributor
Jump to solution

Ok.. I found an interesting crash log:

 

SymBacktrace[6] 00007f7c041c4540 rip=00007f7c0b4508a2 in function _ZNK4Vapi8Provider20AsyncApiMethodFilterIZN3Com6Vmware7Vcenter5Guest21CustomizationSpecsSvc24AsyncServiceBinderHelper19CreateMethodBuilderclEMNS6_21AsyncServiceInterfaceEFvRKSt10shared_ptrIKNS6_10CreateSpecEERKSA_INS_4Core15AsyncActivationEERKNS_11AsyncResultISsNS_28AsyncResultTerminateCbPolicyEEEERKSA_IS9_ERKSA_INS_4L10n9LocalizerEEEUlRKNS6_12CreateMethod5InputESK_SP_E_SsS11_NS0_18DirectFilterBinderEEclERKSA_IKNS_4Data9DataValueEESK_RKSt8functionIFvRKN5boost8optionalIS1A_EERKSA_IKNS17_10ErrorValueEERKNS_8ProgressEOS1D_IFvSA_INS0_14AsyncApiMethod8ResultCbEEEEEE in object /usr/lib/vmware-vpx/libcom_vmware_vcenter_platformlessbindings_cpp.so loaded at 00007f7c09d25000

 

It seems to me that this is a vCenter bug... I am attaching the complete crash report.

 

This happens with vCenter 8.0.1.00200. Is there an official bug tracker where I can report this?

 

Thanks again!

0 Kudos
jabmaster
Contributor
Contributor
Jump to solution

Well... I found the issue! According to the documentation (https://developer.vmware.com/apis/vsphere-automation/latest/vcenter/data-structures/Guest/WindowsSys...), sending the "domain" object is optional for a Windows sysprep. However, it turns out that if this object is not sent, it causes the vCenter to crash.

 

The solution was to add the following:

 

"domain": {

          "workgroup": "TEST-WG",

          "type": "WORKGROUP"

}

 

By including the "domain" at same level that "gui_unattended" and "user_data" properties, the sysprep works perfectly. The customization spec is created, and, most importantly, vCenter doesn't crash.

 

I think my JSON could be improved, and possibly it's not entirely correct since I've seen that for Windows, the DNS should be like this:

 

"windows": {

          "dns_servers": [

                  "1.1.1.1",

                  "8.8.8.8"

          ]

}

 

But that's not the main issue here. The main point is that vCenter should handle such cases gracefully and not crash due to missing optional properties. This highlights the need for better error handling and possibly improving the documentation to provide clearer guidance on the required and optional properties.

 

I hope this information is helpful to you all!

 

Best regards,

Jonás

0 Kudos