You are on page 1of 85

Extending Cisco UCS Director

with Orchestrator, APIs and the


Open Automation Framework
Phani Penmethsa, Technical Marketing Engineer

BRKDCT-1456
Agenda

• Cisco UCS Director Overview


• Extending UCS Director
• Orchestrator
• Demos
• Programmability
• Custom Tasks
• APIs
• Open Automation

• Conclusion

3
Focus of This Session

Features Tools Automation Skills


w/ UCS Director Automated
Workflows to
Provide IT
Services

4
Cisco UCS Director
Overview

5
Complex IT Processes to Deploy Application
Resources
Challenges: 1 6

Server Admins
Requirements
Application
Setup Bare metal Configure
• Disparate management systems

Business
Servers Provisioning Servers

• Infrastructure inefficiency Create Storage


Resources
Create
VLAN
Add VLAN to
Service Profile

• Under utilization
3
2

Network Adm
• Manual processes IT
Planning
Add Users
and Groups 5 Create
VLANs
Update
Trunks
• High operational cost Define Create Create UCS Configure
Approvals Network Policies Service Profiles SAN Zoning
Cost Models
• Rigid silos

4 Create Create Add vFilers

Storage
IP space vFilers to Group
VM provisioning under 5 minutes
Map Create UCS Blade
Physical Infrastructure provisioning How Long? NetApp LUN Storage Policy Power On

7
Introducing Cisco UCS Director
Enabling Enterprise Private Clouds
Web Business Critical Dev./Test
UCS Director Apps Apps Sandboxes

Bare- Bare- Web App Web Web DB


Metal Metal
Hyper-V/KVM
Network Bare-Metal HYPERVISOR HYPERVISOR
Cisco UCS
HP, Dell
Compute Network =

L4-7
Storage L4-7
Storage
Physical Virtual
8
Cisco UCS Director Solution Overview
 LDAP, Single Sign On
 RBAC
 IT Ticketing Systems
Tenant  CMDB,
Admins Operators
Users  Metering/Chargeback
Self Service Admin System
REST API
Web Portal Web Console Integration

UCSD Unified Infrastructure Controller


Cisco UCS Director
Multi-tenant & integrated cloud platform

Open
Automation Integrated Multi-tenant Cloud Platform
Framework

Custom Connector Storage Network


Server Managers APIs Manager vCenter SCVMM RHE-VM
3rdParty UCS
Nexus
Device

Physical Infrastructure Cloud Infrastructure


Broad Multi-Vendor Infrastructure Support
UCS Director

Converged VM L4-L7 Compute Network Storage

vASA, Nexus
CSR1000v MDS

VBLOCK FlexPod
200, 300, Data Center
700
FlexPod
VPLEX Express

10
Key Use Infra.
Application Cases
provisioning with UCS-Director : 100% VMs
Infrastructure Provisioning for Applications : 100% Virtual & Mixed

Rapid deployment of Application Ready Infrastructure as a Express Offering for


Integrated Infrastructure Infrastructure Service (IaaS) BigData Applications
Orchestrator and
Workflows

15
Introducing Orchestration and Workflows
my-workflow  Suspend/Resume Workflow
Start
 Rollback Workflow
Storage Task-1
 Approvals
Network Task-2  Complex logic (loops, if-else)

Compute Task-3  Import/Export, Versioning


UCS
 Schedules
Virtualization Task-4
 Custom Workflow Input Types

End  Publish to Catalog


16
Workflow Fundamentals
Legend
Rapid Orchestration with Input/Output Chaining Workflow
Tenant Inputs
User Task
Inputs
Workflow Workflow Task
Inputs Outputs
Inputs
Admin I/O
Chaining

Inputs Inputs
Outputs Inputs

Task-1 Task-2

Workflow
Task Library – 1500+ Tasks
What is a Task

• Atomic Operation performed on a


UCS Tasks
Managed Node • Modify UCS Boot Policy LUN ID
• Select UCS Server • Clone UCS Boot Policy
• Building block to perform a complex • Reset UCS Server • Modify UCS Boot Policy WWPN
• Power On UCS Server • Add VLAN
operation • Power Off UCS Server • Delete UCS Boot Policy
• Create UCS Service Profile from • Delete UCS VLAN
Task Library Template • Add VLAN to Service Profile
• Create UCS Service Profile • Add iSCSI vNIC to Service Profile
• Compute, Network, Storage, L4-L7, • Select UCS Service Profile • Add vNIC to Service Profile
• Modify UCS Service Profile Boot • Delete vNIC from Service Profile
Virtualization tasks are in the library Policy • Create Service Profile iSCSI Boot
• Delete UCS Service Profile Policy
• Device support provides Task Library • Associate UCS Service Profile • Modify Service Profile Boot Policy to
• Disassociate UCS Service Profile Boot from iSCSI
• Create Custom Tasks to extend • Create UCS Boot Policy
functionality

