From 9be6d7c954a89ae2bf23ca8e2c4e36e26939965a Mon Sep 17 00:00:00 2001 From: Sam Lucidi Date: Fri, 2 Dec 2016 15:30:14 -0500 Subject: [PATCH 1/2] Identify Cloud Images as Snapshots if they descend from a parent VM --- app/models/manageiq/providers/cloud_manager/template.rb | 8 ++++++++ .../views/ManageIQ_Providers_CloudManager_Template.yaml | 9 ++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/app/models/manageiq/providers/cloud_manager/template.rb b/app/models/manageiq/providers/cloud_manager/template.rb index b22096a4b1e..75655b170e0 100644 --- a/app/models/manageiq/providers/cloud_manager/template.rb +++ b/app/models/manageiq/providers/cloud_manager/template.rb @@ -1,6 +1,14 @@ class ManageIQ::Providers::CloudManager::Template < ::MiqTemplate default_value_for :cloud, true + def image? + genealogy_parent.nil? + end + + def snapshot? + !genealogy_parent.nil? + end + def self.eligible_for_provisioning super.where(:type => %w(ManageIQ::Providers::Amazon::CloudManager::Template ManageIQ::Providers::Openstack::CloudManager::Template diff --git a/product/views/ManageIQ_Providers_CloudManager_Template.yaml b/product/views/ManageIQ_Providers_CloudManager_Template.yaml index 736c70d9438..ff0260ddd06 100644 --- a/product/views/ManageIQ_Providers_CloudManager_Template.yaml +++ b/product/views/ManageIQ_Providers_CloudManager_Template.yaml @@ -24,6 +24,7 @@ cols: - allocated_disk_storage - last_scan_on - region_description +- image? # Included tables (joined, has_one, has_many) and columns include: @@ -46,6 +47,7 @@ include_for_find: col_order: - name - ext_management_system.name +- image? - last_compliance_status - allocated_disk_storage - hardware.bitness @@ -58,6 +60,7 @@ col_order: headers: - Name - Provider +- Type - Compliant - Allocated Size - Architecture @@ -67,7 +70,7 @@ headers: - Region # Condition(s) string for the SQL query -conditions: +conditions: # Order string for the SQL query order: Ascending @@ -90,8 +93,8 @@ group: n # StackedColumn # StackedThreedColumn -graph: +graph: # Dimensions of graph (1 or 2) # Note: specifying 2 for a single dimension graph may not return expected results -dims: +dims: From ba7d4d1e3983b58273ac7a3ae73570fa9c6baf25 Mon Sep 17 00:00:00 2001 From: Sam Lucidi Date: Wed, 11 Jan 2017 14:35:09 -0500 Subject: [PATCH 2/2] Convert DOS line-endings to Unix. --- ...ageIQ_Providers_CloudManager_Template.yaml | 201 +++++++++--------- 1 file changed, 101 insertions(+), 100 deletions(-) diff --git a/product/views/ManageIQ_Providers_CloudManager_Template.yaml b/product/views/ManageIQ_Providers_CloudManager_Template.yaml index ff0260ddd06..c48140f3b21 100644 --- a/product/views/ManageIQ_Providers_CloudManager_Template.yaml +++ b/product/views/ManageIQ_Providers_CloudManager_Template.yaml @@ -1,100 +1,101 @@ -# -# This is an MIQ Report configuration file -# Single value parameters are specified as: -# single_value_parm: value -# Multiple value parameters are specified as: -# multi_value_parm: -# - value 1 -# - value 2 -# - -# Report title -title: Images - -# Menu name -name: Images - -# Main DB table report is based on -db: TemplateCloud - -# Columns to fetch from the main table -cols: -- name -- last_compliance_status -- allocated_disk_storage -- last_scan_on -- region_description -- image? - -# Included tables (joined, has_one, has_many) and columns -include: - ext_management_system: - columns: - - name - hardware: - columns: - - bitness - - virtualization_type - - root_device_type - -# Included tables and columns for query performance -include_for_find: - :compliances: {} - :operating_system: {} - :tags: {} - -# Order of columns (from all tables) -col_order: -- name -- ext_management_system.name -- image? -- last_compliance_status -- allocated_disk_storage -- hardware.bitness -- hardware.virtualization_type -- hardware.root_device_type -- last_scan_on -- region_description - -# Column titles, in order -headers: -- Name -- Provider -- Type -- Compliant -- Allocated Size -- Architecture -- Virtualization Type -- Root Device Type -- Last Analysis Time -- Region - -# Condition(s) string for the SQL query -conditions: - -# Order string for the SQL query -order: Ascending - -# Columns to sort the report on, in order -sortby: -- name - -# Group rows (y=yes,n=no,c=count) -group: n - -# Graph type -# Bar -# Column -# ColumnThreed -# ParallelThreedColumn -# Pie -# PieThreed -# StackedBar -# StackedColumn -# StackedThreedColumn - -graph: - -# Dimensions of graph (1 or 2) -# Note: specifying 2 for a single dimension graph may not return expected results -dims: +# +# This is an MIQ Report configuration file +# Single value parameters are specified as: +# single_value_parm: value +# Multiple value parameters are specified as: +# multi_value_parm: +# - value 1 +# - value 2 +# + +# Report title +title: Images + +# Menu name +name: Images + +# Main DB table report is based on +db: TemplateCloud + +# Columns to fetch from the main table +cols: +- name +- last_compliance_status +- allocated_disk_storage +- last_scan_on +- region_description +- image? + +# Included tables (joined, has_one, has_many) and columns +include: + ext_management_system: + columns: + - name + hardware: + columns: + - bitness + - virtualization_type + - root_device_type + +# Included tables and columns for query performance +include_for_find: + :compliances: {} + :operating_system: {} + :hardware: {} + :tags: {} + +# Order of columns (from all tables) +col_order: +- name +- ext_management_system.name +- image? +- last_compliance_status +- allocated_disk_storage +- hardware.bitness +- hardware.virtualization_type +- hardware.root_device_type +- last_scan_on +- region_description + +# Column titles, in order +headers: +- Name +- Provider +- Type +- Compliant +- Allocated Size +- Architecture +- Virtualization Type +- Root Device Type +- Last Analysis Time +- Region + +# Condition(s) string for the SQL query +conditions: + +# Order string for the SQL query +order: Ascending + +# Columns to sort the report on, in order +sortby: +- name + +# Group rows (y=yes,n=no,c=count) +group: n + +# Graph type +# Bar +# Column +# ColumnThreed +# ParallelThreedColumn +# Pie +# PieThreed +# StackedBar +# StackedColumn +# StackedThreedColumn + +graph: + +# Dimensions of graph (1 or 2) +# Note: specifying 2 for a single dimension graph may not return expected results +dims: