Skip to content

Identify when ESXi host quickstats do not return#248

Merged
mattkirby merged 1 commit into
puppetlabs:masterfrom
mattkirby:fix_nil_utilization
Jan 10, 2018
Merged

Identify when ESXi host quickstats do not return#248
mattkirby merged 1 commit into
puppetlabs:masterfrom
mattkirby:fix_nil_utilization

Conversation

@mattkirby

Copy link
Copy Markdown
Contributor

This commit updates cpu_utilization_for and memory_utilization_for to detect when quickstats are not present. Without this change a nil result is transformed to 0, which is perceived as a host that has no utilization.

Comment thread lib/vmpooler/providers/vsphere.rb Outdated

def memory_utilization_for(host)
memory_usage = host.summary.quickStats.overallMemoryUsage
rturn nil if memory_usage.nil?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return

@sbeaulie

Copy link
Copy Markdown
Contributor

I'm good with this change once the typo is fixed

@mattkirby mattkirby force-pushed the fix_nil_utilization branch from 807f631 to 493179b Compare January 10, 2018 20:01
@mattkirby

Copy link
Copy Markdown
Contributor Author

Fixed the typo.

This commit updates cpu_utilization_for and memory_utilization_for to detect when quickstats are not present. Without this change a nil result is transformed to 0, which is perceived as a host that has no utilization.
@mattkirby mattkirby force-pushed the fix_nil_utilization branch from 493179b to 46b7484 Compare January 10, 2018 20:17
@mattkirby mattkirby merged commit ea9dedd into puppetlabs:master Jan 10, 2018
@mattkirby mattkirby deleted the fix_nil_utilization branch January 10, 2018 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants