Skip to content

find_least_used_compatible_host in vsphere_helper does not cope with hosts with the same utilisation #206

@glennsarti

Description

@glennsarti

The find_least_used_compatible_host in the vsphere_helper throws an comparison of Array with Array failed error if two or more hosts shared the same utilisation.

This appears to be because Array.sort does not like/support this scenario in
https://github.com/puppetlabs/vmpooler/blob/master/lib/vmpooler/vsphere_helper.rb#L269

Instead we may need to implement our own comparison operator e.g. (this is an example only)

target_host = target_hosts.sort do |x,y|
  x <=> y || 1
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions