
Mastering CloudForms Automation. An Essential



Mastering CloudForms Automation. An Essential - Najlepsze oferty
Mastering CloudForms Automation. An Essential - Opis
Learn how to work with the Automate feature of CloudForms, the powerful Red Hat cloud management platform that lets you administer your virtual infrastructure, including hybrid public and private clouds. This practical hands-on introduction shows you how to increase your operational efficiency by automating day-to-day tasks that now require manual input.Throughout the book, author Peter McGowan provides a combination of theoretical information and practical coding examples to help you learn the Automate object model. With this CloudForms feature, you can create auto-scalable cloud applications, eliminate manual decisions and operations when provisioning virtual machines and cloud instances, and manage your complete virtual machine lifecycle.In six parts, this book helps you:Learn the objects and concepts for developing automation scripts with CloudForms AutomateCustomize the steps and workflows involved in provisioning virtual machinesCreate and use service catalogs, items, dialogs, objects, bundles, and hierarchiesUse CloudForm...s updated workflow to retire and delete virtual machines and servicesOrchestrate and coordinate with external services as part of a workflowExplore distributed automation processing as well as argument passing and handling Spis treści:Preface
A Brief Word on Terminology
Who Should Read This Book?
Why I Wrote This Book
Versions and Releases
Navigating This Book
Part I, Working with CloudForms Automate
Part II, Provisioning Virtual Machines
Part III, Working with Services
Part IV, Retirement
Part V, (...) więcej Integration
Part VI, Miscellaneous
Online Resources
Official Documentation
Code Repositories
Forums
Blogs
Conventions Used in This Book
Using Code Examples
Safari Books Online
How to Contact Us
Acknowledgments
I. Working with CloudForms Automate
1. Introduction to CloudForms
What Is CloudForms?
Providers
Cloud Providers
Infrastructure Providers
Configuration Management Providers
Container Providers
Mixing and Matching Providers
Company XYZ Inc.
The Capabilities of CloudForms
Insight
Control
Automate
Service catalog
Integrate
The CloudForms Appliance
Ruby and Rails
Projects, Products, and Some History
ManageIQ (the Project)
Red Hat CloudForms (the Product)
CloudForms Management Engine (the Appliance)
Summary
Further Reading
2. Introduction to the Automate Datastore
The Automate Explorer
The Automate Datastore
Domains
Domain Priority
Importing/Exporting Domains
Copying Objects Between Domains
Importing Old Format Exports
Namespaces
Classes
Schemas
Adding or Editing a Schema
Relationships
Instances
Methods
Summary
Further Reading
3. Writing and Running Our Own Automation Scripts
Creating the Environment
Adding a New Domain
Adding a Namespace
Adding a Class
Editing the Schema
Hello, World!
Adding a New Instance
Adding a New Method
Running the Instance
Exit Status Codes
Summary
4. Using Schema Variables
Preparing the Schema
The Instance
The Method
Running the Instance
Summary
5. Working with Virtual Machines
Custom Attributes
Creating the Service Dialog
Creating the Instance and Method
The Code
Creating the /System Entry Point
Running Automation Scripts from a Button
Creating the Button Group
Creating the Button
Running the Instance
Summary
Further Reading
6. Peeping Under the Hood
A Little Rails Knowledge (Goes a Long Way)
Plain Old Ruby
Model-View-Controller
Active Record Associations
Rails Helper Methods (.find_by_*)
Service Models
Service Model Object Properties
Attributes
Virtual Columns
Associations
Methods
Distributed Ruby
Summary
Further Reading
7. $evm and the Workspace
$evm.log
$evm.root
$evm.object, $evm.current, and $evm.parent
$evm.vmdb
Single-Argument Form
Two-Argument Form
$evm.execute
Examples
Creating a tag if one doesnt already exist
Sending an email
Creating a new automation request
$evm.instantiate
Summary
Further Reading
8. A Practical Example: Enforcing Anti-Affinity Rules
Task
Solution
relocate_vm
send_email
Main Code
Summary
Further Reading
9. Using Tags from Automate
Creating Tags and Categories
Assigning and Removing Tags
Testing Whether an Object Is Tagged
Retrieving an Objects Tags
Searching for Specifically Tagged Objects
Practical Example
Getting the List of Tag Categories
Getting the List of Tags in a Category
Finding a Tags Name, Given Its Description
Finding a Specific Tag (MiqAeServiceClassification) Object
Deleting a Tag Category
Summary
Further Reading
10. Investigative Debugging
InspectMe
object_walker
Black or Whitelisting Associations
object_walker_reader
Rails Console
Rails db
Summary
Further Reading
11. Ways of Entering Automate
Buttons and Simulation
RESTful API
Control Policy Actions
Alerts
Service Dialog Dynamic Elements
Finding Out How Our Method Has Been Called
Summary
Further Reading
12. Requests and Tasks
The Need for Approval
Request and Task Objects
Approval
Object Class Ancestry
Context
Object Contents
Dumping the Object Contents
The request object
The task object
Comparing the Objects
Summary
Further Reading
13. State Machines
Building a State Machine
State Machine Schema Field Columns
Value (instance)/Default Value (schema)
On Entry
On Exit
On Error
Max Retries
Max Time
State Machine Example
State Variables
Setting State Result
State Retries
Getting the State Machine Name
Getting the Current Step in the State Machine
Getting the on_entry, on_exit, on_error Status State
State Machine Enhancements in CloudForms 4.0
Error Recovery
Skipping States
Jumping to a Specific State
Nested State Machines
Saving Variables Between State Retries
Summary
Further Reading
14. More Advanced Schema Features
Messages
Specifying Our Own Messages
Assertions
Collections
Summary
15. Event Processing
Event Processing Component Parts
The Event Stream Object
The Event Switchboard
Event stream namespace
Event stream source
Event type
Event Handlers
Catching and Handling External Events
Event Catching
Event Processing
Step 1
Step 2
Step 3
Step 4
Step 5
Creating and Processing Internal Events
Step 6
Step 7
Step 8
Step 9
Step 10
Event-Initiated Control Policy Processing
Step 11
Step 12
Event-Initiated Alert Processing
Step 13
Step 14
Event-Initiated Automation Request Workflows
Step 1: The request_created Event
Step 1.1
Step 1.2
Step 1.3
Step 1.4
Step 1.5
Step 1.6
Step 2: The request_approved Event
Step 2.1
Step 2.2
Step 2.3
Step 2.4
Step 3: The request_starting Event
Step 3.1
Step 3.2
Step 3.3
Step 3.4
Step 3.5
Step 4: Automation Task Processing
Extending Automate Event Handling
Adding a New Automation Instance to /System/Event/EmsEvent/
Summary
Next Steps
II. Provisioning Virtual Machines
16. Provisioning a Virtual Machine
The Provisioning Process
Group-Specific Considerations, and Common Processing
Summary
17. The Provisioning Profile
Location
Schema
Customizing the Profile
Profile Processing in Detail
The Provisioning Dialog
VM Name (Pass 1)
Approval
Approved, pending, or denied
Quota
VM Name (Pass 2)
VM Provisioning State Machine
Summary
Further Reading
18. Approval
Approval Workflow
Request Created Event
Methods
validate_request
pending_request
approve_request
Request Pending Event
Overriding the Defaults
Template Tagging
VM ProvisioningRelated Email
Summary
Further Reading
19. Quota Management
Quotas in Cloudforms 4.0
Quota Source
Alternative Quota Sources
Defining a quota in the state machines schema (the model)
Defining a quota using tags
Quota Workflow
Summary
Further Reading
20. The Options Hash
Request Object (miq_provision_request)
Task Object (miq_provision)
Adding Network Adapters
Correlation with the Provisioning Dialog
Adding Our Own Options: The ws_values Hash
Summary
21. The Provisioning State Machine
State Machine Schema
Filling in the Blanks
Summary
22. Customizing Virtual Machine Provisioning
Scenario
Task
Methodology
Step 1: Extend the State Machine
Copy the state machine
Edit the schema
Add the new states
Adjust the sequence
Step 2: Disable Auto-Power-On
Copy the method
Edit the method
Step 3: Create Our New Instances and Methods
add_disk
start_vm
Step 4: Add Our New Instances to the Copied State Machine
Step 5: Provision a Virtual Machine
Summary
Further Reading
23. Virtual Machine Naming During Provisioning
VM Name-Related Provisioning Options
Inputs to the Naming Process
vm_name
vm_prefix
hostname
linux_host_name
sysprep_computer_name
miq_force_unique_name
Outputs from the Naming Process
vm_target_name
vm_target_hostname
Name Processing
Provisioning a Single VM or Instance
Provisioning Multiple VMs or Instances in a Single Request
Customizing the Naming Process
Summary
Further Reading
24. Virtual Machine Placement During Provisioning
Placement Methods
Method Description
Customising Placement
Using Alternative Placement Methods
Summary
Further Reading
25. The Provisioning Dialog
Tabs and Input Fields
Dialog YAML
Selection of VM Provisioning Dialog
Group-Specific Dialogs
Example: Expanding the Dialog
Copy the existing dialog
Create a group profile
Testing the provisioning dialog
Summary
Further Reading
26. Virtual Machine Provisioning Objects
Object Overview
The Provision Request Object
Request Context
Task Context
The Provision Task Object
The Source Object
The Destination Object
Summary
27. Creating Provisioning Requests Programmatically
Making the Call
Argument List
version
templateFields
vmFields
requester
tags
additionalValues (aka ws_values)
emsCustomAttributes
miqCustomAttributes
Setting Placement Options
Summary
Further Reading
28. Integrating with Satellite 6 During Provisioning
Hosts and Content Hosts
The Satellite 6 Host Entry
Non-CloudForms Preparation
Creating the Host Groups in Satellite 6
Creating the Activation Keys in Satellite 6
Adding an SSH Key to the VMware Template
Installing and Configuring Ansible on the CloudForms Appliance
Modifying the CloudForms Provisioning Workflow
RegisterSatellite
ActivateSatellite
Testing the Integration: Provisioning a New VM
Summary
Further Reading
III. Working with Services
29. Service Dialogs
Dialog Elements
Dynamic Elements
Populating the Dynamic Fields
Read-Only and Protected Elements
Programmatically Populating a Read-Only Text Box
Element Validation
Using the Input from One Element in Another Elements Dynamic Method
Example
Requirement
Solution
Summary
Further Reading
30. The Service Provisioning State Machine
Class and Instances
Passing Service Dialog Options to the Child and Grandchild Tasks
Accessing the Service Dialog Options
ConfigureChildDialog
Summary
VM Naming for Services
31. Catalog{Item,Bundle}Initialization
CatalogItemInitialization
Service Dialog Element Naming Convention
Single options hash key
Single tag
CatalogBundleInitialization
Summary
Further Reading
32. Approval and Quota
Triggering Events
Approval
Customizing Approval
Quota
Summary
33. Creating a Service Catalog Item
The Service Dialog
Finding the Correct Element Names
Searching the provisioning dialog
Examining the options hash during provisioning
Some commonly used element names
Creating the Service Dialog
Creating the Service Catalog Item
Create a Catalog
Creating the Catalog Item
Ordering the Catalog Item
Summary
Further Reading
34. Creating a Service Catalog Bundle
Creating the Service Dialog for the Bundle
Preparing the Service Catalog Items
Creating the Service Catalog Bundle
Ordering the Catalog Bundle
Summary
Further Reading
35. Service Objects
Object Structure
Service Template Provision Task
Source
Destination
Service Template Provisioning Request
Child miq_request_task
Service resource
Source
Destination
Grandchild miq_request_task
Source
Destination
Summary
36. Log Analysis During Service Provisioning
Initial Request
Profile Lookup
Request Processing and Approval
Service Template Provisioning Tasks
VM Provisioning Task
Service State Machine CheckProvisioned
VM State Machine CheckProvisioned
Virtual Machine Provision Complete
Service Provision Complete
Summary
37. Service Hierarchies
Organizing Our Services
Creating an Empty Service
State machine
Method
Service dialog
Putting it all together
Adding VMs and Services to Existing Services
Adding the Button
Button dialog
Dialog element method
Button method
Putting it all together
Summary
38. Service Reconfiguration
Reconfigure Entry Point
Service Design
Adding a Configuration Management Provider
Automate Datastore Components
Creating the Namespaces and State Machines
Email Classes
Policies
Modifying the VM Provision Workflow
Service Dialog
Elements
Instances and Methods
Dynamic Dialogs
Common functionality
ListHostGroups
ListActivationKeys
ListPuppetClasses
ListSmartClassParameters
Configuration-Related Methods
RegisterSatellite
ActivateSatellite
SetConfiguration
Testing
Summary
39. Service Tips and Tricks
Test Virtual Machine Provisioning First
Re-create the Service Item if the Template Changes
Custom State Machines
Summary
IV. Retirement
40. Virtual Machine and Instance Retirement
Initiating Retirement
Retirement-Related Attributes and Methods
VM Retirement State Machine
StartRetirement
PreRetirement/CheckPreRetirement
RemoveFromProvider/CheckRemovedFromProvider
Default
Unregister
FinishRetirement
DeleteFromVMDB
Summary
Further Reading
41. Service Retirement
Defining a Service Retirement Entry Point
Initiating Retirement
Retirement-Related Attributes and Methods
Service Retirement State Machine
StartRetirement
RetireService/CheckServiceRetired
FinishRetirement
DeleteServiceFromVMDB
Summary
V. Integration
42. Calling Automation Using the RESTful API
API Entry Point
Returning Results to the Caller
Authentication and auto_approve
Zone Implications
run_via_api
Summary
Further Reading
43. Automation Request Approval
Implementing a Custom Approval Workflow
Namespace
Group Profile
State Machine
Instances
Methods
Email Classes
Policies
AutomationRequest_created
AutomationRequest_pending
Testing
Summary
44. Calling External Services
Calling a SOAP API Using the Savon Gem
Calling an OpenStack API Using the fog Gem
Reading from a MySQL Database Using the MySQL Gem
Summary
Further Reading
VI. Miscellaneous
45. Distributed Automation Processing
Nondistributed Automation Operations
Distributed Automation Operations
Tracing Queueing/Dequeueing Operations
Detailed Queue Analysis
Monitoring the Queue During an Automation Operation
Troubleshooting
Summary
46. Argument Passing and Handling
Case 1: Calling from a Button
Case 2: Calling from the RESTful API
Case 3: Calling from a Relationship or Automate Datastore URI
Case 4: Passing Arguments via the ws_values Hash During a VM Provision
Passing Arguments When Calling a Method in the Same Class
Summary
47. Miscellaneous Tips
Updating the Appliance
The ManageIQ Coding Style and Standards Guide
Defensive Programming
Catch Exceptions
Use an External IDE
Version Control
Use Configuration Domains
Summary
Index mniej
Mastering CloudForms Automation. An Essential - Opinie i recenzje
Na liście znajdują się opinie, które zostały zweryfikowane (potwierdzone zakupem) i oznaczone są one zielonym znakiem Zaufanych Opinii. Opinie niezweryfikowane nie posiadają wskazanego oznaczenia.