Once IaaS upgrade kicks-off in some environments you might experience an error stating it cannot continue upgrading ModelManagerWeb
Exception goes as below
Executing:E:\Program Files (x86)\VMware\vCAC\Server\Model Manager Data\Cafe\Vcac-Config.exe UpgradeArchiveDayTo62 -v[12:26:33.812] Error: [sub-thread-Id="6" context="" token=""] The archive period of resource NUKES02 is not up to date.VMware.Cafe.JsonResponseException: Child resource must have the same lease as its parent.PUT https://vrasimple/catalog-service/api/provider/providers/<<ProviderID>>/resources/<<ResourceID>>
Request:
{ "id": "VirtualMachineID",
"name": "NUKES02",
"description": null,
"resourceTypeId": "Infrastructure.Virtual",
"catalogItemId": null,
"catalogItemRequestId": "<<",
"organization": { "tenantLabel": "nukes",
"tenantRef": "nukes",
* * *
Response: {"errors":[{"code":20148,"source":null,"message":"Child resource must have the same lease as its parent.","systemMessage":"Child resource must have the same lease as its parent.","moreInfoUrl":null}]} at VMware.Cafe.JsonRestClient.<HandleErrorResponse>d__2`1.MoveNext() --- End of stack trace from previous location where exception was thrown ---
This exception occurs when there is a discrepancy between SQL and Postgres databases with respect to archive dates.
Analysis
You would have to find out from IAAS Node / ManagementAgent / All.log , how many Virtual Machines are at fault.
Note down the names first , then execute query
select * from dbo.VirtualMachine where VirtualMachineName = '<<vm01>>,<<vm02>>'

Once we have VirtualMachineID of VirtualMachines showing discrepancy, keep an eye on "Expire Days" column in the output make a note of the value
Login into vRA postgres database
​ su - postgres /opt/vmware/vpostgres/current/bin/psql vcac
\x
Then execute
select * from cat_resource where name = 'vm01';
Examine archive_days value from the output

Expire Days from SQL Database for this Virtual Machine and archive_days from Postgres should be same , else you would have problem during upgrade
Remediation
Now to come out of this problem, we need to update VirtualMachineID's of the virtual machines which are showing this discrepancy.
We have the VirtualMachineID captured through the query shared above, so we need to just go ahead and update's it's value as it is shown in Postgres
UPDATE VirtualMachine SET ExpireDays = 0 WHERE VirtualMachineID in ('XXXXX-XXXXX-XXXXX-XXXX')
Once done go ahead and retry failed iaas upgrade and it should work like charm. Post this exception , only DEM Orchestrator and Agents would be pending.
This error occurs when your almost done upgrading ModelManagerData\