- Preface
- Cisco Fabric Automation API
- Auto Configuration
- DHCP
- Power On Auto Provisioning
- Cable Plan
- DCI
- Multiple Mobility Domain with VLAN Translation
- Multiple Orchestrator Support
- Pre-Packaged Configuration Profiles
- Auto Configuration Examples
- Fabric Automation REST APIs for Openstack
- Pre-packaged POAP Templates
- POAP Examples
- vCD Sample Script
DFA REST APIs for OpenStack
Introduction
This section explains how the DFA REST APIs were used to integrate OpenStack with DFA. It’s not very different from how any application can be integrated with DFA using the DFA REST APIs.
The DFA plugins that are patched into the OpenStack, implement this documented interaction between OpenStack and DFA. The following steps explain how the Project, Network and VM creations in Openstack are communicated to DFA.
Step 1
Logon to the REST API to get a security token
This step is not seen by the Project user. See Logon to get a token.
This is the organization and partition in DFA schema terminology. See Create Project (organization and partition).
Step 3
Get the network config-profile list for a given Project.
This step is not seen by the Project user but these profiles will become available to the project user from a drop-down menu in Horizon during network creation. See Get Network Profile list.
Step 4
Create a network for that Project specifying one of the available network config-profiles. See Create a network for that Tenant.
Step 5
Get the network config-profile contents
This step is not see by the Project user. See Get the profile info.
Step 6
Launch the Virtual Machine.
The network config-profile contents will be sent to the OVS where the VM is attached. See Launch a VM.
Step 7
Logout. See log out.
Logon to get a token
https://10.77.247.111/rest/logon
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Content-Type: application/json; charset=UTF-8
Authorization: Basic YWRtaW46YWRtaW4xMjM=
Cookie: JSESSIONID=4C975316B01A44215861475E1B5F9328
Create Project (organization and partition)
The OpenStack Project name will be mapped to both Organization and Partition in DCNM.
http://10.77.247.111/rest/auto-config/organizations
POST /rest/auto-config/organizations
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Content-Type: application/json; charset=UTF-8
Dcnm-Token: NUVyu5Y0YHDv0tT6xFuIPd+Cu9OA1XCQ
Cookie: JSESSIONID=4C975316B01A44215861475E1B5F9328
"organizationName" : "organization1",
"description" : "organization1",
"orchestrationSource" : "OpenStack Controller 5",
Content-Type: application/json
Create a Partition
http://10.77.247.111/rest/auto-config/organizations/organization1/partitions
POST /rest/auto-config/organizations/organization1/partitions
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Content-Type: application/json; charset=UTF-8
Dcnm-Token: NUVyu5Y0YHDv0tT6xFuIPd+Cu9OA1XCQ
Cookie: JSESSIONID=4C975316B01A44215861475E1B5F9328
"partitionName": "partition1",
"serviceNodeIpAddress": "3.3.3.3",
"organizationName": "organization1",
"secondaryDNSServer": "20.20.20.1",
"dciExtensionStatus": "Not Extended",
"vrfProfileName": "vrf-common-universal",
"vrfName": "organization1:partition1",
"configArg": "$vrfName=organization1:partition1;
$include_vrfSegmentId=; $include_serviceNodeIpAddress=;
$include_borderLeafRt=aa4:nn;$asn="
Content-Type: application/json
The partition extension is controlled by two options (fields) in request:
When disabling extension, the 'enableDCIExtension' needs to be set 'false' or 'dciId' value to be '0'. When enabling extension, the 'eanbleDCIExtension' needs to be 'true' and 'dciId' value to be non-zero.
Get Network Profile list
Using this REST API, OpenStack gets a list of network config-profiles and display them on a Horizon dashboard pull-down menu for the project user to select one when creating a network.
http://10.77.247.111/rest/auto-config/profiles
POST /rest/auto-config/profiles
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Content-Type: application/json; charset=UTF-8
Dcnm-Token: NUVyu5Y0YHDv0tT6xFuIPd+Cu9OA1XCQ
Cookie: JSESSIONID=4C975316B01A44215861475E1B5F9328
Content-Type: application/json
"profileName": "defaultNetworkUniversalTfProfile",
"profileSubType": "network:universal"
"profileName": "defaultNetworkUniversalEfProfile",
"profileSubType": "network:universal"
"profileName": "defaultNetworkUniversalTfGblVlanProfile",
"profileSubType": "network:universal"
"profileName": "defaultNetworkUniversalEfGblVlanProfile",
Create a network for that Tenant
POST /rest/auto-config/organizations/organization1/partitions/organization1/networks
http://10.77.247.111/rest/auto-config/organizations/ organization1/partitions/organization1/networks
POST /rest/auto-config/organizations/organization1/partitions/organization1/networks
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Content-Type: application/json; charset=UTF-8
Dcnm-Token: NUVyu5Y0YHDv0tT6xFuIPd+Cu9OA1XCQ
Cookie: JSESSIONID=4C975316B01A44215861475E1B5F9328
"profileName": "defaultNetworkUniversalTfProfile",
"networkName": "organization1_net",
"networkRole": "Host Network",
"gatewayIpv6Address": "12::aa",
"configArg": "$vlanId=;$segmentId=444444;
$vrfName=organization1:partition1; $gatewayIpAddress=13.13.13.1;
$netMaskLength=24;$dhcpServerAddr=10.10.10.1;
$vrfDhcp=;$gatewayIpv6Address=12::aa;
$prefixLength=16;$mtuValue=22",
"organizationName": "organization1",
"partitionName": "partition1",
"vSwitchControllerId": "2.2.2.2",
"ipRange": "13.13.13.1-13.13.13.20"
"vrfName": "organization1:partition1"
Get the profile info
http://10.77.247.111/rest/auto-config/profiles/ defaultNetworkIpv4EfEdgeServiceProfile
GET /rest/auto-config/profiles/ POST /rest/auto-config/profiles/ defaultNetworkIpv4EfEdgeServiceProfile
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Content-Type: application/json; charset=UTF-8
Dcnm-Token: NUVyu5Y0YHDv0tT6xFuIPd+Cu9OA1XCQ
Cookie: JSESSIONID=4C975316B01A44215861475E1B5F9328
Content-Type: application/json
"profileName": "defaultNetworkUniversalTfProfile",
"profileSubType": "network:universal",
"description": "Universal profile for a network in DFA traditional forwarding mode.",
"configCommands": "vlan $vlanId\r vn-segment
$segmentId\r mode fabricpath\r interface vlan
$vlanId\r vrf member $vrfName\r ip address
$gatewayIpAddress/$netMaskLength tag 12345\r ip dhcp relay address
$dhcpServerAddr use-vrf $vrfDhcp\r ipv6 address
$gatewayIpv6Address/$prefixLength tag 12345\r fabric forwarding mode anycast-gateway\r mtu
$mtuValue\r no shutdown\r include profile any\r!",
Launch a VM
The VM launch is communicated to the OVS and LLDPad of the physical host selected by OpenStack. The VM’s information along with the associated segment ID is used for establishing a VDP session between the LLDPad and DFA leaf switch and the subsequently acquired vlan ID from VDP is used to program data flows in OVS.
log out
http://10.77.247.111/rest/logout
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Content-Type: application/json; charset=UTF-8
Dcnm-Token: NUVyu5Y0YHDv0tT6xFuIPd+Cu9OA1XCQ
Feedback