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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to