Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MRPHS-4262: Update CreateVMs call to use round-robin strategy for placements of vm on available hosts in cluster #79

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

avnish30jn
Copy link

@avnish30jn avnish30jn commented Jan 4, 2018

Jira-id

MRPHS-4262

Problem

Create vms in halo should use round-robin strategy to place the vms on hosts for which we need a list of hosts filtered on the basis of the networks to be assigned to the vm.

Resolution

Implemented a method to return the list of filtered hosts based on the networks to be assigned to the vm.

Testing

In progress

Copy link

@nirav1007 nirav1007 left a comment

Choose a reason for hiding this comment

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

Few comments inline.

err = vm.collector.Retrieve(vm.ctx, filteredHosts, []string{
"name"}, &hsMos)
if err != nil {
return err

Choose a reason for hiding this comment

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

Empty hosts list should also be returned.

@@ -1899,3 +1899,47 @@ func (vm *VM) ValidateAuth() error {
defer vm.cancel()
return nil
}

// GetFilteredHosts: Lists the hosts compatible with the network and datastores
func GetFilteredHosts(vm *VM) ([]string, error) {

Choose a reason for hiding this comment

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

It is understood that we are using filterHosts method at core and thus named it GetFilteredHosts, but will renaming it to compatibleHosts & GetCompatibleHosts make more sense?

@avnish30jn avnish30jn changed the base branch from c3vmware to master February 9, 2018 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants