Bug 1258960 - MigrateToServer can fail with destination host unknown (the underlying issue is deeper though).
MigrateToServer can fail with destination host unknown (the underlying issue ...
Product: ovirt-engine
Classification: oVirt
Component: General (Show other bugs)
Unspecified Unspecified
medium Severity high (vote)
: ovirt-3.6.3
Assigned To: Martin Sivák
Petr Matyáš
Depends On:
  Show dependency treegraph
Reported: 2015-09-01 11:30 EDT by Martin Sivák
Modified: 2016-02-18 06:06 EST (History)
12 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: A bug in and internal code inheritance. Consequence: When migrate to specific server was attempted with destination that was not available, the user did not get nice message. There was a confusing error instead. Fix: Bug fixed. Result: The user sees a nice error message with explanation when migration to explicit server is attempted and the destination is not available.
Story Points: ---
Clone Of:
Last Closed: 2016-02-18 06:06:03 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: SLA
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
rule-engine: ovirt‑3.6.z+
mgoldboi: exception+
mgoldboi: planning_ack+
rule-engine: devel_ack+
mavital: testing_ack+

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 45448 master ABANDONED scheduling: Clarify and fix the pinning/whitelist logic 2016-01-25 05:00 EST
oVirt gerrit 52676 master MERGED Use the proper whitelist for MigrateVmCommand.canDoAction 2016-01-27 07:08 EST
oVirt gerrit 52800 ovirt-engine-3.6 MERGED Use the proper whitelist for MigrateVmCommand.canDoAction 2016-01-28 03:01 EST
oVirt gerrit 52848 refs/tags/ovirt-engine-3.6.3 ABANDONED Use the proper whitelist for MigrateVmCommand.canDoAction 2016-02-03 07:33 EST
oVirt gerrit 53038 ovirt-engine-3.6.3 MERGED Use the proper whitelist for MigrateVmCommand.canDoAction 2016-02-03 08:16 EST

  None (edit)
Description Martin Sivák 2015-09-01 11:30:09 EDT
Description of problem:

The code contains a bug that reads all the candidate hosts back if they were filtered out because of none of the selected hosts passed the filtering stage.

The if block around org.ovirt.engine.core.bll.scheduling.SchedulingManager line 391 is the culprit here.

Version-Release number of selected component (if applicable):

3.6 snapshot as of today + master branch


1) Install three hosts
2) Create VMs A and B.
3) Create an affinity group containing A and B and set it to negative, enforcing
4) Start both VMs
5) Select VM A, Click Migrate and select the host where B is running as the target

Actual results:

The migration fails with destination host UNKNOWN.

Expected results:

Dialog telling me I cannot do the migration, because the host I selected has a VM from conflicting affinity group.

Other info:

- This does not happen when Run Once is used because Run Once uses the whitelist (org.ovirt.engine.core.bll.RunVmOnceCommand#getVdsWhiteList) together with destHostIdList.

- MigrateToServer also uses the whitelist, but only for the inherited run method from MigrateVmCommand (which uses getVdsWhitelist to get it).

- MigrateToServer's canDoAction is also inherited from MigrateVmCommand but uses getInitialHosts to fill the whitelist field of canSchedule... and the initialHosts argument is never used by anyone.

- So the bad line in selectBestHost is actually causing harm only in the MigrateToServer case as all other cases never pass any hosts to SchedulingManager#selectBestHost that would not be also in the destHostIdList. Which renders the referenced if line ineffective (when the list is empty, add all elements from empty list back to the list..).
Comment 1 Doron Fediuck 2016-01-24 03:46:19 EST
IIRC this was resolved as a part of pin to multiple hosts.
Can you please verify?
Comment 2 Martin Sivák 2016-01-25 04:59:40 EST
Actually, it is still a bug. I submitted a patch for it now - https://gerrit.ovirt.org/52676
Comment 3 Petr Matyáš 2016-02-11 05:16:58 EST
Verified on 3.6.3-2

Note You need to log in before you can comment on or make changes to this bug.