UCSD - Semaphore Example (v1)

Version 2
    Task Name

    Semaphore Example

    Description

     

    Prerequisites
    1. Tested on 5.4.0.2
    CategoryWorkflow
    ComponentsvSphere 5.x
    User Inputse-mail address
    Outpute-mail with counter

    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 .WFDX file resides. Choose the .WFDX 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

     

    Important

     

      Screen Shot 2016-04-08 at 1.05.48 PM.png

     

     

     

    The workflow:

     

    Screen Shot 2016-04-08 at 1.03.05 PM.png

     

    Example of when the semaphore is set and the number of re-trys:

     

    Service Request ID: 6528

     

     

     

     

    Apr 08, 2016 12:26:15 CDT Request submitted

    Apr 08, 2016 12:26:20 CDT Executing workflow item number 1

    Apr 08, 2016 12:26:21 CDT Completed workflow item number 0, with status Completed

    Apr 08, 2016 12:26:28 CDT Executing workflow item number 2

    Apr 08, 2016 12:26:28 CDT Trigger context executeWorkFlowStep called

    Apr 08, 2016 12:26:28 CDT Executing custom action SemaphoreTestv1 (custom_SemaphoreSet)

    Apr 08, 2016 12:26:28 CDT Executing custom action SemaphoreTestv1 (custom_SemaphoreSet)

    Apr 08, 2016 12:26:28 CDT Executing custom script for SemaphoreSet

    Apr 08, 2016 12:26:30 CDT A =

    Apr 08, 2016 12:26:30 CDT Lineset

    Apr 08, 2016 12:26:30 CDT A0 : set

    Apr 08, 2016 12:26:30 CDT A = set

    Apr 08, 2016 12:26:30 CDT Semaphore is set

    Apr 08, 2016 12:26:30 CDT Lets Sleep and try again...30

    Apr 08, 2016 12:27:00 CDT Waking up...

    Apr 08, 2016 12:27:00 CDT Lineset

    Apr 08, 2016 12:27:00 CDT A0 : set

    Apr 08, 2016 12:27:00 CDT Semaphore (2) is set

    Apr 08, 2016 12:27:00 CDT Lets Sleep and try again...30

    Apr 08, 2016 12:27:30 CDT Waking up...

    Apr 08, 2016 12:27:30 CDT Lineset

    Apr 08, 2016 12:27:31 CDT A0 : set

    Apr 08, 2016 12:27:31 CDT Semaphore (3) is set

    Apr 08, 2016 12:27:31 CDT Lets Sleep and try again...30

    Apr 08, 2016 12:28:01 CDT Waking up...

    Apr 08, 2016 12:28:01 CDT Lineset

    Apr 08, 2016 12:28:01 CDT A0 : set

    Apr 08, 2016 12:28:01 CDT Semaphore (4) is set....giving up

    Apr 08, 2016 12:28:01 CDT Task: SemaphoreTestv1 (custom_SemaphoreSet) failed with error - Unable to get Semaphore!, selectedContext=<None>

    Apr 08, 2016 12:28:01 CDT Task #1 (SemaphoreTestv1 (custom_SemaphoreSet)) failed after 92 seconds

    Apr 08, 2016 12:28:01 CDT Input/Output values for Task #1 (SemaphoreTestv1 (custom_SemaphoreSet)):

    Apr 08, 2016 12:28:01 CDT [Local Input: delaytime = 30]

    Apr 08, 2016 12:28:01 CDT Completed workflow item number 1, with status Failed

     

    Example of a set and unset :

     

    Screen Shot 2016-04-08 at 1.11.51 PM.png

     

    Service Request ID: 6534

     

     

     

     

    Apr 08, 2016 12:46:29 CDT Request submitted

    Apr 08, 2016 12:46:32 CDT Executing workflow item number 1

    Apr 08, 2016 12:46:32 CDT Completed workflow item number 0, with status Completed

    Apr 08, 2016 12:46:39 CDT Executing workflow item number 2

    Apr 08, 2016 12:46:39 CDT Trigger context executeWorkFlowStep called

    Apr 08, 2016 12:46:39 CDT Executing custom action SemaphoreTestv1 (custom_SemaphoreSet)

    Apr 08, 2016 12:46:39 CDT Executing custom action SemaphoreTestv1 (custom_SemaphoreSet)

    Apr 08, 2016 12:46:39 CDT Executing custom script for SemaphoreSet

    Apr 08, 2016 12:46:42 CDT A =

    Apr 08, 2016 12:46:42 CDT A =

    Apr 08, 2016 12:46:42 CDT Semaphore is not set

    Apr 08, 2016 12:46:42 CDT Lets set it

    Apr 08, 2016 12:46:42 CDT Semaphoe is set

    Apr 08, 2016 12:46:42 CDT Processing output: out

    Apr 08, 2016 12:46:43 CDT Task #1 (SemaphoreTestv1 (custom_SemaphoreSet)) completed successfully in 3 seconds

    Apr 08, 2016 12:46:43 CDT Input/Output values for Task #1 (SemaphoreTestv1 (custom_SemaphoreSet)):

    Apr 08, 2016 12:46:43 CDT [Local Input: delaytime = 30]

    Apr 08, 2016 12:46:43 CDT [Output: out = ]

    Apr 08, 2016 12:46:43 CDT Completed workflow item number 1, with status Completed

    Apr 08, 2016 12:46:44 CDT Executing workflow item number 3

    Apr 08, 2016 12:46:44 CDT Trigger context executeWorkFlowStep called

    Apr 08, 2016 12:46:44 CDT Executing custom action SemaphoreTestv1 (Wait for Duration)

    Apr 08, 2016 12:46:44 CDT Executing custom action SemaphoreTestv1 (Wait for Duration)

    Apr 08, 2016 12:46:47 CDT Waiting 10 seconds

    Apr 08, 2016 12:46:57 CDT Completed waiting 10 seconds

    Apr 08, 2016 12:46:57 CDT Task #2 (SemaphoreTestv1 (Wait for Duration)) completed successfully in 13 seconds

    Apr 08, 2016 12:46:57 CDT Input/Output values for Task #2 (SemaphoreTestv1 (Wait for Duration)):

    Apr 08, 2016 12:46:57 CDT [Local Input: Duration = 10]

    Apr 08, 2016 12:46:57 CDT Completed workflow item number 2, with status Completed

    Apr 08, 2016 12:46:57 CDT Executing workflow item number 4

    Apr 08, 2016 12:46:57 CDT Trigger context executeWorkFlowStep called

    Apr 08, 2016 12:46:57 CDT Executing custom action SemaphoreTestv1 (custom_SemaphoreUnSet)

    Apr 08, 2016 12:46:57 CDT Executing custom action SemaphoreTestv1 (custom_SemaphoreUnSet)

    Apr 08, 2016 12:46:57 CDT Executing custom script for SemaphoreUnSet

    Apr 08, 2016 12:47:00 CDT Processing output: out

    Apr 08, 2016 12:47:01 CDT Task #3 (SemaphoreTestv1 (custom_SemaphoreUnSet)) completed successfully in 3 seconds

    Apr 08, 2016 12:47:01 CDT Input/Output values for Task #3 (SemaphoreTestv1 (custom_SemaphoreUnSet)):

    Apr 08, 2016 12:47:01 CDT [Output: out = unset]

    Apr 08, 2016 12:47:01 CDT Completed workflow item number 3, with status Completed

    Apr 08, 2016 12:47:04 CDT Executing workflow item number 5

    Apr 08, 2016 12:47:04 CDT Completed workflow item number 4, with status Completed