cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1460
Views
2
Helpful
0
Comments
Orf Gelbrich
Cisco Employee
Cisco Employee
Task Name
  1. Docker Containers
Description
  1. .
Prerequisites
  1. Tested on 6.5 and

CentOS Linux release 7.4.1708 (Core)

CategoryWorkflow
ComponentsvSphere 6.5
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.

Creating Cent OS VM and Install Docker:

1) Create Catalog (CentOS Linux release 7.4.1708 (Core))

Screen Shot 2017-11-24 at 8.22.05 AM.png

Select template (ISO install and turned off the libvirt, and added this to /etc/sudoers orf ALL=(ALL) ALL)


Screen Shot 2017-11-24 at 8.33.34 AM.png


In the post provisioning section select the Docker Install workflow (bottom of this page as zip file, unzip and import into UCSD)


Screen Shot 2017-11-24 at 8.45.16 AM.png


Workflow to install Docker and start Docker (workflow runs in VM Context!):


Screen Shot 2017-11-24 at 8.48.41 AM.png



Commands for SSH taks #1:

echo ${OrfPassword} | sudo -S  yum check-update

nohup curl -fsSL https://get.docker.com/ | sh > /tmp/dockerinstall.log &

nohup sleep 60; sudo usermod -aG docker ${User} &


Commands for SSH taks #2:


echo ${OrfPassword} |  sudo -S systemctl start docker

sudo systemctl status docker


Screen Shot 2017-11-20 at 5.58.04 AM.png

2) Create end user buttons (End-user-vm-actiopn-policy -> assign to VDC):


The result of the following actions should be this:


Screen Shot 2017-11-24 at 8.52.38 AM.png


2 actions for the end user to select:

     - create a container on the newly created VM

     - generate depending on a search criteria a new LOV (list of values) to select a new Docker container from

          (Docker has about 5 Billion containers to choose from and the LOV in UCSD can not be that long)


     The workflows are attached below unzip and import into UCSD and attach to the action:


How to create 2 end user actions:


Create and action policy called Docker:


Screen Shot 2017-11-24 at 8.58.13 AM.png


The policy has two actions associated:


Screen Shot 2017-11-24 at 8.58.48 AM.png


Create 2 labels (Names of the Buttons for end user) and attach the workflows:


Screen Shot 2017-11-24 at 8.59.18 AM.png

The Action Policy needs to be assigned to a VDC:


Screen Shot 2017-11-24 at 9.01.25 AM.png


Workflow to create a Docker container:


Screen Shot 2017-11-24 at 9.06.35 AM.png


Commands for SSH taks #1:


nohup echo ${OrfPassword} |  sudo -S docker container run -ti -d --name ${ContainerName} ${SelectContainer} > /tmp/dockercreatecontainer.log &

nohup sleep 50; echo ${OrfPassword} |  sudo -S docker ps -a &



Workflow to create new LOV data to select new and different docker containers to be created:


Screen Shot 2017-11-24 at 9.07.52 AM.png


3 steps in the workflow

     1) Contact Docker to generate a new list of docker images depending on the user entered search

     2) Move the generated file to the UCSD VM

     3) Execute the workflow that takes the docker date and generates a new LOV / new contents for the LOV

          Once this is run then when the create container end user button is selected a new list will be presented.


Commands for SSH taks #1:


nohup echo ${OrfPassword} | sudo -S docker search ${DockerSearchCriteria} --limit 20 | awk '{ print \$1","\$1 }' > /tmp/PossibleDockerImages&


Commands for SSH taks #2:


nohup curl --insecure --user ${UCSDUser}:${UCSDUserPassword} -T /tmp/PossibleDockerImages sftp://${UCSDIP}/tmp/PossibleDockerImages &


Commands for SSH taks #3:


nohup curl --insecure -v -X POST -g -H 'X-Cloupia-Request-Key:${UCSDKEY}' -H 'Content-Type:application/x-www-form-urlencoded' -d 'formatType=json&opName=userAPISubmitWorkflowServiceRequest&opData={"param0":"CreateLOVPossibleDockerImagesV10","param1":{"list":[{"name":"Filenamewithpath","value":"/tmp/PossibleDockerImages"},{"name":"LovName","value":"PossibleDockerImages"}]},"param2":-1}' https://${UCSDIP}/app/api/rest &






Workflow to generate the LOV:


Screen Shot 2017-11-24 at 9.16.46 AM.png

This is the same workflow as posted here (UCSD LOV Creation from CSV File) except the spaces have been removed out of the workflow variables (I did not wanted to deal wit %20 in my curl command).


End user Docker container creation (LOV has mail containers):


Screen Shot 2017-11-24 at 9.19.29 AM.png


Generating a new LOV list of python containers:


Screen Shot 2017-11-24 at 9.20.12 AM.png


End user LOV data generation:


Screen Shot 2017-11-24 at 9.24.56 AM.png



Screen Shot 2017-11-24 at 9.22.08 AM.png

Remote workflow execution and LOV creation:

Screen Shot 2017-11-24 at 9.22.17 AM.png

LOV Results:

Screen Shot 2017-11-24 at 9.24.56 AM.png

Results on the VM:

Screen Shot 2017-11-24 at 9.26.43 AM.png

The following workflows are in the zip file:

Screen Shot 2017-11-24 at 9.37.52 AM.png



Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links