Class: MiqHostStorageSystem

Inherits:
Object
  • Object
show all
Includes:
DRb::DRbUndumped, MiqBrokerVimConnectionCheck
Defined in:
lib/VMwareWebService/MiqVimBrokerMods.rb,
lib/VMwareWebService/MiqHostStorageSystem.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from MiqBrokerVimConnectionCheck

#connectionRemoved?

Constructor Details

#initialize(hssMor, invObj) ⇒ MiqHostStorageSystem

Returns a new instance of MiqHostStorageSystem.



4
5
6
7
# File 'lib/VMwareWebService/MiqHostStorageSystem.rb', line 4

def initialize(hssMor, invObj)
  @invObj = invObj
  @hssMor = hssMor
end

Instance Attribute Details

#invObjObject (readonly)

Returns the value of attribute invObj.



2
3
4
# File 'lib/VMwareWebService/MiqHostStorageSystem.rb', line 2

def invObj
  @invObj
end

Instance Method Details

#addInternetScsiSendTargets(iScsiHbaDevice, targets) ⇒ Object



38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/VMwareWebService/MiqHostStorageSystem.rb', line 38

def addInternetScsiSendTargets(iScsiHbaDevice, targets)
  ta = targets.kind_of?(Array) ? targets : [targets]
  unless ta.first.kind_of?(VimHash)
    nta = VimArray.new("ArrayOfHostInternetScsiHbaSendTarget") do |nt|
      ta.each do |t|
        nt << VimHash.new("HostInternetScsiHbaSendTarget") { |st| st.address = t }
      end
    end
    ta = nta
  end
  @invObj.addInternetScsiSendTargets(@hssMor, iScsiHbaDevice, ta)
end

#addInternetScsiStaticTargets(iScsiHbaDevice, targets) ⇒ Object



51
52
53
# File 'lib/VMwareWebService/MiqHostStorageSystem.rb', line 51

def addInternetScsiStaticTargets(iScsiHbaDevice, targets)
  @invObj.addInternetScsiStaticTargets(@hssMor, iScsiHbaDevice, targets)
end

#fileSystemVolumeInfoObject



9
10
11
# File 'lib/VMwareWebService/MiqHostStorageSystem.rb', line 9

def fileSystemVolumeInfo
  @invObj.getMoProp(@hssMor, 'fileSystemVolumeInfo')['fileSystemVolumeInfo']
end

#hostBusAdaptersByType(hbaType) ⇒ Object

hbaType:

HostBlockHba, HostFibreChannelHba, HostInternetScsiHba, HostParallelScsiHba


25
26
27
# File 'lib/VMwareWebService/MiqHostStorageSystem.rb', line 25

def hostBusAdaptersByType(hbaType)
  storageDeviceInfo.hostBusAdapter.delete_if { |hba| hba.xsiType != hbaType }
end

#multipathStateInfoObject



13
14
15
# File 'lib/VMwareWebService/MiqHostStorageSystem.rb', line 13

def multipathStateInfo
  @invObj.getMoProp(@hssMor, 'multipathStateInfo')['multipathStateInfo']
end

#softwareInternetScsiEnabled?Boolean

Returns:

  • (Boolean)


29
30
31
32
# File 'lib/VMwareWebService/MiqHostStorageSystem.rb', line 29

def softwareInternetScsiEnabled?
  sise = @invObj.getMoProp(@hssMor, 'storageDeviceInfo.softwareInternetScsiEnabled')['storageDeviceInfo']['softwareInternetScsiEnabled']
  sise == 'true'
end

#storageDeviceInfoObject



17
18
19
# File 'lib/VMwareWebService/MiqHostStorageSystem.rb', line 17

def storageDeviceInfo
  @invObj.getMoProp(@hssMor, 'storageDeviceInfo')['storageDeviceInfo']
end

#updateSoftwareInternetScsiEnabled(enabled) ⇒ Object



34
35
36
# File 'lib/VMwareWebService/MiqHostStorageSystem.rb', line 34

def updateSoftwareInternetScsiEnabled(enabled)
  @invObj.updateSoftwareInternetScsiEnabled(@hssMor, enabled)
end