cloud forms automate integration and orchestration · pdf filecloud forms automate integration...

28
Cloud Forms Automate Integration and Orchestration David Simmons, Principal Solutions Architect Kevin Morey, Senior Solutions Architect Red Hat

Upload: vanbao

Post on 06-Mar-2018

251 views

Category:

Documents


8 download

TRANSCRIPT

Page 1: Cloud Forms Automate Integration and Orchestration · PDF fileCloud Forms Automate Integration and Orchestration David Simmons, Principal Solutions Architect Kevin Morey, Senior Solutions

Cloud Forms Automate Integration and Orchestration

David Simmons, Principal Solutions ArchitectKevin Morey, Senior Solutions Architect

Red Hat

Page 2: Cloud Forms Automate Integration and Orchestration · PDF fileCloud Forms Automate Integration and Orchestration David Simmons, Principal Solutions Architect Kevin Morey, Senior Solutions

Standard Provisioning Workflow

CloudForms 3The Phases of CFME Automate VM Provisioning

Step1: Build Request

Step2: Request Approval

StateMachine

Step3: Quota Validation

Step4: Provisioning

Page 3: Cloud Forms Automate Integration and Orchestration · PDF fileCloud Forms Automate Integration and Orchestration David Simmons, Principal Solutions Architect Kevin Morey, Senior Solutions

Standard Provisioning Workflow

User clicks on Lifecycle / Provision

/System/Request/UI_Provision_Info

Depending on the template chosen will determine the dialog that is loaded

Default profile .missing instance will be used

Group profile instance will be used

No

If group instance exists?Yes