18
Drag ‘n Drop Workflow Creation
Orchestration, Workflow and Tasks Defined

20
Drag ‘n Drop Workflow Creation
Orchestration, Workflow and Tasks Defined

21
Deliver IT Services within Minutes with Workflows

 Single-click provisioning

 Intelligent resource allocation

Result:
 Improved time to market

Minutes
170+ Workflows, Tasks, Tutorials on Community Site
https://communities.cisco.com/docs/DOC-56419
Introducing Workflow Rollback
What is Rollback
• De-Provision Infra resources
• State-aware, Model-aware
• Reverse-order of execution
Use Cases
• Proof of concepts
• DR Testing
• Resource de-allocation on
customer termination
https://communities.cisco.com/docs/DOC-55502
Real World Scenario
Virtualization Admin Mark requesting Cloud admin John for New NFS Datastore in his ESXi
Cluster
Mark John
Virtualization Admin Cloud Admin

Mark: Hello John,


“I need a new
NFS Datastore
on my ESXi
Cluster”

John: Hey Mark, sure


its easy. Just login
into the self-service
portal, and specify
the name and size.
That’s it you will have
it minutes
Modeling the Requested IT Service as a Workflow
Use case: Add a New NFS Datastore to ESXi Cluster
Environment

① START
UCS C-mode 8.2 vSphere 5.5 ② Create Volume
③ Create Mount Point
Tenant User Specified Inputs
Datastore Name ④ Mount Volume as NFS
Datastore Size in GB Datastore

Admin Specified Inputs ⑤ COMPLETED


NetApp vServer, Aggregate, Mount Path
ESXi Cluster Nodes
High-level Procedure to build our Workflow
1. Add Workflow
2. Specify Workflow Inputs
3. Add Tasks to the Workflow
4. Specify values for Inputs
5. Map Inputs/Outputs
6. Validate the Workflow
7. Test the Workflow
8. Publish to Catalog
Infrastructure as a Service
1. Execute the Workflow
2. Rollback the Workflow
3. Publish Workflow to Catalog
Demo
4. Tenant User Invokes the
Workflow Orchestration in Action

29
30
31
Custom Inputs for Workflows – List of Values (LOVs)
Pre-Defined list of Datastore Sizes

LOV Tutorial
https://communities.cisco.com/docs/DOC-55871
Implementing Complex Logic in Workflows
Path-2
True False
Path-1 Path-3
If-Else
Conditional

Lists Failed
Failed
Counts

Start
Start Start

Power Status
Start Loop n=5 If Else
Conditional

VLAN test
VM Power
Action
Add VLAN Delete VLAN
OFF ON DELETE
End Loop

End
End End
Advanced Orchestration Features
Activities
Generalize IT Operations

Triggers
Corrective actions in response to monitoring conditions

Compound Workflow
Leverage existing workflows to build complex workflows

Custom Input Types


Easily create new variable and data types to meet your needs

Custom Tasks
Create new tasks to build Workflows to deliver business specific IT services
Extending UCS Director
Various Options – Where to start, Where to end?

Custom Tasks

Southbound
SSH Tasks
APIs

PowerShell
REST APIs Workflows
Agents

Open Northbound
Automation Custom APIs
Workflows
UCS Director Extensibility Model
An option for every customization level, and skill level

Southbound APIs
• Open Automation

Northbound APIs
Implementation • REST
Skill Level • PowerShell
Custom Tasks
• Javascript
Generic Tasks
• SSH
• PowerShell

OOTB Task Library


• Workflow designing

Customization Level
Generic Tasks

39
SSH Tasks
Overview

Description

• CLI commands executed on remote system by UCS-D on you behalf

Suitable for

• UCS Director admin have CLI access (password, credentials etc)


• Prior investment in shell scripts

Skillset

• BASH, Vendor dependent CLI

Usage & Example

• Kick-off processes, legacy applications, un-supported hardware


SSH Tasks
Implementation
Create a workflow

Add workflow task


[Type = SSH Command]

Define Inputs

Hostname & Creds

Command list

Execute workflow
PowerShell Scripts
Invoke through “Executed PowerShell Command” Task

Description

• Launch PowerShell scripts from UCS Director

Environment

• Microsoft “heavy” environments


• Prior investment in PowerShell scripting

