Class: IbmPowerHmc::VirtualIOServer

Inherits:
BasePartition show all
Defined in:
lib/ibm_power_hmc/schema/uom.rb

Overview

VIOS information

Constant Summary

Constants inherited from BasePartition

BasePartition::ATTRS

Constants inherited from AbstractNonRest

AbstractNonRest::ATTRS

Instance Attribute Summary

Attributes inherited from AbstractRest

#content_type, #etag, #href, #published, #uuid

Attributes inherited from AbstractNonRest

#xml

Instance Method Summary collapse

Methods inherited from BasePartition

#group_uuids, #io_adapters, #io_slots, #lhea_ports, #net_adap_uuids, #paging_vios_uuid, #paging_vios_uuids, #shared_processor_pool_uuid, #sriov_elp_uuids, #sys_uuid

Methods inherited from AbstractRest

#initialize, #to_s

Methods inherited from AbstractNonRest

#collection_of, #create_element, #initialize, marshal, #marshal, #singleton, #timestamp, #to_s, #uuid_from_href, #uuids_from_links

Constructor Details

This class inherits a constructor from IbmPowerHmc::AbstractRest

Instance Method Details

#capabilitiesObject



339
340
341
342
343
# File 'lib/ibm_power_hmc/schema/uom.rb', line 339

def capabilities
  xml.get_elements("VirtualIOServerCapabilities/*").map do |elem|
    elem.name if elem.text&.strip == "true"
  end.compact.concat(super)
end

#pvsObject



345
346
347
# File 'lib/ibm_power_hmc/schema/uom.rb', line 345

def pvs
  collection_of("PhysicalVolumes", "PhysicalVolume")
end

#repObject



353
354
355
356
# File 'lib/ibm_power_hmc/schema/uom.rb', line 353

def rep
  elem = xml.elements["MediaRepositories/VirtualMediaRepository"]
  VirtualMediaRepository.new(elem) unless elem.nil?
end

#seasObject



395
396
397
# File 'lib/ibm_power_hmc/schema/uom.rb', line 395

def seas
  collection_of("SharedEthernetAdapters", "SharedEthernetAdapter")
end

#trunksObject



399
400
401
# File 'lib/ibm_power_hmc/schema/uom.rb', line 399

def trunks
  collection_of("TrunkAdapters", "TrunkAdapter")
end

#vfc_mapping_delete!(location) ⇒ Object

Remove VFC mapping (vfchostX) from XML



380
381
382
383
# File 'lib/ibm_power_hmc/schema/uom.rb', line 380

def vfc_mapping_delete!(location)
  mapping = vfc_mappings.find { |m| m.server&.location == location }
  mapping.xml.parent.delete(mapping.xml) unless mapping.nil?
end

#vfc_mapping_unmap!(location) ⇒ Object

Remove FC adapter mapping (fcsX) from XML



386
387
388
389
390
391
392
393
# File 'lib/ibm_power_hmc/schema/uom.rb', line 386

def vfc_mapping_unmap!(location)
  mapping = vfc_mappings.find { |m| m.port && m.server&.location == location }
  return if mapping.nil?

  mapping.port.xml.parent.delete(mapping.port.xml)
  mapping.server.map_port = nil
  mapping.server.xml.delete(mapping.server.port.xml) unless mapping.server.port.nil?
end

#vfc_mappingsObject



375
376
377
# File 'lib/ibm_power_hmc/schema/uom.rb', line 375

def vfc_mappings
  collection_of("VirtualFibreChannelMappings", "VirtualFibreChannelMapping")
end

#vg_uuidsObject



349
350
351
# File 'lib/ibm_power_hmc/schema/uom.rb', line 349

def vg_uuids
  uuids_from_links("StoragePools")
end

#vscsi_mapping_delete!(location) ⇒ Object

Remove VSCSI mapping (vhostX) from XML



363
364
365
366
367
# File 'lib/ibm_power_hmc/schema/uom.rb', line 363

def vscsi_mapping_delete!(location)
  vscsi_mappings.each do |mapping|
    mapping.xml.parent.delete(mapping.xml) if mapping.server&.location == location
  end
end

#vscsi_mapping_unmap!(target) ⇒ Object

Remove VSCSI target (vtscsiX) from XML



370
371
372
373
# File 'lib/ibm_power_hmc/schema/uom.rb', line 370

def vscsi_mapping_unmap!(target)
  mapping = vscsi_mappings.find { |m| m.device&.target == target }
  mapping.xml.parent.delete(mapping.xml) unless mapping.nil?
end

#vscsi_mappingsObject



358
359
360
# File 'lib/ibm_power_hmc/schema/uom.rb', line 358

def vscsi_mappings
  collection_of("VirtualSCSIMappings", "VirtualSCSIMapping")
end