Skip to content

Commit

Permalink
Merge pull request #15202 from djberg96/scvmm_overall_state
Browse files Browse the repository at this point in the history
Set maintenance column for SCVMM hosts.
(cherry picked from commit ad8edb6)

https://bugzilla.redhat.com/show_bug.cgi?id=1461535
  • Loading branch information
blomquisg authored and simaishi committed Jun 14, 2017
1 parent b778635 commit 009786b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ $vms = Get-SCVirtualMachine -VMMServer localhost -All |

$hosts = Get-SCVMHost -VMMServer localhost |
Select -Property CommunicationStateString,CoresPerCPU,DiskVolumes,DVDDriveList,
HyperVStateString,ID,LogicalProcessorCount,Name,OperatingSystem,PhysicalCPUCount,
HyperVStateString,ID,LogicalProcessorCount,Name,OperatingSystem,OverallState,PhysicalCPUCount,
ProcessorFamily,ProcessorManufacturer,ProcessorModel,ProcessorSpeed,TotalMemory,
@{name='HyperVVersionString';expression={$_.HyperVVersion -As [string]}},
@{name='OperatingSystemVersionString';expression={$_.OperatingSystemVersion -As [string]}},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ def parse_host(host)
:vmm_version => host['HyperVVersionString'],
:vmm_product => host_platform,
:power_state => lookup_power_state(host['HyperVStateString']),
:maintenance => lookup_overall_state(host['OverallState']),
:connection_state => lookup_connected_state(host['CommunicationStateString']),
:operating_system => process_os(host),
:hardware => process_host_hardware(host),
Expand Down Expand Up @@ -573,6 +574,10 @@ def identify_primary_ip(host)
end
end

def lookup_overall_state(overall_state)
overall_state.to_s.downcase != 'ok'
end

def lookup_power_state(power_state_input)
case power_state_input
when "Running" then "on"
Expand Down

0 comments on commit 009786b

Please sign in to comment.