Skillset

• PowerShell, Windows, UCS Director

Usage & Example

• Add a host to additional domains or DNS systems


Introducing PowerShell Agents (PSA)
Script Servers to Relay and Execute PowerShell Scripts Default TCP Port: 43891
PSA runs as a Windows Service
Enable Remote Shell
Enable Remote Management

MS-Domain-1 PSA

UCS Director

MS-Domain-2

PSA need not be on every node, not like a host/SNMP agent


PowerShell Agent Deployment Process
Install, Configure and Add to UCS-Director

winrm quickconfig
winrm g winrm/config
Install Cisco PSA Add to Workflow
winrm set winrm/config/client
@{TrustedHosts="*"}

Configure Windows
• Enable WinRS &
WinRM Test PowerShell
• Configure Firewall

Add Agent to UCS-D Test Connection


PowerShell Script Execution
Example

VDC
Windows
VM
Process state
Firewall policy

Policy
Audit
Generic Tasks Summary
SSH Task
Executed CLI commands on remote system in SSH session

PowerShell Task
Execute PowerShell commands on remote system through PSA
Custom Tasks

47
Custom Tasks
Overview
Description

• Combination of JavaScript + UCS Director Libraries


• Have pre-defined Inputs/Outputs
• Have “look and feel” of normal UCS-D Workflow tasks

Environment

• Wherever custom tasks are needed

Skillset

• Java, JavaScript, UCS Director

Usage & Example

• Used to extend OOTB task library as needed


Custom Task Overview Sample Script to Resize VM Disk

importPackage(java.util);
UCS Director Runtime importPackage(com.cloupia.model.cIM);

function resizeVmDisk(vmIdStr, diskName, sizeInGB)


DB Inventory Libraries {
var vmId = Integer.parseInt(vmIdStr);
var vmContext = util.createContext("vm",
null, vmIdStr);

Java API // obtain VM details


var vminfo = ctxt.getAPI().getVMwareVMInfo(vmId);
logger.addInfo("About to resize VM "+ vmIdStr
name="+vmname);
var status = ctxt.getAPI().performAction(
vmContext,
Custom Task Code "diskResize",
"Resize VM Test”,
• Javascript ctxt.getUserId(),
paramarr);
• Cloupia Libraries logger.addInfo("status = "+status);
}
• API to access to UCS-D
var vmidstr1 = ctxt.getInput("VMID");
resizeVmDisk(vmidstr1, "Hard Disk 1", "10");
Inputs Outputs
Custom Task Examples
• Get Static IP Pool Policy Attributes
• Get Mail Settings
• Invoke Service Request from Task
• LOV of Current Users
• Custom SSH with Rollback
• Move ESXi host to another cluster
• VM deployment using Infoblox as the IPAM

50
Reusing Code and Libraries in Custom Tasks
using Script Modules

Benefits
• Re-use Javascript functions
• Leverage Java JAR file libraries

Sample Script
loadLibrary("myModule/myFunctions");

logger.addInfo("Catalog Name: "


+catalogNameFromID(18) );
Using Cloupia Script Interpreter for Dry-Runs and Troubleshooting
Custom Tasks Summary

Custom Tasks
Extend the task library with a new task written in JavaScript
Northbound API

60
Northbound APIs
About

Northbound Integrations Enable:


• Invoke pre-built operations
• Application integration [Use it!] REST
• Launch Workflows and tasks
• Access reports for:
• Physical infrastructure
• Virtual devices
PowerShell
• Network and Storage devices
• Users, Groups, Policies, Admin functions
Northbound APIs
Overview

Start New SR Workflow SR Complete End

Approvals Task 1 REST APIs … Task N


Director
UCS

Orchestration Engine

Cisco UCS
Physical Infrastructure Virtual Infrastructure
Cisco Nexus

VMware Hyper-V KVM

Service Now
REST APIs
Supported Protocols/Formats

• Supported Protocols and Formats Java


JSON, XML & Java

• JSON (JavaScript Object Notation) XML


 Consistent Data Format
 Unordered set of name/value pairs JSON
{"vdcName":"vDC with API", "vdcDescription":”vDC Demo”,“vdcId”:123}
REST API
Operations
• Login • LOVProvider
• UserAccount • PaymentStatus
• Report • ResourceAccountingandLimits
• Approval • ServiceContainer
• Catalog • ServiceRequest
• Chargeback • Task
• Funds • VDC
• Group • VMO
• Inventory • Workflow
Getting Started – Access Key and API Browser

REST API Browser


User account for API
access
REST APIs
3000+ API Operations
REST APIs
Using the REST API Browser

https://developer.cisco.com/site/ucs-director/rest-api-guide/
REST APIs
Example: Getting the list of all VMs

Using REST Easy with Firefox


Add API Access key  customer HTTP
headers
Standard HTTP Response codes
REST APIs
Dissecting the JSON Request

http://172.31.240.203/app/api/rest?formatType=json&opName=userAPIGetAllVMs&opData={}

Params
UCS Director IP address Format type = JSON API Operation
{None}

RESPONSE (RAW)
{ "serviceResult":{"rows":[{"Cloud":"MGMT-2-
VMWare","Request_ID":0,"VM_ID":1,"VM_Label":"","Instance_ID":"tme-mgmt-2-
vCenter","Host_Name":"mgmt-2-vcenter","IP_Address":"172.31.240.202","Image_Id":"tme-mgmt-
2-vCenter","Power_State":"ON","vDC":"Default vDC","Category":"Discovered
VM","Provisioned_Time":"","Scheduled_Termination_Time":"","Guest_OS_Type":"SUSE Linux
Enterprise 11 (64-bit)","Assigned_To_User":""}
REST APIs
So What about Java?

import java.util.Collection;
import java.util.List;
import java.util.HashMap;
import java.util.Map;

import com.cisco.cuic.api.client.CuicServer;
import com.cisco.cuic.api.client.UserAPIGlobal;
import com.cisco.cuic.api.client.APITabularReport;

public static void main(String[] args) {

/*
* Fill-in the Cuic Server info.
*/
CuicServer server =
CuicServer.getAPI("<IP address>",
"<REST Key>", "https", 443);

UserAPIGlobal instance = new UserAPIGlobal(server);


APITabularReport obj = instance.userAPIGetAllVMs();
}
Real Examples: Invoking a Workflow from APIs
Approach-1: REST API
Sample Workflow
Inputs:
• Volume Name
• Volume Size
(GB)
• iGroup Name

https://communities.cisco.com/docs/DOC-55973
https://communities.cisco.com/docs/DOC-57426
REST API Request
POST to URL
REST API Response
• REST API responds with the Service Request ID

{
"serviceResult": 531,
"serviceError": null,
"serviceName": "InfraMgr",
"opName”:"userAPISubmitWorkflowServiceRequest"
}

73
REST API Execution
PowerShell API
Introduction

• Northbound integration with UCS • Benefits


Director  Easy adaptation
 Integrate with existing
• REST APIs are wrapped inside PS automation framework
CmdLets  Quicker ROI
 All the benefits of REST in
• Secure access based on access key
“Windows environment”
PowerShell APIs
Getting Started…
UCS Director PowerShell Launch shell
Installation Wizard (Windows 2012)

Verify CiscoUcsdPS
module is installed
PowerShell API – Available Command Set
Get-Command –Module CiscoUCSDPS

Invoke-userAPICancelServiceRequest Invoke-userAPIGetServiceRequestDetails
Invoke-userAPIExecuteVMAction Invoke-userAPIGetServiceRequests
Invoke-userAPIGetAllCatalogs Invoke-userAPIGetServiceRequestWorkFlow
Invoke-userAPIGetAllGroups Invoke-userAPIGetTabularReport
Invoke-userAPIGetAllVDCs Invoke-userAPIGetVMActionRequests
Invoke-userAPIGetAvailableReports Invoke-userAPIGetWorkflowInputs
Invoke-userAPIGetHistoricalReport Invoke-userAPIGetWorkflowInputValue
Invoke-userAPIGetInstantDataReport Invoke-userAPIGetWorkflowInputValues
Invoke-userAPIGetPage Invoke-userAPIGetWorkflows

77
PowerShell API
Getting Started
Register the API Access Key:
[Environment]::SetEnvironmentVariable("UCSD_SERVER","10.1.1.1","User")
[Environment]::SetEnvironmentVariable("UCSD_RESTKEY","562FDF763A384E78B9BAB7FE02CA13B6"
,"User")
Verify:
API Access Key
[Environment]::GetEnvironmentVariable("UCSD_RESTKEY","User")
PowerShell API
Example Invoke-userAPIGetWorkflows
Northbound APIs Summary

REST APIs
Perform application integrations with JSON, XML and Java bindings

PowerShell APIs
PowerShell wrappers over REST API to integrate with Microsoft environments
Open Automation
Framework

81
Extending UCS Director to Support 3rd Party
Infrastructure

Cisco UCS Director

Out of the box Integrations Partner/ISV Developed


Integrations

VMware

3rd Party
Hyper-V
Infrastructure

82
Introducing Open Automation Framework
Open API and SDK to build custom integrations to support 3rd Party Infrastructure

Cisco UCS Director

Out of the box Integrations Open Automation


Framework

VMware

Hyper-V
Capabilities in Open Automation based Integrations
• 3rd Party infrastructure support
• Task Library for usage in workflow automation
• Life Cycle Management
• Custom Account Type, Pod
• Inventory, Configuration, Provisioning, Monitoring Triggers

• GUI
• New Menu Items
• Reports
• Tabular, Summary, Pie Charts
• CloudSense® On-demand Reports

84
Developing Open Automation Connector

Download Implement Upload the Add Test the


SDK/API Module Module Account Integration

85
Partner Ecosystem
Examples

86
NimbleStorage SmartStackTM Support in UCS Director using Open
Automation
Use Cases

1. Converged SmartStack
Management
Cisco UCS + Nimble
Storage CS Series
Platform

SmartStack 2. Automated Day-1 SmartStack


Storage Operations
New storage
Grow storage
Remove Storage
Data protection
Rapid production
environment cloning

SmartStackTM
UCS Director Integration with ServiceNow using RESTful APIs and
Open Automation

ServiceNow Service Catalog


Start Additional workflows such as End
Service Approvals
Request CMDB Tasks etc.

by
RESTful APIs

Start UCS Director Orchestration (Workflows, Catalog) End

Cisco UCS
Physical Infrastructure Virtual Infrastructure
Cisco Nexus

VMware Hyper-V KVM


ServiceNow Catalog with Orderable Services from
UCS Director
Open Automation Framework Summary
Open Automation Framework
Open Southbound API & SDK to extend support to new or 3rd party devices
Resources

91
Cisco UCS Director Community Workflows Index

https://communities.cisco.com/docs/DOC-56419
Developer Network (DevNet) for Cisco UCS Director

https://developer.cisco.com/site/ucs-director/overview/
Steps to Get Your Device Supported and Certified in Cisco UCS Director
1. Register Register as a Cisco Solution Partner @ http://solutionpartner.cisco.com/

Download SDK and Documentation


2.Download https://developer.cisco.com/site/data-center/converged-infrastructure/ucs-director/sdk-downloads/

3.Order Order NFR License – Member benefit for registered Solution Partners

4.Develop Design and Develop Custom Connector to your Device

5.Validate Test and Validate the Connector

6.Submit Submit the Connector module for IVT verification and validation

7.Certify Apply for formal connector certification by Cisco

Publish the software, collateral, white papers and other assets to Market place
8.Publish https://marketplace.cisco.com/catalog

9.Support Support and maintain the connector


Key Takeaways
Cisco UCS Director offers Extensive Functionality Out of The Box
1800+ Task Library to Orchestrate Workflows and build IT Services rapidly

Cisco UCS Director is Extensible to Meet your needs


Comprehensive extensibility framework allows you build new functionality rapidly

1. Orchestrator
IT service delivery with Workflows and Custom Tasks

2. Northbound APIs
REST and Powershell API allow integrate with IT systems

3. Open Automation Framework


Add new or 3rd party device support with open Southbound API
Call to Action
 Learn More About Cisco UCS Director
http://www.cisco.com/go/ucsdirector

 Try out Cisco UCS Director


• For Customers: Order Eval License - http://cisco.mediuscorp.com/ucsdeval
• For Partners, Developers, ISV: Order NFR License - http://cisco.mediuscorp.com/ucsd

 Visit Cisco UCS Director Community Website for Workflows/Custom Tasks


https://communities.cisco.com/community/technology/datacenter/ucs_management/cisco_ucs_develo
ped_integrations/content?filterID=contentstatus[published]~category[ucs-director-workflows]

 Visit Cisco UCS Director DevNet Site and Start Developing


https://developer.cisco.com/site/ucs-director/overview/

96
Call to Action
• Attend the Breakout Session on ACI
BRKACI-2410
Intermediate - End-to-End Application-Centric Infrastructure Automation with UCS Director

• Visit the World of Solutions for


• Cisco Campus
• Walk in Labs
• Technical Solution Clinics

• Meet the Engineer


• Lunch and Learn Topics
• DevNet zone related sessions
Complete Your Online Session Evaluation
• Please complete your online session
evaluations after each session.
Complete 4 session evaluations
& the Overall Conference Evaluation
(available from Thursday)
to receive your Cisco Live T-shirt.

• All surveys can be completed via


the Cisco Live Mobile App or the
Communication Stations
Thank you

99

You might also like