UCSD - Cisco Cloud Center Integration with UCSD / Arbitrary Workflow Execution (with Rollback feature)

Version 23
    Task Name

    This page is going to describe on how to integrate UCSD with Cisco Cloud Center

    formerly know as CliQr

    Description

     

    Prerequisites

    Tested on UCSD 5.4.0.3 CCC 4.4.2

    CategoryWorkflow
    ComponentsvSphere 5.x
    User Inputs


    Instructions for Regular Workflow Use:

    1. Download the attached .ZIP file below to your computer. *Remember the location of the saved file on your computer.
    2. Unzip the file on your computer. Should end up with a .WFD file.
    3. Log in to UCS Director as a user that has "system-admin" privileges.
    4. Navigate to "Policies-->Orchestration" and click on "Import".
    5. Click "Browse" and navigate to the location on your computer where the .WFD file resides. Choose the .WFD file and click "Open".
    6. Click "Upload" and then "OK" once the file upload is completed. Then click "Next".
    7. Click the "Select" button next to "Import Workflows". Click the "Check All" button to check all checkboxes and then the "Select" button.
    8. Click "Submit".
    9. A new folder should appear in "Policies-->Orchestration" that contains the imported workflow. You will now need to update the included tasks with information about the specific environment.

     

    Many thanks go out to Tuan Nguyen

     

    Here are the steps to initiate a workflow in UCSD from Cisco Cloud Center:

     

    Work in progress!!!!

     

    1) Deploy a CilQr CCO and Rabbit MQ vCenter template and power up.

     

              Screen Shot 2016-05-24 at 7.29.59 AM.png

    2) Hostname and re-IP

         2.1) Hostname CCO

              vi /etc/hostname (change the current hostname)

              hostname cliqrccoucsd

              vi /etc/hosts (add host name to the 127 line at the end)


         2.2) Hostname Rabbit

              vi /etc/hostname (change the current hostname)

              hostname CliqrRabbitUCSD

              vi /etc/hosts (add host name to the 127 line at the end)


         2.3) re-IP (both systems) (My example CCO =172.17.33.109, Rabbit = 172.17.33.113)

              nmtui  (Note the IP has to have a /24 or /23 or /25, no field for mask)


    3) File fix up CCO

         Add the AMQ (Rabbit) Server

              /usr/local/osmosix/bin/cco_config_wizard.sh

     

              Screen Shot 2016-05-24 at 8.11.34 AM.png

              Screen Shot 2016-05-24 at 8.11.04 AM.png

         Update 2 files:

              vi /usr/local/osmosix/etc/cloud

                   change to CiscoUCSD

              vi /usr/local/osmosix/etc/profile.properties

                   change to cloud=CiscoUCSD

         Re-boot

              init 6

     

    4) File fix up Rabbit (UCSD)

          File gets re-created after boot with new hostname

              rm -f /usr/local/osmosix/etc/.RABBITINSTALLED


         Have to investigate what was changed

              /usr/local/osmosix/bin/gua_config_wizard.sh

         Re-boot

              init 6

         Aftger Boot test

              rabbitmqctl list_users

              rabbitmqctl list_connections


    5) Fix up CCM (UCSD)

         Stop Tomcat

              /etc/init.d/tomcat stop

         Update the DB

              mysql -uosmosix -p osmosixdb

              (osmosix)

                   select * from IMAGES where name='Callout Workflow';

                   update IMAGES set deleted=0 and privateImg=TRUE where name='Callout Workflow';

              quit

        For Postgress DB

               cliqrdb=> update IMAGES set private_img=true and deleted=false where name='Callout Workflow';


     

     

    psql -d cliqrdb -U cliqr

     

     

    [root@cliqr-centos7-base-image ~]# psql -d cliqrdb -U cliqr

    Password for user cliqr:

    psql (9.5.4)

    Type "help" for help.

     

     

    cliqrdb=> select * from IMAGES where name='Callout Workflow';

     

    image_id |       name       |   description    | published | private_img | os_name | cloud_node_type | owner |     internal_image_name     | disabled | system_image | num_of_nics | deleted

    ----------+------------------+------------------+-----------+-------------+---------+-----------------+-------+-----------------------------+----------+--------------+-------------+---------

           22 | Callout Workflow | Callout Workflow | t         | f           | Linux   | CloudWorker     |     2 | CloudWorker-calloutWorkflow | f        | t            |           1 | t

    (1 row)

     

     

    cliqrdb=> update IMAGES set private_img=true and deleted=false where name='Callout Workflow';

    UPDATE 1

     

    cliqrdb=> update IMAGES set private_img=true where name='Callout Workflow';

    UPDATE 1

     

    cliqrdb=> select * from IMAGES where name='Callout Workflow';

    image_id |       name       |   description    | published | private_img | os_name | cloud_node_type | owner |     internal_image_name     | disabled | system_image | num_of_nics | deleted

    ----------+------------------+------------------+-----------+-------------+---------+-----------------+-------+-----------------------------+----------+--------------+-------------+---------

           22 | Callout Workflow | Callout Workflow | t         | t           | Linux   | CloudWorker     |     2 | CloudWorker-calloutWorkflow | f        | t            |           1 | f

    (1 row)

     





         Start Tomcat

              /etc/init.d/tomcat start

         Logfile

              tail -f /usr/local/tomcat/logs/osmosix.log

         Version

              cat /usr/local/osmosix//etc/version


    6) GUI changes in Cisco Cloud Center (Cliqr)

     

         6.1) Add a cloud

     

    Screen Shot 2016-05-24 at 9.59.05 AM.png

         6.2) Configure Cloud Account

                   Note: Folder name has to match to a folder in UCSD with workflows!

    Screen Shot 2016-05-24 at 10.01.11 AM.png

         6.3) Add a Region

     

    Screen Shot 2016-05-24 at 10.03.54 AM.png

     

         6.4) Configure Orchestrator

         Screen Shot 2016-05-24 at 10.07.36 AM.png

         6.5) Create an Instance Type

    Screen Shot 2016-05-24 at 10.08.57 AM.png

     

         6.6) Create a Cloud/Image Mapping

     

    Screen Shot 2016-05-24 at 10.21.49 AM.png

    Screen Shot 2016-05-24 at 10.22.07 AM.png

     

         Don't for get to add UCSD as a Deployment Environment.

     

         6.7) Application Modeling (N-tier)

     

    Screen Shot 2016-05-24 at 10.23.49 AM.png

     

         6.8) Select UCSD / drag to designer

     

         Screen Shot 2016-05-24 at 10.24.03 AM.png

     

         Screen Shot 2016-05-24 at 10.26.16 AM.png

         6.9) Parameters Properties/Hardware Specifications (Workflow names show up in Dropdown)

     

         Screen Shot 2016-05-24 at 10.26.27 AM.png

    Screen Shot 2016-05-24 at 10.26.38 AM.png

     

    Screen Shot 2016-05-24 at 10.26.59 AM.png

     

         6.10) Deploy

     

         Screen Shot 2016-05-24 at 10.31.13 AM.png

    Screen Shot 2016-05-24 at 10.31.25 AM.png

     

    Screen Shot 2016-05-24 at 10.31.37 AM.png

     

    The custom task that will return the instance ID is attached.

    Further the in this test workflow is also attached.

     

    Workflow:

     

    Screen Shot 2016-05-24 at 10.36.51 AM.png

     

    Global output:

     

    Screen Shot 2016-05-24 at 10.37.16 AM.png

     

    Custom task mapping within the workflow for the SR ID to be returned to CCC

     

    Screen Shot 2016-05-24 at 10.37.31 AM.png

     

     

    Return of Resource ID to Cisco Cloud Center

     

    Cisco Cloud Center when talking to UCSD does need with in the to be called workflow a last task to report back to Cisco Could Center a resource ID. This resource ID can be the UCSD SR ID. The custom task will provide this function.

     

    Workflow SR ID:

    Screen Shot 2016-05-24 at 7.11.26 AM.png

     

    Cisco Cloud Center Resource ID:

     

    Screen Shot 2016-05-24 at 7.11.07 AM.png

     

    The Custom Task Code to return the resource ID:

     

    Screen Shot 2016-05-27 at 11.35.29 AM.png

     

    The termination workflow:

     

    Screen Shot 2016-05-26 at 10.47.20 AM.png

     

    Screen Shot 2016-05-26 at 10.47.36 AM.png

     

    For the termination portion in Cisco Cloud Center:

     

    Screen Shot 2016-05-26 at 2.27.46 PM.png

     

    The associated input:

     

     

    Screen Shot 2016-05-27 at 11.26.55 AM.png

    Note:

     

     

    Cisco Cloud Center logic expects the termination workflow to have that input label (the ‘resourceId’). If it does, then Cisco Cloud Center will inject the ‘resourceId’ that was returned from the original JSON output (we stored it to display the node name on the UI)



    The roll back code:

     

    Screen Shot 2016-05-27 at 11.33.05 AM.png

     

    The Workflow inputs:

     

    Screen Shot 2016-05-27 at 11.32.04 AM.png

     

    The termination and rollback in UCSD:

    Screen Shot 2016-05-27 at 11.29.57 AM.png