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



337
338
339
340
341
# File 'lib/ibm_power_hmc/schema/uom.rb', line 337

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

#pvsObject



343
344
345
# File 'lib/ibm_power_hmc/schema/uom.rb', line 343

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

#repObject



351
352
353
354
# File 'lib/ibm_power_hmc/schema/uom.rb', line 351

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

#seasObject



393
394
395
# File 'lib/ibm_power_hmc/schema/uom.rb', line 393

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

#trunksObject



397
398
399
# File 'lib/ibm_power_hmc/schema/uom.rb', line 397

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

#vfc_mapping_delete!(location) ⇒ Object

Remove VFC mapping (vfchostX) from XML



378
379
380
381
# File 'lib/ibm_power_hmc/schema/uom.rb', line 378

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



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

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



373
374
375
# File 'lib/ibm_power_hmc/schema/uom.rb', line 373

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

#vg_uuidsObject



347
348
349
# File 'lib/ibm_power_hmc/schema/uom.rb', line 347

def vg_uuids
  uuids_from_links("StoragePools")
end

#vscsi_mapping_delete!(location) ⇒ Object

Remove VSCSI mapping (vhostX) from XML



361
362
363
364
365
# File 'lib/ibm_power_hmc/schema/uom.rb', line 361

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



368
369
370
371
# File 'lib/ibm_power_hmc/schema/uom.rb', line 368

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



356
357
358
# File 'lib/ibm_power_hmc/schema/uom.rb', line 356

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