Skip to content

Commit

Permalink
make supported storage types consistent
Browse files Browse the repository at this point in the history
The listed of supported storage types was different between metrics capture, vm_scan, and vm path
This made them consistent.
  • Loading branch information
kbrock committed Dec 1, 2022
1 parent d53db38 commit c6e97ef
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion app/models/storage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class Storage < ApplicationRecord

delegate :queue_name_for_ems_operations, :to => :ext_management_system, :allow_nil => true

SUPPORTED_STORAGE_TYPES = %w( VMFS NFS NFS41 FCP ISCSI GLUSTERFS )
SUPPORTED_STORAGE_TYPES = %w[VSAN VMFS NAS NFS NFS41 ISCSI DIR FCP CSVFS NTFS GLUSTERFS].freeze

supports :smartstate_analysis do
if !ext_management_system&.class&.supports?(:smartstate_analysis)
Expand Down
12 changes: 4 additions & 8 deletions app/models/vm_or_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1143,14 +1143,10 @@ def path
# Return location for RHEV-M VMs
return rhevm_config_path if vendor.to_s.downcase == 'redhat'

case storage.store_type
when "VMFS" then "[#{storage.name}] #{location}"
when "VSAN" then "[#{storage.name}] #{location}"
when "NFS" then "[#{storage.name}] #{location}"
when "NFS41" then "[#{storage.name}] #{location}"
when "NTFS" then "[#{storage.name}] #{location}"
when "CSVFS" then "[#{storage.name}] #{location}"
when "NAS" then File.join(storage.name, location)
if storage.store_type == "NAS"
File.join(storage.name, location)
elsif storage.storage_type_supported?
"[#{storage.name}] #{location}"
else
_log.warn("VM [#{name}] storage type [#{storage.store_type}] not supported")
@path = location
Expand Down
2 changes: 1 addition & 1 deletion app/models/vm_scan/dispatcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def get_eligible_proxies_for_job(job)
queue_signal(job, {:args => [:abort, msg, "error"]})
return []
else
unless %w[VSAN VMFS NAS NFS NFS41 ISCSI DIR FCP CSVFS NTFS GLUSTERFS].include?(@vm.storage.store_type)
unless @vm.storage.storage_type_supported?
msg = "Vm storage type [#{@vm.storage.store_type}] unsupported [#{job.target_id}], aborting job [#{job.guid}]."
queue_signal(job, {:args => [:abort, msg, "error"]})
return []
Expand Down

0 comments on commit c6e97ef

Please sign in to comment.