Question

Using Guest_Customization SysPrep Object with REST API v3


I'm getting Error Code 422 when I add the guest_customization section in the json code below. Without that section a VM is successfully created. The xml has been converted to Base64 and works perfectly if pasted into Prism during VM creation. I'm lost..

{
"api_version": "3.1",
"metadata": {

"kind": "vm"
},
"spec": {
"cluster_reference": {
"kind": "cluster",
"uuid": "0005776a-b7a2-4b38-5583-e4434b197444"
},
"name": "TestVM2",
"resources": {
"memory_size_mib": 4096,
"nic_list": [
{
"subnet_reference": {
"kind": "subnet",
"uuid": "9a44fd86-efa2-4ef9-8127-98116024c653"
}
}
],
"disk_list": [
{
"data_source_reference": {
"kind": "image",
"uuid": "b221c63d-3f7c-4874-a2ab-1de87d932b15"
},
"device_properties": {
"device_type": "DISK",
"disk_address": {
"device_index": 0,
"adapter_type": "SCSI"
}

}

}
],
"num_sockets": 1,
"num_vcpus_per_socket": 2,
"power_state": "OFF",
"guest_customization": {
"install_type": "PREPARED",
"unattend_xml": "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHVuYXR0ZW5kIHhtbG5zPSJ1cm46c2NoZW1hcy1taWNyb3NvZnQtY29tOnVuYXR0ZW5kIj4KICAgIDxzZXR0aW5ncyBwYXNzPSJzcGVjaWFsaXplIj4KICAgICAgICA8Y29tcG9uZW50IG5hbWU9Ik1pY3Jvc29mdC1XaW5kb3dzLVVuYXR0ZW5kZWRKb2luIiBwcm9jZXNzb3JBcmNoaXRlY3R1cmU9ImFtZDY0IiBwdWJsaWNLZXlUb2tlbj0iMzFiZjM4NTZhZDM2NGUzNSIgbGFuZ3VhZ2U9Im5ldXRyYWwiIHZlcnNpb25TY29wZT0ibm9uU3hTIiAKCnhtbG5zOndjbT0iaHR0cDovL3NjaGVtYXMubWljcm9zb2Z0LmNvbS9XTUlDb25maWcvMjAwMi9TdGF0ZSIgeG1sbnM6eHNpPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYS1pbnN0YW5jZSI+CiAgICAgICAgICAgIDxJZGVudGlmaWNhdGlvbj4KICAgICAgICAgICAgICAgIDxDcmVkZW50aWFscz4KICAgICAgICAgICAgICAgICAgICA8RG9tYWluPmFuYWRhcmtvLmNvbTwvRG9tYWluPgogICAgICAgICAgICAgICAgICAgIDxQYXNzd29yZD5NJEckTSRUMTIzPC9QYXNzd29yZD4KICAgICAgICAgICAgICAgICAgICA8VXNlcm5hbWU+KioqKioqKjwvVXNlcm5hbWU+CiAgICAgICAgICAgICAgICA8L0NyZWRlbnRpYWxzPgogICAgICAgICAgICAgICAgPEpvaW5Eb21haW4+YW5hZGFya28uY29tPC9Kb2luRG9tYWluPgogICAgICAgICAgICAgICAgPE1hY2hpbmVPYmplY3RPVT5PVT1zZXJ2ZXJzLE9VPXVzYSxPVT13b3JsZCxPVT1vcmdSb290LERDPWFuYWRhcmtvLERDPWNvbTwvTWFjaGluZU9iamVjdE9VPgogICAgICAgICAgICAgICAgPFVuc2VjdXJlSm9pbj5mYWxzZTwvVW5zZWN1cmVKb2luPgogICAgICAgICAgICA8L0lkZW50aWZpY2F0aW9uPgogICAgICAgIDwvY29tcG9uZW50PgogICAgICAgIDxjb21wb25lbnQgbmFtZT0iTWljcm9zb2Z0LVdpbmRvd3MtU2hlbGwtU2V0dXAiIHByb2Nlc3NvckFyY2hpdGVjdHVyZT0iYW1kNjQiIHB1YmxpY0tleVRva2VuPSIzMWJmMzg1NmFkMzY0ZTM1IiBsYW5ndWFnZT0ibmV1dHJhbCIgdmVyc2lvblNjb3BlPSJub25TeFMiIAoKeG1sbnM6d2NtPSJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL1dNSUNvbmZpZy8yMDAyL1N0YXRlIiB4bWxuczp4c2k9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hLWluc3RhbmNlIj4KICAgICAgICAgICAgPENvbXB1dGVyTmFtZT5UZXN0Vk0xPC9Db21wdXRlck5hbWU+CiAgICAgICAgICAgIDxSZWdpc3Rlcm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AyLndpbSMxIiB4bWxuczpjcGk9InVybjpzY2hlbWFzLW1pY3Jvc29mdC0KCmNvbTpjcGkiIC8+CjwvdW5hdHRlbmQ+Cg=="
}
},
}
}
}

0 replies

Be the first to reply!

Reply