Skip to content

Userdispersing algorithm does not consider VMs in starting state #11606

@akrasnov-drv

Description

@akrasnov-drv

problem

I tried to use userdispersing algorithm for volumes and VMs, still I've got numerous VMs starting on the same host. See #11412
In the end it was confirmed that algorithm considers just running VMs.
As VM start takes time, and VMs are started in packs (Jenkins jcloud plugin), all VMs are placed to the same host. Finally I had to switch to random algo that do dispersing a lot better (though not ideal)
I believe that as soon as VM is assigned for start on a host (still in Starting state), it should be already considered by userdispersing algorithm.

versions

CloudStack 4.21.0.0, though I had the same issue with 4.20
KVM
local fat volumes

The steps to reproduce the bug

  1. Confiugre CS to use userdispersing algorithm (volumes and VMs)
  2. Start several VMs via api without waiting for response that VM was started, e.g.
for i in {01..10}; do cloudstack deployVirtualMachine serviceofferingid=XXX templateid=YYY zoneid=ZZZ name=test-${i} & done

in my env all VMs start on the same host, even if I add some delay to the loop, unless the delay is enough to fully start VM

What to do about it?

Algorithm should query both Running and Starting VMs and use that data to decide the next VM placement

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