Github user rafaelweingartner commented on the pull request:
https://github.com/apache/cloudstack/pull/1056#issuecomment-155821415
Hi @DaanHoogland,
About the method: âendPointSelector.selectHypervisorHostâ.
I debugged the use of that method in my environment. I am using Xen; and
that method is used when creating a template from a snapshot; the CS will
execute the code:
âcom.cloud.hypervisor.XenServerGuru.getCommandHostDelegation(long, Command)â
ACS: 4.3.2
Xen (4.1) + XAPI (1.6), those components together are basically the same as
a xenserver 6.0. The difference is that we use Debian as our OS and not CentOS.
Look at what happened in my test, the hostHd received in the
âXenServerGuru.getCommandHostDelegationâ method was (100).
âXenServerGuru.getCommandHostDelegationâ loaded the host data from host
table to retrieve the dataCenterID, and then executed
âendPointSelector.selectHypervisorHostâ, that ended up selecting a host
that has the id (87) which is in a different cluster. Then it created the
âEndPointâ object that does not do much; there is a configure method
âorg.apache.cloudstack.storage.RemoteHostEndPoint.configure(Host)â that is
called, but it merely retrieves some data from the host object that was sent as
a parameter. After that in line 161 of
âXenServerGuru.getCommandHostDelegationâ it is loaded the host data using
the host id of the âEndPointâ object; then we check if the host (87) has a
fix âsnapshotHotFixâ; in my case, the host did not have, so it ended up
returning the original host id (100) at line 170.
Even if the host (87) had the âsnapshotHotFixâ, I do not understand why
it is getting a host at random in the environment; If the host does not matter,
why not use the host that the method already received as a parameter?
The name of the method
âorg.apache.cloudstack.storage.endpoint.DefaultEndPointSelector.selectHypervisorHostâ
does not say much, and its execution does not make much sense to me. I believe
it can be removed without any harm.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---