Add Disk day 2 action for the VM getting fail with ERROR: Internal Server Error
when snapshotLimit is used as Custom property in the Project and assign the value as 1.0ERROR tango-blueprint [host='tango-blueprint-service-app-xxxxxx' thread='http-nio-8080-exec-47' user='catalog-8xxxxx(xxxx)' org='1beaa0b6-xxxxxxxxxxxx' blueprint='72f1f3ab-xxxx--xxxxxx' project='07abb1da-xxxxxxxxx' deployment='596bcac6-xxxxxxxxxxx' trace='505157c7-xxxxxxx'] com.vmware.tango.blueprint.exception.ControllerExceptionHandler - Runtime exception: class java.lang.String cannot be cast to class java.lang.Number (java.lang.String and java.lang.Number are in module java.base of loader 'bootstrap') [Error Reference ID: 1642cf3c-xxxxxxx] ClassCastException: class java.lang.String cannot be cast to class java.lang.Number (java.lang.String and java.lang.Number are in module java.base of loader 'bootstrap')
VMware Aria Automation 8.xx
snapshotLimit is a schema property of resource type Cloud.vSphere.Machine, the type is number, but snapshotLimit is added as a string of value 1.0 in project's custom properties. When customer provisions the above blueprint, blueprint service calls provisioning-service to allocate or create resource, provisioning-service will add snapshotLimit as a custom property with string value 1.0 and return to blueprint service. Then blueprint forwards this value to deployment service, and deployment service stores this string value in the DB. Then when customer performs day2 action on this vsphere machine, deployment service sends this string value to blueprint and blueprint finds out snapshotLimit is a schema property and its type is number, hence failure.
vracli dev psql provisioning-db
UPDATE compute_state SET custom_properties = jsonb_set(custom_properties, '{snapshotLimit}', '"1"'::jsonb, true) WHERE custom_properties->>'snapshotLimit' = '1.0';
vracli dev psql catalog-db
select count(resource_id) from dep_resource_data where properties @> '{"snapshotLimit": "1.0"}';