func NewNodePool(nodes []Node, alloced []string) *nodePool {
	nodeMap := make(map[string]Node, len(nodes))
	for _, node := range nodes {
		nodeMap[node.Addr()] = node
	}
	p := &nodePool{
		nodes:     nodeMap,
		allocated: make(map[string]struct{}),
	}
	for _, alloc := range alloced {
		p.allocated[alloc] = struct{}{}
	}
	return p
}
NewNodePool creates a new instance of NodePool from specified nodes
and allocation state
package infra
import "github.com/gravitational/trace"