• Icon: Sub-task Sub-task
    • Resolution: Done
    • Icon: Medium Medium
    • Casablanca Release
    • None
    • Casablanca SO Sprint 2

      As a user of SO I'd like to be able to use Multicloud to instantiate VNFs in order to take advantage of various Multicloud features not present in standard openstack API.

       

      This task is to modify SO workflows, mso-vnf-adapter and other places in the code to make use of Multicloud OpenStack Endpoint Proxy. At a minimum it will require creating a modification or adaptation of so\adapters\mso-openstack-adapters\src\main\java\org\onap\so\adapters\vnf\MsoVnfPluginAdapterImpl.java with endpoint url code/config changed so that multicloud endpoint url can be dynamically composed using cloud_owner and cloud_region from OOF homing. 

      The flows at issue

      so\adapters\mso-catalog-db-adapter\src\main\resources\db\migration\V2.4__MacroReferenceData1806.sql @ line 52 - Service-Macro-Create

      so\adapters\mso-catalog-db-adapter\src\main\resources\db\migration\V2.4__MacroReferenceData1806.sql @ line 107 - VFModule-Create

       

      Follow the BBs above from the database, the flows go to

      • CreateVfModuleBB          so\bpmn\so-bpmn-building-blocks\src\main\resources\subprocess\BuildingBlock\CreateVfModuleBB.bpmn  to
      • VnfAdapter                       so\bpmn\so-bpmn-building-blocks\src\main\resources\subprocess\BuildingBlock\VnfAdapter.bpmn             to
      • VnfAdapterRestV1                so\bpmn\MSOCommonBPMN\src\main\groovy\org\onap\so\bpmn\common\scripts\VnfAdapterRestV1.groovy
        • <REST request is sent to vnf adapter @ so\bpmn\MSOCommonBPMN\src\main\groovy\org\onap\so\bpmn\common\scripts\VnfAdapterRestV1.groovy Line 297 >
        • If we set urn properties mso.adapters.vnf.rest.endpoint to match our multicloud endpoint
        • The above method will send the request to our multicloud implementation
      • Multicloud implementation endpoint likely requires additions to at least CXFConfig of  and possibly elsewhere to get adapter endpoint working
        • so\adapters\mso-openstack-adapters\src\main\java\org\onap\so\adapters\openstack\CXFConfiguration.java (add autowire and bean)

      This is what the request should look like, all the highlighted bits in json below are mulitcloud additions to the call, with openstack call data in template_data json field. The red portions are standard stack create call to OpenStack API.

         "generic-vnf-id":"<generic-vnf-id>",

         "vf-module-id":"<vf-module-id>",

         "oof_directives":{}

         "sdnc_directives":{}

         "template_type":"<heat/tosca/etc.>", 

             "template_data":{

             "files":{},

         "disable_rollback":true,

         "parameters":

      {        "flavor":"m1.heat"    }

      ,

         "stack_name":"teststack",

         "template":{ 

            "heat_template_version":"2013-05-23",

            "description":"Simple template to test heat commands",

            "parameters":{ 

               "flavor":

      {              "default":"m1.tiny",             "type":"string"          }

            },

            "resources":{ 

               "hello_world":{ 

                  "type":"OS::Nova::Server",

                  "properties":{ 

                     "key_name":"heat_key",

                     "flavor":

      {                    "get_param":"flavor"                }

      ,

                     "image":"40be8d1a-3eb9-40de-8abd-43237517384f",

                     "user_data":"#!/bin/bash -xv\necho \"hello world\" > /root/hello-world.txt\n"

                  }

               }

            }

         },

         "timeout_mins":60

         }  

         

      }

       

       

      The tenant_id is provided to SO during the create call to NB SO API and passed through the flows to the adapter.

       

      The bolded part of the URL is the same as the original vnfAdapter url. Only the prefix is different.

      API URL: POST http://

      {msb IP}

      :{msb port}/api/multicloud/v1/{cloud-owner}/{cloud-region-id}/infra_workload/<tenant_id>/stacks

            ewmulta ewmulta
            mgkwill mgkwill
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: