class Sys

Attributes

_variables[R]
active_lpar_mobility_capable[R]
active_lpar_share_idle_procs_capable[R]
active_mem_expansion_capable[R]
active_mem_sharing_capable[R]
addr_broadcast_perf_policy_capable[R]
application_capable_5250[R]
assign_5250_cpw_percent[R]
bsr_capable[R]
cod_mem_capable[R]
cod_proc_capable[R]
curr_mfg_default_boot_mode[R]
curr_mfg_default_ipl_source[R]
curr_power_on_side[R]
curr_power_on_speed[R]
curr_power_on_speed_override[R]
curr_sys_keylock[R]
dataString[R]
detailed_state[R]
dynamic_platform_optimization_capable[R]
electronic_err_reporting_capable[R]
firmware_power_saver_capable[R]
hardware_active_mem_expansion_capable[R]
hardware_discovery_capable[R]
hardware_power_saver_capable[R]
hca_bandwidth_capabilities[R]
hca_capable[R]
hmc[RW]
huge_page_mem_capable[R]
inactive_lpar_mobility_capable[R]
ipaddr[R]
lhea_capable[R]
lpar_avail_priority_capable[R]
lpar_proc_compat_mode_capable[R]
lpar_remote_restart_capable[R]
lpar_suspend_capable[R]
max_lpars[R]
max_power_ctrl_lpars[R]
max_remote_restart_capable_lpars[R]
max_suspend_capable_lpars[R]
mfg_default_config[R]
micro_lpar_capable[R]
name[RW]

power5

os400_capable[R]
pend_mfg_default_boot_mode[R]
pend_mfg_default_ipl_source[R]
pend_power_on_lpar_start_policy[R]
pend_power_on_option[R]
pend_power_on_side[R]
pend_power_on_speed[R]
pend_power_on_speed_override[R]
pend_sys_keylock[R]
power_off_policy[R]
power_on_attr[R]
power_on_lpar_start_policy[R]
power_on_method[R]
power_on_option[R]
power_on_type[R]
powervm_lpar_remote_restart_capable[R]
redundant_err_path_reporting_capable[R]
serial_num[R]
service_lpar_id[R]
service_lpar_name[R]
shared_eth_failover_capable[R]
sni_msg_passing_capable[R]
sp_boot_attr[R]
sp_boot_major_type[R]
sp_boot_minor_type[R]
sp_failover_capable[R]
sp_version[R]
state[R]
sys[R]
sys_time[R]
type_model[R]
vet_activation_capable[R]
virtual_fc_capable[R]
virtual_io_server_capable[R]
virtual_switch_capable[R]
vsi_on_veth_capable[R]
vsn_phase2_capable[R]

Public Class Methods

new(name = '', hmc = '') click to toggle source
# File lib/HMC/Sys.rb, line 91
def initialize(name = '', hmc = '')

  @name = name
  @hmc = hmc

  @_variables = {}
  @_variables['int'] = %w[
    addr_broadcast_perf_policy_capable
    firmware_power_saver_capable
    hardware_power_saver_capable
    hca_capable
    huge_page_mem_capable
    sp_failover_capable
    sni_msg_passing_capable
    max_power_ctrl_lpars
  ]

  @_variables['int_unavialble'] = %w[
    power_off_policy
    active_lpar_mobility_capable
    inactive_lpar_mobility_capable
    active_lpar_share_idle_procs_capable
    active_mem_expansion_capable
    hardware_active_mem_expansion_capable
    active_mem_sharing_capable
    bsr_capable
    cod_mem_capable
    cod_proc_capable
    dynamic_platform_optimization_capable
    electronic_err_reporting_capable
    hardware_discovery_capable
    lhea_capable
    lpar_avail_priority_capable
    lpar_proc_compat_mode_capable
    lpar_remote_restart_capable
    powervm_lpar_remote_restart_capable
    lpar_suspend_capable
    micro_lpar_capable
    os400_capable
    redundant_err_path_reporting_capable
    shared_eth_failover_capable
    vet_activation_capable
    virtual_fc_capable
    virtual_io_server_capable
    virtual_switch_capable
    vsn_phase2_capable
    vsi_on_veth_capable
    assign_5250_cpw_percent
    max_lpars
    max_remote_restart_capable_lpars
    max_suspend_capable_lpars
    hca_bandwidth_capabilities
    mfg_default_config
  ]

  @_variables['string'] = %w[
    name type_model
    serial_num ipaddr
    state detailed_state
    sys_time
    service_lpar_id
    service_lpar_name
    curr_sys_keylock
    pend_sys_keylock
    curr_power_on_side
    pend_power_on_side
    curr_power_on_speed
    pend_power_on_speed
    curr_power_on_speed_override
    pend_power_on_speed_override
    power_on_type
    power_on_option
    power_on_lpar_start_policy
    pend_power_on_option
    pend_power_on_lpar_start_policy
    power_on_method
    power_on_attr
    sp_boot_attr
    sp_boot_major_type
    sp_boot_minor_type sp_version
    curr_mfg_default_ipl_source
    pend_mfg_default_ipl_source
    curr_mfg_default_boot_mode
    pend_mfg_default_boot_mode
  ]

end

Public Instance Methods

dataGet_cmd() click to toggle source
# File lib/HMC/Sys.rb, line 249
def dataGet_cmd
  'lssyscfg -r sys'
end
dataSet(data_string) click to toggle source
# File lib/HMC/Sys.rb, line 179
def dataSet(data_string)
  @dataString = data_string
end
decodeString(string) click to toggle source
# File lib/HMC/Sys.rb, line 212
def decodeString(string)

  HmcString.parse(string).each do |name, value|

    if @_variables['int_unavialble'].include?(name)
      if value == 'unavailable' || value == 'null'
        instance_variable_set("@#{name}", value.to_s)
      else
        instance_variable_set("@#{name}", value.to_i)
      end
    elsif @_variables['int'].include?(name)
      instance_variable_set("@#{name}", value.to_i)
    elsif @_variables['string'].include?(name)
      instance_variable_set("@#{name}", value.to_s)
    elsif  name == '5250_application_capable'
      @application_capable_5250 = value.to_i
    else
      print "unknown name: #{name} with value #{value}"
      raise
    end
  end

end
Also aliased as: parse
findLparID_cmd(lparName) click to toggle source
# File lib/HMC/Sys.rb, line 267
def findLparID_cmd lparName
  "lssyscfg -r lpar -m #{@name} --filter \"lpar_names=#{lparName}\" -F lpar_id"
end
findLparName_cmd(lparID) click to toggle source
# File lib/HMC/Sys.rb, line 271
def findLparName_cmd lparID
  "lssyscfg -r lpar -m #{@name} --filter \"lpar_ids=#{lparID}\" -F name"
end
getLparsList_cmd() click to toggle source
# File lib/HMC/Sys.rb, line 275
def getLparsList_cmd
  "lssyscfg -r lpar -m #{@name} -F \"lpar_id,name\""
end
getLparsScsiSlots_cmd() click to toggle source
# File lib/HMC/Sys.rb, line 279
def getLparsScsiSlots_cmd
  "lshwres -r virtualio --rsubtype scsi -m #{@name} --level lpar"
end
getProfiles_cmd() click to toggle source
# File lib/HMC/Sys.rb, line 283
def getProfiles_cmd
  "lssyscfg -r prof -m #{@name}"
end
lslic_cmd() click to toggle source

www.ibm.com/support/knowledgecenter/P8ESS/p8edm/lslic.html lslic - list Licensed Internal Code levels

# File lib/HMC/Sys.rb, line 289
def lslic_cmd
  "lslic -m #{@name} -t syspower"
end
parse(string)
Alias for: decodeString
parse_f(string, format) click to toggle source
# File lib/HMC/Sys.rb, line 183
def parse_f(string, format)

  values = string.split(',')
  keys = format.split(',')

  keys.each_index do |id|
    key = keys[id]
    value = values[id]

    if @_variables['int_unavialble'].include?(key)
      if value == 'unavailable' && value == 'null'
        instance_variable_set("@#{key}", value.to_s)
      else
        instance_variable_set("@#{key}", value.to_i)
      end
    elsif @_variables['string'].include?(key)
      instance_variable_set("@#{key}", value.to_s)
    elsif @_variables['int'].include?(key)
      instance_variable_set("@#{key}", value.to_i)
    elsif  key == '5250_application_capable'
      @application_capable_5250 = value.to_i
    else
      print "unknown name: #{key} with value #{value}"
      raise
    end
  end
end
start_cmd() click to toggle source
# File lib/HMC/Sys.rb, line 253
def start_cmd
  "chsysstate -m #{@name} -r sys -o on"
end
start_time() click to toggle source

each type of frame can have different time to start this function is used in sleep value to not check to often the state of frame

# File lib/HMC/Sys.rb, line 259
def start_time
  120
end
statusCheck_cmd() click to toggle source
# File lib/HMC/Sys.rb, line 245
def statusCheck_cmd
  "lssyscfg -m #{@name} -r sys -F state"
end
stop_cmd() click to toggle source
# File lib/HMC/Sys.rb, line 263
def stop_cmd
  "chsysstate -m #{@name} -r sys -o off"
end
type_model_serial() click to toggle source
# File lib/HMC/Sys.rb, line 238
def type_model_serial
  raise 'unknown type_model' if type_model.nil?
  raise 'unknown serial' if serial_num.nil?

  type_model.to_s + '*' + serial_num
end