Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Storage subclass #494

Merged
merged 1 commit into from
Dec 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/models/manageiq/providers/vmware/infra_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class Vmware::InfraManager < InfraManager
require_nested :RefreshWorker
require_nested :RefreshParser
require_nested :ResourcePool
require_nested :Storage
require_nested :MetricsCapture
require_nested :MetricsCollectorWorker
require_nested :Refresher
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ def self.storage_inv_to_hashes(inv)
new_result = {
:ems_ref => mor,
:ems_ref_type => mor.vimType,
:type => "ManageIQ::Providers::Vmware::InfraManager::Storage",
:name => summary["name"],
:store_type => summary["type"].to_s.upcase,
:total_space => summary["capacity"],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class ManageIQ::Providers::Vmware::InfraManager::Storage < ManageIQ::Providers::InfraManager::Storage
include ManageIQ::Providers::Vmware::InfraManager::EmsRefObjMixin
end
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def raw_clone(name, folder, pool = nil, host = nil, datastore = nil, powerOn = f
folder_mor = folder.ems_ref_obj if folder.respond_to?(:ems_ref_obj)
pool_mor = pool.ems_ref_obj if pool.respond_to?(:ems_ref_obj)
host_mor = host.ems_ref_obj if host.respond_to?(:ems_ref_obj)
datastore_mor = VimString.new(datastore.ems_ref, datastore.ems_ref_type, :ManagedObjectReference) if datastore
datastore_mor = datastore.ems_ref_obj if datastore.respond_to?(:ems_ref_obj)
run_command_via_parent(:vm_clone, :name => name, :folder => folder_mor, :pool => pool_mor, :host => host_mor, :datastore => datastore_mor, :powerOn => powerOn, :template => template_flag, :transform => transform, :config => config, :customization => customization, :disk => disk)
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ def raw_relocate(host, pool = nil, datastore = nil, disk_move_type = nil, transf
end
end

host_mor = host.ems_ref_obj if host
pool_mor = pool.ems_ref_obj if pool
datastore_mor = VimString.new(datastore.ems_ref, datastore.ems_ref_type, :ManagedObjectReference) if datastore
host_mor = host.ems_ref_obj if host
pool_mor = pool.ems_ref_obj if pool
datastore_mor = datastore.ems_ref_obj if datastore

run_command_via_parent(:vm_relocate, :host => host_mor, :pool => pool_mor, :datastore => datastore_mor, :disk_move_type => disk_move_type, :transform => transform, :priority => priority, :disk => disk)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,7 @@ def assert_specific_datastore
:name => "GlobalDS_0",
:store_type => "VMFS",
:total_space => 1_099_511_627_776,
:type => "ManageIQ::Providers::Vmware::InfraManager::Storage",
:free_space => 824_633_720_832,
:multiplehostaccess => 1,
:directory_hierarchy_supported => true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ def assert_specific_storage
expect(@storage).to have_attributes(
:ems_ref => "datastore-953",
:ems_ref_type => "Datastore",
:type => "ManageIQ::Providers::Vmware::InfraManager::Storage",
:name => "StarM1-Prod1 (1)",
:store_type => "VMFS",
:total_space => 524254445568,
Expand Down