Lookup provisioning dialog (Note: Dialogs are located in Automate /

Customization

Set initial VM name

Step2

Page 4: Cloud Forms Automate Integration and Orchestration · PDF fileCloud Forms Automate Integration and Orchestration David Simmons, Principal Solutions Architect Kevin Morey, Senior Solutions

Standard Provisioning Workflow

NoYesSynthetic event MiqProvisionRequest is raised

Validate Request?

Send email to user and approver that request is pending

Send email to end user that the request has been approved

Approver approves or denies Request?

Send email to user that Request is denied

No

Yes

Step3

Page 5: Cloud Forms Automate Integration and Orchestration · PDF fileCloud Forms Automate Integration and Orchestration David Simmons, Principal Solutions Architect Kevin Morey, Senior Solutions

Standard Provisioning Workflow

Synthetic even MiqProvisionRequest starting is raised

Validate quotas?

No

Yes

Yes

Send email to user that Request is denied

Step4

Set VM name

Page 6: Cloud Forms Automate Integration and Orchestration · PDF fileCloud Forms Automate Integration and Orchestration David Simmons, Principal Solutions Architect Kevin Morey, Senior Solutions

Standard Provisioning Workflow

Create Provision Task

Get the StateMachine Class and Instance name

Begin Provision StateMachine

Map any customization specifications and templates

(ks.cfg)

Set VLAN, notes & annotations and vCenter

folder

Execute Task

Step4.1

Page 7: Cloud Forms Automate Integration and Orchestration · PDF fileCloud Forms Automate Integration and Orchestration David Simmons, Principal Solutions Architect Kevin Morey, Senior Solutions

Standard Provisioning Workflow

best_fit_with_scope (VMware), best_placement_with_scope

(RHEV), best_fit_availability_zone (EC2 & RHOS),

CheckProvisioned checks to ensure that the VM is created

Perform any post provisioning tasks here

Eamil user that VM provisioning job is complete

Page 8: Cloud Forms Automate Integration and Orchestration · PDF fileCloud Forms Automate Integration and Orchestration David Simmons, Principal Solutions Architect Kevin Morey, Senior Solutions

Standard Provisioning Workflow

Page 9: Cloud Forms Automate Integration and Orchestration · PDF fileCloud Forms Automate Integration and Orchestration David Simmons, Principal Solutions Architect Kevin Morey, Senior Solutions

Now Let’s Change the Workflow and Integrate!

Page 10: Cloud Forms Automate Integration and Orchestration · PDF fileCloud Forms Automate Integration and Orchestration David Simmons, Principal Solutions Architect Kevin Morey, Senior Solutions

IP Address Management - Infoblox Example

Change the Instance Reflecting new Method

Alter “Provision VM from Template”

Page 11: Cloud Forms Automate Integration and Orchestration · PDF fileCloud Forms Automate Integration and Orchestration David Simmons, Principal Solutions Architect Kevin Morey, Senior Solutions

IP Address Management - Infoblox

Remove Blank Value then point to new Instance

Page 12: Cloud Forms Automate Integration and Orchestration · PDF fileCloud Forms Automate Integration and Orchestration David Simmons, Principal Solutions Architect Kevin Morey, Senior Solutions

IP Address Management - Infoblox

Create the Method

Create the Instance

Page 13: Cloud Forms Automate Integration and Orchestration · PDF fileCloud Forms Automate Integration and Orchestration David Simmons, Principal Solutions Architect Kevin Morey, Senior Solutions

IP Address Management - Infoblox

prov = $evm.root["miq_provision"]

Create new object “prov” from EVM.ROOT MIQ_PROVISION

prov.set_option(:sysprep_spec_override, 'true')

Override Sysprep Options

prov.set_option(:addr_mode, ["static", "Static"])

Set IP Address to Static

prov.set_option(:ip_addr, "#{ipaddr}")

Set IP Address

What does Cloud Forms Need during Provisioning?

Page 14: Cloud Forms Automate Integration and Orchestration · PDF fileCloud Forms Automate Integration and Orchestration David Simmons, Principal Solutions Architect Kevin Morey, Senior Solutions

IP Address Management - Infoblox

prov.set_option(:subnet_mask, "#{netmask}")

Set NetMask

prov.set_option(:gateway, "#{gateway}")

Set Gateway

prov.set_option(:vm_target_name, "#{hostname}")

Set Target Name *** This is the Display Name within Virtual Center and RHEV ***

prov.set_option(:linux_host_name, "#{hostname}")

Set Host Name *** Host Name of Linux VM ***

What does Cloud Forms Need during Provisioning?

Page 15: Cloud Forms Automate Integration and Orchestration · PDF fileCloud Forms Automate Integration and Orchestration David Simmons, Principal Solutions Architect Kevin Morey, Senior Solutions

IP Address Management - Infoblox

Include the required gems

require 'rest_client‘

Obvious

require 'json‘

JSON Data Structure

require 'nokogiri‘

XML Parser

require 'ipaddr‘

Human Readable IP String

Ok, What’s the REST Call look like?

Page 16: Cloud Forms Automate Integration and Orchestration · PDF fileCloud Forms Automate Integration and Orchestration David Simmons, Principal Solutions Architect Kevin Morey, Senior Solutions

IP Address Management - Infoblox

url = 'https://myinfobloxserver/wapi/v1.2.1/network’dooie = RestClient.post url, :_function => 'next_available_ip', :num => '1'doc = Nokogiri::XML(dooie)root = doc.rootnextip = root.xpath("ips/list/value/text()")$evm.log("info", "GetIP --> NextIP is - #{nextip}")return nextip

ipaddr = nextip

Ok, What’s the REST Call look like?

VOILÀ Use ipaddr in the afore-mentioned prov values to Set the IP Address delivered from InfoBlox!

Page 17: Cloud Forms Automate Integration and Orchestration · PDF fileCloud Forms Automate Integration and Orchestration David Simmons, Principal Solutions Architect Kevin Morey, Senior Solutions

CloudForms – Flexing workloads

Page 18: Cloud Forms Automate Integration and Orchestration · PDF fileCloud Forms Automate Integration and Orchestration David Simmons, Principal Solutions Architect Kevin Morey, Senior Solutions

Flexing Workloads - Problem

Our web application must be able to automatically flex during peak times.

Page 19: Cloud Forms Automate Integration and Orchestration · PDF fileCloud Forms Automate Integration and Orchestration David Simmons, Principal Solutions Architect Kevin Morey, Senior Solutions

Flexing Workloads - Solution

Using CloudForms we can leverage real-time performance metrics along with automation to auto-scale our application and provide optimum performance for our customers

Page 20: Cloud Forms Automate Integration and Orchestration · PDF fileCloud Forms Automate Integration and Orchestration David Simmons, Principal Solutions Architect Kevin Morey, Senior Solutions

Flexing Workloads – Create Service Dialog

① Create a Service Dialog

① Add more options if you like

① Add flex monitor/maximum tags

3

2

1

Page 21: Cloud Forms Automate Integration and Orchestration · PDF fileCloud Forms Automate Integration and Orchestration David Simmons, Principal Solutions Architect Kevin Morey, Senior Solutions

Flexing Workloads – Create Service Catalog Item

① Create a new service catalog item

① Point the catalog item to your Service Flex Dialog

① Make the Entry Point ServiceFlex_CatalogItemInitialization

1

2

3

Page 22: Cloud Forms Automate Integration and Orchestration · PDF fileCloud Forms Automate Integration and Orchestration David Simmons, Principal Solutions Architect Kevin Morey, Senior Solutions

Flexing Workloads – Provision Service Flex

① Order a service flex

① Set Service Flex Monitor to true

① Set the Flex Maximum

1

2

3

Page 23: Cloud Forms Automate Integration and Orchestration · PDF fileCloud Forms Automate Integration and Orchestration David Simmons, Principal Solutions Architect Kevin Morey, Senior Solutions

Flexing Workloads – Review Service Tags

① serviceflex_current: Current number of flexes for this service

① serviceflex_maximum: Maximum number of flexes for this service

① serviceflex_monitor: True means that this service is flexible

① serviceflex_pending: Number of VMs currently provisioning

1

3

2

4

Page 24: Cloud Forms Automate Integration and Orchestration · PDF fileCloud Forms Automate Integration and Orchestration David Simmons, Principal Solutions Architect Kevin Morey, Senior Solutions

Flexing Workloads – Alert Driven Event or ad hoc① Create a new Alert profile I.e.

“ServiceFlex: CPU % Used > 50”

① Assign the Alert profile to an infrastructure item

① When this alert is triggered it will flex a new VM into the Service using the same parameters as the previous VM and sets a custom attribute on the flexed VM's summary page that shows why the VM was flexed.

① Or alternatively execute the Service Flex button on your Flex Monitored VM for ad hoc flexing

1

3

2

4

Page 25: Cloud Forms Automate Integration and Orchestration · PDF fileCloud Forms Automate Integration and Orchestration David Simmons, Principal Solutions Architect Kevin Morey, Senior Solutions

Flexing Workloads – A Look at Automate

① ServiceFlex_CatalogItemInitialization: (Service dialog -processes service dialog options and creates tags)

① ServiceFlex_Processing: (Alert - provisions new VMs using parent VM parameters)

① ServiceFlex_AddToService: (Provisioning - adds new VMs to the parent service)

① ServiceFlex_RemoveFromService: (Retirement – removes VM from the parent service)

4

3

2

1

Page 26: Cloud Forms Automate Integration and Orchestration · PDF fileCloud Forms Automate Integration and Orchestration David Simmons, Principal Solutions Architect Kevin Morey, Senior Solutions

Flexing Workloads – How the Sausage is Made

# ServiceFlex_Processing

# Get vm object from rootvm = $evm.root['vm']

# Get miq_provision from vmprov = vm.miq_provision

# Get the serviceflex_monitor tag from the vmserviceflex_monitor = vm.tags(:serviceflex_monitor).first

If $evm.root['object_name'] == 'Event'args = "name=#{prov.vm_template.name}args += "vm_name=#{new_vm_name}”args += "|cores_per_socket=#{prov.get_option(:cores_per_socket)}"args += "|vm_memory=#{prov.get_option(:vm_memory)}”args += "|vlan=#{prov.get_option(:vlan)}”args += “serviceflex_reason=#{$evm.root['miq_alert_description']}”$evm.execute('create_provision_request', *args)

Page 27: Cloud Forms Automate Integration and Orchestration · PDF fileCloud Forms Automate Integration and Orchestration David Simmons, Principal Solutions Architect Kevin Morey, Senior Solutions

Flexing Workloads – How the Sausage is Made

# ServiceFlex_AddToService

# Get miq_provision from rootprov = $evm.root['miq_provision']

# Get vm object from miq_provisionvm = prov.vm

# Add vm to parent servicevm.add_to_service(parent_service)

# Tag the parent service reducing the pending tag by 1parent_service.tag_assign("serviceflex_pending/#{serviceflex_pending-1}")

# Add custom attribute serviceflex_reason => serviceflex_reason to VMvm.custom_set(:serviceflex_reason, serviceflex_reason].to_s)

Page 28: Cloud Forms Automate Integration and Orchestration · PDF fileCloud Forms Automate Integration and Orchestration David Simmons, Principal Solutions Architect Kevin Morey, Senior Solutions

Flexing workloads - DEMO