Automate Roadmap
Madhu Kanoor 
Automate Team 
mkanoor@redhat.com
Agenda 
Background 
Recent changes 
Future Plan 
Q & A
Background 
Automate is a ManageIQ toolset used to 
1. Extend the product to implement customer specific requirements 
2. Update the behavior of the different workflows in the product 
3. Integrate with other products 
Examples 
4. Set the name of a VM or instance to be based on specific enterprise guidelines. 
5. Control the placement of VM’s or instances. 
6. Custom buttons to enable common tasks e.g. Add Hard Drive to a VM
Object Model 
Automate uses an object model comprising of 
● Domains 
● Namespaces 
● Classes 
● Instances 
● Methods 
Domain 
Namespace1 Namespace2 
Class1 Class2 Class3 Class4 
Instance1 Method1 Instance2 Method2
Domain Search 
DOMAIN1 (Priority 10) 
NAMESPACE1 
CLASS1 
● INST1 
● INST2 
DOMAIN2 (Priority 20) 
NAMESPACE1 
CLASS1 
● INST1 
● INST3 
NAMESPACE1/CLASS1/INST1 will get picked from DOMAIN2 
NAMESPACE1/CLASS1/INST2 will get picked up from DOMAIN1 
This is a kin to the file search path when looking for executables in operating 
systems. (ls versus /bin/ls)
Storage 
Automate object model is stored in a relational database in the following 6 tables 
1. miq_ae_namespaces 
2. miq_ae_classes 
3. miq_ae_instances 
4. miq_ae_methods 
5. miq_ae_fields 
6. miq_ae_values
Basic Flow 
PostgresSQL 
Automate Explorer 
Read/Write/Reset/Restore 
Tools (Export/Import) 
Automate Engine 
Process Model 
R/W 
R/W 
R
Recent Changes 
In the Anand release of ManageIQ the following changes were introduced 
1. The automate model was converted to YAML for 
a. Seeding the database 
b. Exporting models from PostgresSQL 
c. Importing models into PostgresSQL 
d. Restoring the Automate model from a backup 
2. Domains were introduced to segregate the models 
a. ManageIQ (Readonly) 
b. User/Customer (Read/write) 
c. Each domain is stored in a separate directory (vmdb/db/fixtures/ae_datastore) 
3. Instance and Method overrides
Future Plan 
Version control Automate Model 
REST API for Automate Methods 
Separate out the Automate Engine as a Ruby 
Gem/Rails Engine
Version Control 
Automate Model
Use cases 
● Users would like to make incremental 
changes to the Automate model and revert 
back to a previous state. 
● User edits are currently written directly to the 
database and cannot be easily undone. 
● Audit Trail
Proposal 
Use GIT to Version control the Automate model 
The Automate Engine reads the model from the 
GIT repository 
The MIQ Automate Explorer will make changes 
to the Automate model, which will get saved via 
GIT.
Comparison 
Postgres 
Pros: 
Single database can be shared 
between multiple appliances in a 
zone. 
Transactions 
Backups/Replications 
Cons: 
Lacks version control 
GIT + Filesystem based DB 
Pros: 
Git provides the version control 
Provides History 
Ability to undo changes 
Share repositories 
Cons: 
Another system to be managed for 
backups, replications etc.
Multi Appliance Environment 
Appliance 1 
Appliance 2 
Appliance 3 
Appliance 4 
Domains 
GIT 
Master 
GIT 
Slave 
(Secondary) 
GIT 
Slave 
GIT 
Slave 
Clone/Pull 
Clone/Pull Clone/Pull 
Domains 
Domains 
Domains 
Postgres 
ManageI 
Q 
External 
Repos 
Write Repo 
Metadata
GIT Master 
Manages the domain repository information in Postgres 
Internal Domains (Customer typically Read/Write) 
External Domains (ManageIQ,Vendor1,Vendor2 Readonly) 
Repository Location 
Last Commit Information 
Automate Explorer Read/Write Automate Model 
All Import/Export runs on this appliance only
GIT Slave 
Synchronization 
Reads the repository information from PostgresSQL 
Disables the Automate Worker role for the appliance 
Waits for all the existing Automate Workers to end 
Synchronizes the Automate DB (add/update/delete domains) 
Re-enables the Automate Worker role for the appliance 
Automate Explorer read only mode
Commits 
● Commit Boundaries 
o Single File changes (Instance, Method) 
o Multiple File Changes (Domain, Namespace, Class 
changes)
Discussion Points 
- GIT Server protocol (ssh, https?) 
- Should we allow for branching? 
- How often should we commit changes on 
GIT Master? 
- How often should the GIT pull be run on the 
connected appliances?
Discussion Points 
● RBAC for Automate Model 
● UI controls 
● Single/Multiple appliances allow for editing the model 
● Undoing Commits 
o Undoing back to a specific commit 
o Undoing a single commit
Demo 
Automate Explorer using the filesystem as a 
storage for Automate Model.
Comparison 
UI UI 
ActiveRecord 
PostgresSQL 
FileSystemAccess 
GIT
Replacing ActiveRecord Classes 
● ActiveModel 
● Validation 
● Attribute Methods 
● Naming 
● MiqAeGit 
○ Implements the GIT Interface using rugged gem 
○ Cloning, Commit 
● MiqAeModelBase 
○ Included by MiqAeNamespace, MiqAeDomain, MiqAeClass, MiqAeInstance, 
MiqAeMethod 
○ Read/Write routed thru MiqAeGit
REST API 
Methods
REST API for Automate Methods 
Automate methods are executed by the 
Automate Engine. 
Currently uses DRb to establish connection 
with the Method process to exchange ruby 
objects. 
Ruby is the only language supported because 
of DRb
Method Dispatch 
The Automation Engine Worker 
VMDB Workspace 
DRb 
Server Automate Method 
Service Model DRb Client
Method Dispatch (REST) 
The Automation Engine Worker 
VMDB Workspace 
Automate Method 
REST Method 
Web Service Worker 
(REST Server) 
Write
Plan 
Add a new aetype for REST based methods 
This would trigger saving of the workspace 
Generating a token for the workspace persisted 
to the DB 
This has been implemented previously when 
we supported Perl and other languages.
Discussions 
Persisting the workspace 
Reading/Writing workspace from the REST Worker 
Reconstituting workspace for the Automate Worker when 
the method ends
Automate Engine 
Gem
Automate Engine Gem 
Automate Engine is responsible for 
- Reading the Automate Model 
- Instantiating a workspace to store objects 
- Compose in memory objects from the 
automate model 
- Execute Methods 
- Execute State Machines
Advantages of a Gem 
● Easier to maintain 
● Modular 
● Isolated testing
Discussions 
Dependency on core class in VMDB 
(MiqQueue) 
Deliver from Queue 
Queue for retries 
Exposing the Service Model 
Registering built in methods that don’t use 
DRb
Q & A

Design Summit - Automate roadmap - Madhu Kanoor

  • 1.
  • 2.
    Madhu Kanoor AutomateTeam mkanoor@redhat.com
  • 3.
    Agenda Background Recentchanges Future Plan Q & A
  • 4.
    Background Automate isa ManageIQ toolset used to 1. Extend the product to implement customer specific requirements 2. Update the behavior of the different workflows in the product 3. Integrate with other products Examples 4. Set the name of a VM or instance to be based on specific enterprise guidelines. 5. Control the placement of VM’s or instances. 6. Custom buttons to enable common tasks e.g. Add Hard Drive to a VM
  • 5.
    Object Model Automateuses an object model comprising of ● Domains ● Namespaces ● Classes ● Instances ● Methods Domain Namespace1 Namespace2 Class1 Class2 Class3 Class4 Instance1 Method1 Instance2 Method2
  • 6.
    Domain Search DOMAIN1(Priority 10) NAMESPACE1 CLASS1 ● INST1 ● INST2 DOMAIN2 (Priority 20) NAMESPACE1 CLASS1 ● INST1 ● INST3 NAMESPACE1/CLASS1/INST1 will get picked from DOMAIN2 NAMESPACE1/CLASS1/INST2 will get picked up from DOMAIN1 This is a kin to the file search path when looking for executables in operating systems. (ls versus /bin/ls)
  • 7.
    Storage Automate objectmodel is stored in a relational database in the following 6 tables 1. miq_ae_namespaces 2. miq_ae_classes 3. miq_ae_instances 4. miq_ae_methods 5. miq_ae_fields 6. miq_ae_values
  • 8.
    Basic Flow PostgresSQL Automate Explorer Read/Write/Reset/Restore Tools (Export/Import) Automate Engine Process Model R/W R/W R
  • 9.
    Recent Changes Inthe Anand release of ManageIQ the following changes were introduced 1. The automate model was converted to YAML for a. Seeding the database b. Exporting models from PostgresSQL c. Importing models into PostgresSQL d. Restoring the Automate model from a backup 2. Domains were introduced to segregate the models a. ManageIQ (Readonly) b. User/Customer (Read/write) c. Each domain is stored in a separate directory (vmdb/db/fixtures/ae_datastore) 3. Instance and Method overrides
  • 10.
    Future Plan Versioncontrol Automate Model REST API for Automate Methods Separate out the Automate Engine as a Ruby Gem/Rails Engine
  • 11.
  • 12.
    Use cases ●Users would like to make incremental changes to the Automate model and revert back to a previous state. ● User edits are currently written directly to the database and cannot be easily undone. ● Audit Trail
  • 13.
    Proposal Use GITto Version control the Automate model The Automate Engine reads the model from the GIT repository The MIQ Automate Explorer will make changes to the Automate model, which will get saved via GIT.
  • 14.
    Comparison Postgres Pros: Single database can be shared between multiple appliances in a zone. Transactions Backups/Replications Cons: Lacks version control GIT + Filesystem based DB Pros: Git provides the version control Provides History Ability to undo changes Share repositories Cons: Another system to be managed for backups, replications etc.
  • 15.
    Multi Appliance Environment Appliance 1 Appliance 2 Appliance 3 Appliance 4 Domains GIT Master GIT Slave (Secondary) GIT Slave GIT Slave Clone/Pull Clone/Pull Clone/Pull Domains Domains Domains Postgres ManageI Q External Repos Write Repo Metadata
  • 16.
    GIT Master Managesthe domain repository information in Postgres Internal Domains (Customer typically Read/Write) External Domains (ManageIQ,Vendor1,Vendor2 Readonly) Repository Location Last Commit Information Automate Explorer Read/Write Automate Model All Import/Export runs on this appliance only
  • 17.
    GIT Slave Synchronization Reads the repository information from PostgresSQL Disables the Automate Worker role for the appliance Waits for all the existing Automate Workers to end Synchronizes the Automate DB (add/update/delete domains) Re-enables the Automate Worker role for the appliance Automate Explorer read only mode
  • 18.
    Commits ● CommitBoundaries o Single File changes (Instance, Method) o Multiple File Changes (Domain, Namespace, Class changes)
  • 19.
    Discussion Points -GIT Server protocol (ssh, https?) - Should we allow for branching? - How often should we commit changes on GIT Master? - How often should the GIT pull be run on the connected appliances?
  • 20.
    Discussion Points ●RBAC for Automate Model ● UI controls ● Single/Multiple appliances allow for editing the model ● Undoing Commits o Undoing back to a specific commit o Undoing a single commit
  • 21.
    Demo Automate Explorerusing the filesystem as a storage for Automate Model.
  • 22.
    Comparison UI UI ActiveRecord PostgresSQL FileSystemAccess GIT
  • 23.
    Replacing ActiveRecord Classes ● ActiveModel ● Validation ● Attribute Methods ● Naming ● MiqAeGit ○ Implements the GIT Interface using rugged gem ○ Cloning, Commit ● MiqAeModelBase ○ Included by MiqAeNamespace, MiqAeDomain, MiqAeClass, MiqAeInstance, MiqAeMethod ○ Read/Write routed thru MiqAeGit
  • 24.
  • 25.
    REST API forAutomate Methods Automate methods are executed by the Automate Engine. Currently uses DRb to establish connection with the Method process to exchange ruby objects. Ruby is the only language supported because of DRb
  • 26.
    Method Dispatch TheAutomation Engine Worker VMDB Workspace DRb Server Automate Method Service Model DRb Client
  • 27.
    Method Dispatch (REST) The Automation Engine Worker VMDB Workspace Automate Method REST Method Web Service Worker (REST Server) Write
  • 28.
    Plan Add anew aetype for REST based methods This would trigger saving of the workspace Generating a token for the workspace persisted to the DB This has been implemented previously when we supported Perl and other languages.
  • 29.
    Discussions Persisting theworkspace Reading/Writing workspace from the REST Worker Reconstituting workspace for the Automate Worker when the method ends
  • 30.
  • 31.
    Automate Engine Gem Automate Engine is responsible for - Reading the Automate Model - Instantiating a workspace to store objects - Compose in memory objects from the automate model - Execute Methods - Execute State Machines
  • 32.
    Advantages of aGem ● Easier to maintain ● Modular ● Isolated testing
  • 33.
    Discussions Dependency oncore class in VMDB (MiqQueue) Deliver from Queue Queue for retries Exposing the Service Model Registering built in methods that don’t use DRb
  • 34.