Uploaded image for project: 'Data Collection, Analytics, and Events'
  1. Data Collection, Analytics, and Events
  2. DCAEGEN2-2022

Improve DH install/uninstall workflow to avoid out of sync conditions with Cloudify

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Done
    • Icon: Medium Medium
    • Guilin Release
    • None
    • None
    • None

      It's been noticed on several occasions that Inventory API's Services are out of sync to what's actually deployed in Cloudify.

      Inventory API's Services are created/deleted via Deployment Handler (DH). As services are added/deleted and as deployments fail after getting initiated and as Cloudify sometimes fails to deploy or undeploy deployments, Services inventoried in Inventory will almost always get out of sync with Cloudify, hence, providing a non accurate/real time picture of what's deployed.

      This has been noticed consistently on several occasions. Dashboard currently uses Inventory's Services to show users the deployments and their relationships to blueprints (in Inventory).

      This user presentation is not always accurate due to having 2 systems (Inventory's Services and Cloudify) keeping track of same info/deployments.

      The database of records for "Services" or deployments is Cloudify which offers an API to query the deployments.

      Dashboard will make a change to query Cloudify directly to get the deployments; In addition, Dashboard needs the ability to map Cloudify deployments to Blueprints that are stored in Inventory.

      In order to support this, DH will need to make changes outlined below so that Blueprints in Inventory can be related to deployments in Cloudify via Blueprint's typeId and across different tenants.

       

      DH changes:

      On an install workflow, today we upload a new BP with a blueprint_id same as deployment_id on every install; instead, DH will use a blueprint_id equal to the blueprint typeID from inventory (actually it will be something string "TID-", for typeID, followed by actual inventory's typeId since cfy doesn't allow blueprint_id to start with a number); DH will 1st check if CFY has a blueprint already with such an id ("TID-<inventory typeId>"); if so, DH will use this id; if not, DH will upload to CFY a new BP (with global visibility) with such an id ("TID-<inventory typeId>"); This way we also don't duplicate blueprints in CFY.

      Rest of install workflow is BAU; DH will create a new deployment (with supplied deployment_id) with a new or existing cfy blueprint and initiate install workflow

      This way; someone querying CFY for the deployment, will see the inventory blueprint typeId (as "TID-<inventory typeId>") in the blueprint_id field

      Multiple deployments using same blueprints will show up in the cfy query provided above that queries all deployment against a particular blueprint across all tenants

      Do not add a new service in inventory anymore as part of install workflow

       

      On an uninstall workflow, today we initiate uninstall workflow, delete deployment and then delete blueprint from CFY (using same id as deployment_id); instead, the last part will charge, DH will not just blindly delete the blueprint from CFY; DH will 1st query CFY to get the blueprint associated w/ the deployment_id (to be uninstalled) then check if there are any deployments against the blueprint, if so, don't delete the blueprint from CFY; otherwise, if there are no deployments anymore associated w/ the blueprint, then lookup the tenant associated with the BP and delete the BP (w/ original/associated tenant) from CFY

      Do not delete the associated service in inventory anymore as part of uninstall workflow

       

      In order to get the list of services or deployments accurately and reliably; Need to go to Cloudify using its REST API; Sample Cloudify query to get all deployments across all tenants and display/include the id of the deployment, blueprint_id and tenant_name (in HTTP Header: Tenant: default_tenant):

      https://<cloudify_fqdn_or_idns>:443/api/v3.1/deployments?_all_tenants=true&_include=id,blueprint_id,tenant_name

       

      To query Cloudify against a particular deployment using a deploymentid (across all tenants; (in HTTP Header: Tenant: default_tenant)):

      https://<cloudify_fqdn_or_idns>:443/api/v3.1/deployments?_all_tenants=true&_include=id,blueprint_id,tenant_name&id=<deploymentid>

       

      To query Cloudify to get all deployments against a particular blueprint typeId (across all tenants; (in HTTP Header: Tenant: default_tenant)):

      https:// <cloudify_fqdn_or_idns> :443/api/v3.1/deployments?blueprint_id=TID-<blueprint_typeId>&_all_tenants=true&_include=id,blueprint_id,tenant_name

            sh1986 sh1986
            sh1986 sh1986
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: