SlideShare une entreprise Scribd logo
1  sur  45
oVirt UI Plugin Infrastructure and the oVirt-
Foreman plugin


 Oved Ourfali
 Senior Software Engineer – Red Hat


 Virtualization Devroom
 FOSDEM
 February 2013
                                                1
Agenda

 oVirt UI-Plugin infrastructure
 Cross-Origin principal
 The oVirt-Foreman UI-plugin
 Future work
 Questions




                                  2
oVirt Engine UI-Plugin Infrastructure
  Extend or customize oVirt Engine functionality by
  allowing to add UI components to the Admin Portal
  (Webadmin)
  Plugins integrate with the Admin Portal on the client
  side using JavaScript
  Plugins can be packaged and distributed for use with
  the oVirt Engine




                                                          3
oVirt Engine UI-Plugin Infrastructure
  Simple and flexible plugin infrastructure
    The Admin Portal exposes a plugin API
    Plugins consume the API
    The Admin Portal invokes plugins at key events during
    the application runtime
  Plugins are loaded via iframe elements
    Decouple Web Admin application from the actual plugin
    code
    Provide a sandbox environment with regard to plugin
    code execution



                                                          4
Web Admin user interface




                           5
Web Admin user interface




                           6
Web Admin user interface




                           7
Web Admin user interface




                           8
Web Admin user interface




                           9
Pluggable UI Components




                          10
Plugin API
  ready - indicates that the plugin is ready for
  initialization
  register - registers plugin event handler functions
  configObject - returns the plugin configuration object
  addMainTab - dynamically adds a new main tab
  addSubTab - dynamically adds a new sub-tab
  addMainTabActionButton - dynamically adds a new
  main tab action button + context menu item
  showDialog - opens some URL in a new browser
  window/tab

                                                           11
Plugin API
  setTabContentUrl - dynamically changes the URL
  associated with a sub-tab
  setTabAccessible - dynamically shows/hides a sub-tab
  loginUserName - returns the logged-in user name
  loginUserId - returns the logged-in user name




                                                    12
Plugin Events
  UiInit - code that runs upon plugin initialization
  UserLogin - indicates that the user logged in
  UserLogout - indicates that the user logged out
  RestApiSessionAcquired – the plugin infrastructure
  creates a REST session for the plugin to use
  Selection Changes
    DataCenter, Cluster, Disk, Host, Storage, Template,
    VirtualMachine
    Event name is <Entity>SelectionChange where Entity is
    one of the above


                                                          13
Same-Origin Policy

  Security concept for browser-side programming languages
  such as JavaScript
  Permits scripts running on pages from the same site to
  access each others properties and methods, while
  restricting access to methods and properties across pages
  on different sites
  One JavaScript code that originates from one end point
  (http(s)://server1:port1) cannot access another endpoint's
  properties and methods




                                                           14
Same-Origin Policy in UI-Plugins

  In our case, the plugin's origin is the URL of the engine
  server (http(s)://engine-server:port)
  Plugin code can't do HTTP requests to a different origin
  and access the response, different properties and methods
  in it




                                                              15
Approaches to deal with the Same-
Origin Policy
  Rendering URL in an iframe is allowed (so if you just want
  main/sub-tabs to work, then you're good)
  JSONP – JSON with padding
  CORS – Cross Origin Resource Sharing
  Using a proxy (or in specific, Apache's mod_proxy or
  mod_ssl)




                                                          16
Rendering URL in an iframe

  If you would like to show a specific URL (using HTTP GET)
  in a main/sub-tab, and constructing the URL doesn't
  require any information from the other origin, then just do it
  However, if you do need information, then perhaps the
  next approach will be good for you
  Pros
     Simple
  Cons
     Very limited and specific use-case




                                                             17
Using JSONP

  JSON with padding
  Enabled you to get JSON data (HTTP GET) from a server
  in a different origin
  Useful if you need JSON data to construct URLs to for the
  main/sub-tab iframe




                                                         18
Using JSONP - Example

  Define some callback


  Use JQUERY to get the JSON data, passing a
  callback argument


  The result would be


  And it would call the callback, which will get the data



                                                            19
Using JSONP

  Pros
    Simple
  Cons
    Requires server-side support
    Only supports getting JSON data
    Need to adapt client code to work with JSONP (simple)




                                                       20
CORS – Cross Origin Resource Sharing

  CORS is a mechanism that allows a web page to make
  requests to another domain
  Client request should contain the HTTP Header
    Origin: http://my-server.example.com
  Response
    Access-Control-Allow-Origin:
    http://my-server.example.com (or * for all)
  Pros
    Supports operations other than HTTP GET on JSON
  Cons
    Requires both browser and server-side support
                                                       21
Using a Proxy

  One can define a proxy, that once calling one origin, will
  make the request to the other origin
  Thus, it is the client side both requests are in the same
  origin
  Example using Apache's mod_proxy
     ProxyPass /other_origin http://other-server:other-
     port/other_application
     ProxyPassReverse /other_origin http://other-
     server:other-port/other_application
  Requests to http://my-server/other_application are safe to
  use from within the originating application, and allows all
  the freedom you need

                                                               22
Using a Proxy

  Pros
    No changes needed in the client code
    No browser support needed
  Cons
    Using a proxy does have some overhead
    requires special configuration at the originating server-
    side




                                                            23
oVirt-Foreman UI-Plugin




                          24
Foreman Overview
  Machines Life Cycle Management
    Integrates with Puppet, and acts as web front end to it
    Provisioning until the point puppet is running, allowing
    Puppet to do what it does best
    Shows a Systems Inventory (based on Facter)
    Provides real time information about hosts status based on
    Puppet reports
    Managing virtualization and cloud environments
    Managing DNS, DHCP, TFTP, PuppetCA, CMDB etc
  oVirt-Foreman integration
    See Foreman data on oVirt Vms
    Dashboard
    ....
                                                               25
Current Scope
  Dashboard Main-Tab
  VM Foreman Details Sub-Tab – Shows the Foreman Host
  Details
  VM Foreman Graphs Sub-Tabs – Shows the Foreman
  Host Graphs only
  Behind the scenes - SSO between oVirt and Foreman




                                                      26
oVirt Plugin – Dashboard




                           27
oVirt Plugin – VM Foreman Details




                                    28
oVirt Plugin – VM Foreman Graphs




                                   29
oVirt Plugin
  The oVirt UI-plugin is composed of 2 files
     foreman.json – contains the plugin definition file
     foreman_files/start.html – contains the plugin itself
  Custom configuration can be put in
     /etc/ovirt-engine/ui-plugins/foreman-config.json




                                                             30
oVirt Plugin – Definition file
  foreman.json




                                 31
oVirt Plugin – start.html file
  Register section - register the following event handlers
     UiInit – add the main/sub tabs




                                                        32
oVirt Plugin – start.html file
  RestApiSessionAcquired – relogin to Foreman



  VirtualMachineSelectionChange – set sub-tabs URL if
  the selected VM exists in Foreman




                                                   33
oVirt Plugin – start.html file
  UserLogout – logout from Foreman




                                     34
oVirt Plugin – start.html file
  Helper functions




                                 35
Foreman Plugin
  The Foreman plugin composed of several components
    config/initializers/ovirt_setup.rb
       Adds new oVirt role to Foreman
       Adds oVirt authentication sources – one per oVirt compute
       resource
    models/foreman_ovirt/auth_source_ovirt.rb
       The oVirt authentication source model
    models/foreman_ovirt/user_extensions.rb
       Every-time a user logs in through the oVirt authentication
       source, it is granted with the oVirt role automatically
    Views and Layouts
       Customized oVirt layout
       Customized host view

                                                                    36
Foreman Plugin
  Hosts controller




                     37
Foreman Plugin
  Dashboard controller




                         38
Installation
  Prerequisites
     oVirt version 3.2
     Foreman version 1.1 RC2 and above




                                         39
Installation
  Foreman side
     Add a file called foreman_ovirt.rb under the bundler.d directory
     containing
        gem 'foreman_ovirt'
     Run Bundle install from the foreman root directory
     Foreman needs to run in /foreman URL root either by
        Export RAILS_RELATIVE_URL_ROOT="/foreman"                   before
        running Foreman
     or by setting the following definition in /etc/sysconfig/foreman
        RAILS_RELATIVE_URL_ROOT="/foreman"
     Run Foreman




                                                                        40
Installation
  oVirt side
     Get the plugin files from git://gerrit.ovirt.org/samples-uiplugins.git
     Place the files from the foreman-plugin directory to
     /usr/share/ovirt-engine/ui-plugins, and edit the foreman.json file as
     needed
     Configure mod_proxy




     Restart the engine and Apache, and you're good to go! (make
     sure you browse to the URL as defined in the proxy, otherwise it
     won't work)
     If you already have oVirt engine proxy configuration just add the
     foreman ones
     For SSL configuration check http://ovedou.blogspot.com              41
Future Work – UI plugin infrastructure
  Custom dialogs in Web Admin UI style
  Form and table based custom {main|sub} tabs
  Review and manage plugins in Web Admin UI
  What do you want to see?




                                                42
Future Work – Foreman plugin
  Support sync oVirt VMs with Foreman Hosts (either in the
  oVirt or Foreman side)
  RPM packages for both sides of the plugin
  Other data that might be relevant
    Reports
    Facts




                                                         43
Useful Links

  foreman_ovirt github repo
  https://github.com/oourfali/foreman_ovirt
  oVirt-Foreman UI plugin in the UI plugins repo
  http://gerrit.ovirt.org/gitweb?p=samples-uiplugins.git;a=summar
  or just git clone git://gerrit.ovirt.org/samples-uiplugins.git
  Feel free to contact me for help, either personally, or via
  the oVirt users mailing list
  http://ovedou.blogspot.com
  ovedo@redhat.com
  users@ovirt.org
  Daniel's blog (Shell in a Box plugin)
  http://derezvir.blogspot.co.il                                   44
THANK YOU !

http://www.ovirt.org



ovedo@redhat.com
ovedo at #ovirt (irc.oftc.net)
                                 45

Contenu connexe

En vedette

oVirt社区最新活跃度
oVirt社区最新活跃度oVirt社区最新活跃度
oVirt社区最新活跃度Li Jiansheng
 
The challenge - testing the oVirt project
The challenge - testing the oVirt projectThe challenge - testing the oVirt project
The challenge - testing the oVirt projectEyal Edri
 
oVirt 3.5 Storage Features Overview
oVirt 3.5 Storage Features OverviewoVirt 3.5 Storage Features Overview
oVirt 3.5 Storage Features OverviewAllon Mureinik
 
Live Storage Migration in oVirt (Open Storage Meetup May 2013)
Live Storage Migration in oVirt (Open Storage Meetup May 2013)Live Storage Migration in oVirt (Open Storage Meetup May 2013)
Live Storage Migration in oVirt (Open Storage Meetup May 2013)Allon Mureinik
 
Disaster Recovery Strategies Using oVirt's new Storage Connection Management ...
Disaster Recovery Strategies Using oVirt's new Storage Connection Management ...Disaster Recovery Strategies Using oVirt's new Storage Connection Management ...
Disaster Recovery Strategies Using oVirt's new Storage Connection Management ...Allon Mureinik
 
Kvm forum 2013 - future integration points for oVirt storage
Kvm forum 2013 - future integration points for oVirt storageKvm forum 2013 - future integration points for oVirt storage
Kvm forum 2013 - future integration points for oVirt storageSean Cohen
 
How to deploy oVirt using Nested KVM environment?
How to deploy oVirt using Nested KVM environment?How to deploy oVirt using Nested KVM environment?
How to deploy oVirt using Nested KVM environment?Rogan Kyuseok Lee
 
基于Fuel的超融合一体机
基于Fuel的超融合一体机基于Fuel的超融合一体机
基于Fuel的超融合一体机EdwardBadBoy
 
oVirt and OpenStack
oVirt and OpenStackoVirt and OpenStack
oVirt and OpenStackDave Neary
 
Foreman in your datacenter
Foreman in your datacenterForeman in your datacenter
Foreman in your datacenterlzap
 

En vedette (12)

oVirt社区最新活跃度
oVirt社区最新活跃度oVirt社区最新活跃度
oVirt社区最新活跃度
 
Ovirt deep dive
Ovirt deep diveOvirt deep dive
Ovirt deep dive
 
Understand ovirt
Understand ovirtUnderstand ovirt
Understand ovirt
 
The challenge - testing the oVirt project
The challenge - testing the oVirt projectThe challenge - testing the oVirt project
The challenge - testing the oVirt project
 
oVirt 3.5 Storage Features Overview
oVirt 3.5 Storage Features OverviewoVirt 3.5 Storage Features Overview
oVirt 3.5 Storage Features Overview
 
Live Storage Migration in oVirt (Open Storage Meetup May 2013)
Live Storage Migration in oVirt (Open Storage Meetup May 2013)Live Storage Migration in oVirt (Open Storage Meetup May 2013)
Live Storage Migration in oVirt (Open Storage Meetup May 2013)
 
Disaster Recovery Strategies Using oVirt's new Storage Connection Management ...
Disaster Recovery Strategies Using oVirt's new Storage Connection Management ...Disaster Recovery Strategies Using oVirt's new Storage Connection Management ...
Disaster Recovery Strategies Using oVirt's new Storage Connection Management ...
 
Kvm forum 2013 - future integration points for oVirt storage
Kvm forum 2013 - future integration points for oVirt storageKvm forum 2013 - future integration points for oVirt storage
Kvm forum 2013 - future integration points for oVirt storage
 
How to deploy oVirt using Nested KVM environment?
How to deploy oVirt using Nested KVM environment?How to deploy oVirt using Nested KVM environment?
How to deploy oVirt using Nested KVM environment?
 
基于Fuel的超融合一体机
基于Fuel的超融合一体机基于Fuel的超融合一体机
基于Fuel的超融合一体机
 
oVirt and OpenStack
oVirt and OpenStackoVirt and OpenStack
oVirt and OpenStack
 
Foreman in your datacenter
Foreman in your datacenterForeman in your datacenter
Foreman in your datacenter
 

Similaire à oVirt UI Plugin Infrastructure and the oVirt-Foreman plugin

Automating Windows Server 2008 R2 Administration with Windows PowerShell
Automating Windows Server 2008 R2 Administration with Windows PowerShellAutomating Windows Server 2008 R2 Administration with Windows PowerShell
Automating Windows Server 2008 R2 Administration with Windows PowerShellalexandair
 
Supporting and Using EC2/CIMI on top of Cloud Environments via Deltacloud
Supporting and Using EC2/CIMI on top of Cloud Environments via DeltacloudSupporting and Using EC2/CIMI on top of Cloud Environments via Deltacloud
Supporting and Using EC2/CIMI on top of Cloud Environments via DeltacloudOved Ourfali
 
12.+Managing+Containers.pdf
12.+Managing+Containers.pdf12.+Managing+Containers.pdf
12.+Managing+Containers.pdfVikrantSChohaan
 
How to upgrade to MongoDB 4.0 - Percona Europe 2018
How to upgrade to MongoDB 4.0 - Percona Europe 2018How to upgrade to MongoDB 4.0 - Percona Europe 2018
How to upgrade to MongoDB 4.0 - Percona Europe 2018Antonios Giannopoulos
 
Photon Controller: An Open Source Container Infrastructure Platform from VMware
Photon Controller: An Open Source Container Infrastructure Platform from VMwarePhoton Controller: An Open Source Container Infrastructure Platform from VMware
Photon Controller: An Open Source Container Infrastructure Platform from VMwareDocker, Inc.
 
ColdFusion MX 7 Server Administration
ColdFusion MX 7 Server AdministrationColdFusion MX 7 Server Administration
ColdFusion MX 7 Server AdministrationSteven Erat
 
The Emergence of Choice in the .NET Ecosystem
The Emergence of Choice in the .NET EcosystemThe Emergence of Choice in the .NET Ecosystem
The Emergence of Choice in the .NET EcosystemJames Avery
 
Symfony2 for Midgard Developers
Symfony2 for Midgard DevelopersSymfony2 for Midgard Developers
Symfony2 for Midgard DevelopersHenri Bergius
 
High quality ap is with api platform
High quality ap is with api platformHigh quality ap is with api platform
High quality ap is with api platformNelson Kopliku
 
A Deep Dive into the Liberty Buildpack on IBM BlueMix
A Deep Dive into the Liberty Buildpack on IBM BlueMix A Deep Dive into the Liberty Buildpack on IBM BlueMix
A Deep Dive into the Liberty Buildpack on IBM BlueMix Rohit Kelapure
 
Easy as pie creating widgets for ibm connections
Easy as pie   creating widgets for ibm connectionsEasy as pie   creating widgets for ibm connections
Easy as pie creating widgets for ibm connectionsLetsConnect
 
How to Deploy WSO2 Enterprise Integrator in Containers
How to Deploy WSO2 Enterprise Integrator in ContainersHow to Deploy WSO2 Enterprise Integrator in Containers
How to Deploy WSO2 Enterprise Integrator in ContainersWSO2
 
Setting up the hyperledger composer in ubuntu
Setting up the hyperledger composer in ubuntuSetting up the hyperledger composer in ubuntu
Setting up the hyperledger composer in ubuntukesavan N B
 
The use of Symfony2 @ Overblog
The use of Symfony2 @ OverblogThe use of Symfony2 @ Overblog
The use of Symfony2 @ OverblogXavier Hausherr
 
Vue micro frontend implementation patterns
Vue micro frontend implementation patternsVue micro frontend implementation patterns
Vue micro frontend implementation patternsAlbert Brand
 
ColdFusion .NET integration - Adobe Max 2006
ColdFusion .NET integration - Adobe Max 2006ColdFusion .NET integration - Adobe Max 2006
ColdFusion .NET integration - Adobe Max 2006Rupesh Kumar
 

Similaire à oVirt UI Plugin Infrastructure and the oVirt-Foreman plugin (20)

Automating Windows Server 2008 R2 Administration with Windows PowerShell
Automating Windows Server 2008 R2 Administration with Windows PowerShellAutomating Windows Server 2008 R2 Administration with Windows PowerShell
Automating Windows Server 2008 R2 Administration with Windows PowerShell
 
Supporting and Using EC2/CIMI on top of Cloud Environments via Deltacloud
Supporting and Using EC2/CIMI on top of Cloud Environments via DeltacloudSupporting and Using EC2/CIMI on top of Cloud Environments via Deltacloud
Supporting and Using EC2/CIMI on top of Cloud Environments via Deltacloud
 
Appium solution
Appium solutionAppium solution
Appium solution
 
12.+Managing+Containers.pdf
12.+Managing+Containers.pdf12.+Managing+Containers.pdf
12.+Managing+Containers.pdf
 
How to upgrade to MongoDB 4.0 - Percona Europe 2018
How to upgrade to MongoDB 4.0 - Percona Europe 2018How to upgrade to MongoDB 4.0 - Percona Europe 2018
How to upgrade to MongoDB 4.0 - Percona Europe 2018
 
Photon Controller: An Open Source Container Infrastructure Platform from VMware
Photon Controller: An Open Source Container Infrastructure Platform from VMwarePhoton Controller: An Open Source Container Infrastructure Platform from VMware
Photon Controller: An Open Source Container Infrastructure Platform from VMware
 
Magento Meetup New Delhi- Console
Magento Meetup New Delhi- ConsoleMagento Meetup New Delhi- Console
Magento Meetup New Delhi- Console
 
ColdFusion MX 7 Server Administration
ColdFusion MX 7 Server AdministrationColdFusion MX 7 Server Administration
ColdFusion MX 7 Server Administration
 
The Emergence of Choice in the .NET Ecosystem
The Emergence of Choice in the .NET EcosystemThe Emergence of Choice in the .NET Ecosystem
The Emergence of Choice in the .NET Ecosystem
 
Symfony2 for Midgard Developers
Symfony2 for Midgard DevelopersSymfony2 for Midgard Developers
Symfony2 for Midgard Developers
 
P H P Framework
P H P  FrameworkP H P  Framework
P H P Framework
 
High quality ap is with api platform
High quality ap is with api platformHigh quality ap is with api platform
High quality ap is with api platform
 
A Deep Dive into the Liberty Buildpack on IBM BlueMix
A Deep Dive into the Liberty Buildpack on IBM BlueMix A Deep Dive into the Liberty Buildpack on IBM BlueMix
A Deep Dive into the Liberty Buildpack on IBM BlueMix
 
Easy as pie creating widgets for ibm connections
Easy as pie   creating widgets for ibm connectionsEasy as pie   creating widgets for ibm connections
Easy as pie creating widgets for ibm connections
 
How to Deploy WSO2 Enterprise Integrator in Containers
How to Deploy WSO2 Enterprise Integrator in ContainersHow to Deploy WSO2 Enterprise Integrator in Containers
How to Deploy WSO2 Enterprise Integrator in Containers
 
Setting up the hyperledger composer in ubuntu
Setting up the hyperledger composer in ubuntuSetting up the hyperledger composer in ubuntu
Setting up the hyperledger composer in ubuntu
 
IIS Web Ecosystem
IIS Web EcosystemIIS Web Ecosystem
IIS Web Ecosystem
 
The use of Symfony2 @ Overblog
The use of Symfony2 @ OverblogThe use of Symfony2 @ Overblog
The use of Symfony2 @ Overblog
 
Vue micro frontend implementation patterns
Vue micro frontend implementation patternsVue micro frontend implementation patterns
Vue micro frontend implementation patterns
 
ColdFusion .NET integration - Adobe Max 2006
ColdFusion .NET integration - Adobe Max 2006ColdFusion .NET integration - Adobe Max 2006
ColdFusion .NET integration - Adobe Max 2006
 

oVirt UI Plugin Infrastructure and the oVirt-Foreman plugin

  • 1. oVirt UI Plugin Infrastructure and the oVirt- Foreman plugin Oved Ourfali Senior Software Engineer – Red Hat Virtualization Devroom FOSDEM February 2013 1
  • 2. Agenda oVirt UI-Plugin infrastructure Cross-Origin principal The oVirt-Foreman UI-plugin Future work Questions 2
  • 3. oVirt Engine UI-Plugin Infrastructure Extend or customize oVirt Engine functionality by allowing to add UI components to the Admin Portal (Webadmin) Plugins integrate with the Admin Portal on the client side using JavaScript Plugins can be packaged and distributed for use with the oVirt Engine 3
  • 4. oVirt Engine UI-Plugin Infrastructure Simple and flexible plugin infrastructure The Admin Portal exposes a plugin API Plugins consume the API The Admin Portal invokes plugins at key events during the application runtime Plugins are loaded via iframe elements Decouple Web Admin application from the actual plugin code Provide a sandbox environment with regard to plugin code execution 4
  • 5. Web Admin user interface 5
  • 6. Web Admin user interface 6
  • 7. Web Admin user interface 7
  • 8. Web Admin user interface 8
  • 9. Web Admin user interface 9
  • 11. Plugin API ready - indicates that the plugin is ready for initialization register - registers plugin event handler functions configObject - returns the plugin configuration object addMainTab - dynamically adds a new main tab addSubTab - dynamically adds a new sub-tab addMainTabActionButton - dynamically adds a new main tab action button + context menu item showDialog - opens some URL in a new browser window/tab 11
  • 12. Plugin API setTabContentUrl - dynamically changes the URL associated with a sub-tab setTabAccessible - dynamically shows/hides a sub-tab loginUserName - returns the logged-in user name loginUserId - returns the logged-in user name 12
  • 13. Plugin Events UiInit - code that runs upon plugin initialization UserLogin - indicates that the user logged in UserLogout - indicates that the user logged out RestApiSessionAcquired – the plugin infrastructure creates a REST session for the plugin to use Selection Changes DataCenter, Cluster, Disk, Host, Storage, Template, VirtualMachine Event name is <Entity>SelectionChange where Entity is one of the above 13
  • 14. Same-Origin Policy Security concept for browser-side programming languages such as JavaScript Permits scripts running on pages from the same site to access each others properties and methods, while restricting access to methods and properties across pages on different sites One JavaScript code that originates from one end point (http(s)://server1:port1) cannot access another endpoint's properties and methods 14
  • 15. Same-Origin Policy in UI-Plugins In our case, the plugin's origin is the URL of the engine server (http(s)://engine-server:port) Plugin code can't do HTTP requests to a different origin and access the response, different properties and methods in it 15
  • 16. Approaches to deal with the Same- Origin Policy Rendering URL in an iframe is allowed (so if you just want main/sub-tabs to work, then you're good) JSONP – JSON with padding CORS – Cross Origin Resource Sharing Using a proxy (or in specific, Apache's mod_proxy or mod_ssl) 16
  • 17. Rendering URL in an iframe If you would like to show a specific URL (using HTTP GET) in a main/sub-tab, and constructing the URL doesn't require any information from the other origin, then just do it However, if you do need information, then perhaps the next approach will be good for you Pros Simple Cons Very limited and specific use-case 17
  • 18. Using JSONP JSON with padding Enabled you to get JSON data (HTTP GET) from a server in a different origin Useful if you need JSON data to construct URLs to for the main/sub-tab iframe 18
  • 19. Using JSONP - Example Define some callback Use JQUERY to get the JSON data, passing a callback argument The result would be And it would call the callback, which will get the data 19
  • 20. Using JSONP Pros Simple Cons Requires server-side support Only supports getting JSON data Need to adapt client code to work with JSONP (simple) 20
  • 21. CORS – Cross Origin Resource Sharing CORS is a mechanism that allows a web page to make requests to another domain Client request should contain the HTTP Header Origin: http://my-server.example.com Response Access-Control-Allow-Origin: http://my-server.example.com (or * for all) Pros Supports operations other than HTTP GET on JSON Cons Requires both browser and server-side support 21
  • 22. Using a Proxy One can define a proxy, that once calling one origin, will make the request to the other origin Thus, it is the client side both requests are in the same origin Example using Apache's mod_proxy ProxyPass /other_origin http://other-server:other- port/other_application ProxyPassReverse /other_origin http://other- server:other-port/other_application Requests to http://my-server/other_application are safe to use from within the originating application, and allows all the freedom you need 22
  • 23. Using a Proxy Pros No changes needed in the client code No browser support needed Cons Using a proxy does have some overhead requires special configuration at the originating server- side 23
  • 25. Foreman Overview Machines Life Cycle Management Integrates with Puppet, and acts as web front end to it Provisioning until the point puppet is running, allowing Puppet to do what it does best Shows a Systems Inventory (based on Facter) Provides real time information about hosts status based on Puppet reports Managing virtualization and cloud environments Managing DNS, DHCP, TFTP, PuppetCA, CMDB etc oVirt-Foreman integration See Foreman data on oVirt Vms Dashboard .... 25
  • 26. Current Scope Dashboard Main-Tab VM Foreman Details Sub-Tab – Shows the Foreman Host Details VM Foreman Graphs Sub-Tabs – Shows the Foreman Host Graphs only Behind the scenes - SSO between oVirt and Foreman 26
  • 27. oVirt Plugin – Dashboard 27
  • 28. oVirt Plugin – VM Foreman Details 28
  • 29. oVirt Plugin – VM Foreman Graphs 29
  • 30. oVirt Plugin The oVirt UI-plugin is composed of 2 files foreman.json – contains the plugin definition file foreman_files/start.html – contains the plugin itself Custom configuration can be put in /etc/ovirt-engine/ui-plugins/foreman-config.json 30
  • 31. oVirt Plugin – Definition file foreman.json 31
  • 32. oVirt Plugin – start.html file Register section - register the following event handlers UiInit – add the main/sub tabs 32
  • 33. oVirt Plugin – start.html file RestApiSessionAcquired – relogin to Foreman VirtualMachineSelectionChange – set sub-tabs URL if the selected VM exists in Foreman 33
  • 34. oVirt Plugin – start.html file UserLogout – logout from Foreman 34
  • 35. oVirt Plugin – start.html file Helper functions 35
  • 36. Foreman Plugin The Foreman plugin composed of several components config/initializers/ovirt_setup.rb Adds new oVirt role to Foreman Adds oVirt authentication sources – one per oVirt compute resource models/foreman_ovirt/auth_source_ovirt.rb The oVirt authentication source model models/foreman_ovirt/user_extensions.rb Every-time a user logs in through the oVirt authentication source, it is granted with the oVirt role automatically Views and Layouts Customized oVirt layout Customized host view 36
  • 37. Foreman Plugin Hosts controller 37
  • 38. Foreman Plugin Dashboard controller 38
  • 39. Installation Prerequisites oVirt version 3.2 Foreman version 1.1 RC2 and above 39
  • 40. Installation Foreman side Add a file called foreman_ovirt.rb under the bundler.d directory containing gem 'foreman_ovirt' Run Bundle install from the foreman root directory Foreman needs to run in /foreman URL root either by Export RAILS_RELATIVE_URL_ROOT="/foreman" before running Foreman or by setting the following definition in /etc/sysconfig/foreman RAILS_RELATIVE_URL_ROOT="/foreman" Run Foreman 40
  • 41. Installation oVirt side Get the plugin files from git://gerrit.ovirt.org/samples-uiplugins.git Place the files from the foreman-plugin directory to /usr/share/ovirt-engine/ui-plugins, and edit the foreman.json file as needed Configure mod_proxy Restart the engine and Apache, and you're good to go! (make sure you browse to the URL as defined in the proxy, otherwise it won't work) If you already have oVirt engine proxy configuration just add the foreman ones For SSL configuration check http://ovedou.blogspot.com 41
  • 42. Future Work – UI plugin infrastructure Custom dialogs in Web Admin UI style Form and table based custom {main|sub} tabs Review and manage plugins in Web Admin UI What do you want to see? 42
  • 43. Future Work – Foreman plugin Support sync oVirt VMs with Foreman Hosts (either in the oVirt or Foreman side) RPM packages for both sides of the plugin Other data that might be relevant Reports Facts 43
  • 44. Useful Links foreman_ovirt github repo https://github.com/oourfali/foreman_ovirt oVirt-Foreman UI plugin in the UI plugins repo http://gerrit.ovirt.org/gitweb?p=samples-uiplugins.git;a=summar or just git clone git://gerrit.ovirt.org/samples-uiplugins.git Feel free to contact me for help, either personally, or via the oVirt users mailing list http://ovedou.blogspot.com ovedo@redhat.com users@ovirt.org Daniel's blog (Shell in a Box plugin) http://derezvir.blogspot.co.il 44

Notes de l'éditeur

  1. Hey All. My name is Oved. I&apos;m a Senior Software Engineer at Red Hat, and today I&apos;m show you how to use EC2/CIMI on top of oVirt, via deltacloud.
  2. Let&apos;s go over the agenda. I&apos;ll start with an Overview, talking about the oVirt engine,Then I&apos;ll talk about the motivation for exposing EC2/CIMI APIs on Top of ovirt, describing Some cloud APIs, and their differences. , and proceed to describing deltacloud, which enables Ovirt to support that. After the overview, I&apos;ll talk about the integration with deltacloud Describe the different use-cases, and Show some samples of using EC2 and CIMI on top of oVirt There is always future work, so I&apos;ll go over that as well Finish with a Summary, and I&apos;ll leave a few minutes for Questions. If something isn&apos;t clear, and it can&apos;t wait til the end of the lecture, Please raise your hand, and I&apos;ll do my best to answer your questions.
  3. Deltacloud is an open source apache project Abstracts the differences between cloud providers. Read from the slide
  4. Deltacloud is an open source apache project Abstracts the differences between cloud providers. Read from the slide
  5. Deltacloud is an open source apache project Abstracts the differences between cloud providers. Read from the slide
  6. Deltacloud is an open source apache project Abstracts the differences between cloud providers. Read from the slide
  7. Deltacloud is an open source apache project Abstracts the differences between cloud providers. Read from the slide
  8. So, what is it good for? Why enabling commen cloud APIs on top of Ovirt? It is good for creating on premis private cloud environments, on top of existing ovirt-based IasS environemnts. Make integration with cloud providers in hetrogenous environments easier Useful for cloud client applications (if you can work with EC2/CIMI, you can work with oVirt) Some examples are Aeolus and cloud forms, which are cloud management software CloudWatch which is a cloud monitoring software ......
  9. So, what is it good for? Why enabling commen cloud APIs on top of Ovirt? It is good for creating on premis private cloud environments, on top of existing ovirt-based IasS environemnts. Make integration with cloud providers in hetrogenous environments easier Useful for cloud client applications (if you can work with EC2/CIMI, you can work with oVirt) Some examples are Aeolus and cloud forms, which are cloud management software CloudWatch which is a cloud monitoring software ......
  10. So, what is it good for? Why enabling commen cloud APIs on top of Ovirt? It is good for creating on premis private cloud environments, on top of existing ovirt-based IasS environemnts. Make integration with cloud providers in hetrogenous environments easier Useful for cloud client applications (if you can work with EC2/CIMI, you can work with oVirt) Some examples are Aeolus and cloud forms, which are cloud management software CloudWatch which is a cloud monitoring software ......
  11. So, what is it good for? Why enabling commen cloud APIs on top of Ovirt? It is good for creating on premis private cloud environments, on top of existing ovirt-based IasS environemnts. Make integration with cloud providers in hetrogenous environments easier Useful for cloud client applications (if you can work with EC2/CIMI, you can work with oVirt) Some examples are Aeolus and cloud forms, which are cloud management software CloudWatch which is a cloud monitoring software ......
  12. So, what is it good for? Why enabling commen cloud APIs on top of Ovirt? It is good for creating on premis private cloud environments, on top of existing ovirt-based IasS environemnts. Make integration with cloud providers in hetrogenous environments easier Useful for cloud client applications (if you can work with EC2/CIMI, you can work with oVirt) Some examples are Aeolus and cloud forms, which are cloud management software CloudWatch which is a cloud monitoring software ......
  13. So, what is it good for? Why enabling commen cloud APIs on top of Ovirt? It is good for creating on premis private cloud environments, on top of existing ovirt-based IasS environemnts. Make integration with cloud providers in hetrogenous environments easier Useful for cloud client applications (if you can work with EC2/CIMI, you can work with oVirt) Some examples are Aeolus and cloud forms, which are cloud management software CloudWatch which is a cloud monitoring software ......
  14. So, what is it good for? Why enabling commen cloud APIs on top of Ovirt? It is good for creating on premis private cloud environments, on top of existing ovirt-based IasS environemnts. Make integration with cloud providers in hetrogenous environments easier Useful for cloud client applications (if you can work with EC2/CIMI, you can work with oVirt) Some examples are Aeolus and cloud forms, which are cloud management software CloudWatch which is a cloud monitoring software ......
  15. So, what is it good for? Why enabling commen cloud APIs on top of Ovirt? It is good for creating on premis private cloud environments, on top of existing ovirt-based IasS environemnts. Make integration with cloud providers in hetrogenous environments easier Useful for cloud client applications (if you can work with EC2/CIMI, you can work with oVirt) Some examples are Aeolus and cloud forms, which are cloud management software CloudWatch which is a cloud monitoring software ......
  16. So, what is it good for? Why enabling commen cloud APIs on top of Ovirt? It is good for creating on premis private cloud environments, on top of existing ovirt-based IasS environemnts. Make integration with cloud providers in hetrogenous environments easier Useful for cloud client applications (if you can work with EC2/CIMI, you can work with oVirt) Some examples are Aeolus and cloud forms, which are cloud management software CloudWatch which is a cloud monitoring software ......
  17. So, what is it good for? Why enabling commen cloud APIs on top of Ovirt? It is good for creating on premis private cloud environments, on top of existing ovirt-based IasS environemnts. Make integration with cloud providers in hetrogenous environments easier Useful for cloud client applications (if you can work with EC2/CIMI, you can work with oVirt) Some examples are Aeolus and cloud forms, which are cloud management software CloudWatch which is a cloud monitoring software ......
  18. Just read from the slide
  19. Let&apos;s go over the agenda. I&apos;ll start with an Overview, talking about the oVirt engine,Then I&apos;ll talk about the motivation for exposing EC2/CIMI APIs on Top of ovirt, describing Some cloud APIs, and their differences. , and proceed to describing deltacloud, which enables Ovirt to support that. After the overview, I&apos;ll talk about the integration with deltacloud Describe the different use-cases, and Show some samples of using EC2 and CIMI on top of oVirt There is always future work, so I&apos;ll go over that as well Finish with a Summary, and I&apos;ll leave a few minutes for Questions. If something isn&apos;t clear, and it can&apos;t wait til the end of the lecture, Please raise your hand, and I&apos;ll do my best to answer your questions.
  20. Just read from the slide
  21. Just read from the slide
  22. Just read from the slide
  23. Just read from the slide
  24. Just read from the slide
  25. Deltacloud is an open source apache project Abstracts the differences between cloud providers. Read from the slide
  26. Just read from the slide
  27. Just read from the slide
  28. Just read from the slide
  29. Just read from the slide