UCSD Create VDC and all of its Policies Example (including Rollback)

Version 6
    Task NameCreate VDC and all of its policies Example
    DescriptionCreate VDC and all of its policies Example
    Prerequisites
    1. Tested on 5.2.0.1 / Tested on 6.0.1
    CategoryWorkflow tasks
    ComponentsCreate VDC and all of its policies Example
    1. Log in to UCS Director as a user that has "system-admin" privileges.
    2. Navigate to "Policies-->Orchestration" and click on "Import".
    3. Click "Browse" and navigate to the location on your computer where the .wfdx file resides. Choose the .wfdx file and click "Open".
    4. Click "Upload" and then "OK" once the file upload is completed. Then click "Next".
    5. Click the "Select" button next to "Import Workflows". Click the "Check All" button to check all checkboxes and then the "Select" button.
    6. Click "Submit".
    7. A new folder should appear in "Policies-->Orchestration" that contains the imported workflow.

     

    Thank you goes out to Niraj Kumar.

     

    The workflow:

     

    Screen Shot 2015-04-22 at 12.35.13 PM.png

     

    System policy is updated in new VDC:

     

    Screen Shot 2015-04-22 at 12.34.07 PM.png

     

    Some of the interesting output:

     

    Screen Shot 2015-04-22 at 12.33.30 PM.png

     

    Make sure the tasks are updated with your inputs (Or make global workflow variables out of these task variables and link them) :

     

    Screen Shot 2017-01-30 at 7.21.25 AM.png

    Screen Shot 2017-01-30 at 7.21.47 AM.png

    Screen Shot 2017-01-30 at 7.22.14 AM.png

    Screen Shot 2017-01-30 at 7.22.28 AM.png

    Screen Shot 2017-01-30 at 7.22.41 AM.png

     

     

     

     

    On Rollback the System Policy is deleted:

     

    Screen Shot 2017-01-24 at 9.18.35 AM.png

     

    Custom task to delete System Policy is included:

    Screen Shot 2017-01-24 at 9.20.17 AM.png

     

    Rollback:

     

     

    So I added roll back for the service Delivery policy… here is the code… (workflow and task are coming..) this is just a FYI how this works…

     

     

     

    function registerUndoTask()

    {

     

         // register undo task

         var undoHandler = "custom_Delete System Policy";

         var undoContext = ctxt.createInnerTaskContext(undoHandler);

         var undoConfig = undoContext.getConfigObject();

         undoConfig.SystemPolicyName = syspoltmp;

     

    logger.addInfo("Registering syspoltmp var: "+syspoltmp);

          

         ctxt.getChangeTracker().undoableResourceModified("DeleteSystemPolicy-Commands-Undo",

                    "DeleteSystemPolicy "+ syspoltmp,

                     "DeleteSystemPolicy: "+ syspoltmp,

                    "DeleteSystemPolicy: "+ syspoltmp,

                    undoHandler,

                    undoConfig);

    }

     

    #1 custom_Delete System Policy

                    - this is actually a new task –

                    - you can register a task for roll back

     

    #2 undoConfig.SystemPolicyName = syspoltmp

                    - this is where you register the exact variable names the task is using and its desired input at roll back time…

                    - in this case we want to delete the system policy with the name we gave it when it was created

     

     

     

     

     

    Attached is the whole workflow and its components before they were tweaked to generate more output.