Github user rafaelweingartner commented on the pull request:
https://github.com/apache/cloudstack/pull/1056#issuecomment-155595167
@DaanHoogland, sorry if I am being stubborn, but I really do not see what
the method âendPointSelector.selectHypervisorHostâ is used for; at the end
we get the âEndPointâ and use just the host_id of that object, then we load
the host using that id and the details of that host.
My point is that, if the host does not matter, why not use the host we have
already loaded in line 113, and then load the details of that host. If we do
that, we can remove the âendPointSelector.selectHypervisorHostâ method.
The configure method you talked about
(org.apache.cloudstack.storage.RemoteHostEndPoint.configure(Host)) will load
the âpublicAddressâ,if the host it receives as a parameter is a SSVM.
However, the select âselect h.id from host h where h.status = 'Up' and
h.hypervisor_type is not nullâ that is executed in
(endPointSelector.selectHypervisorHost) will not return any of the system VMs,
because they have âhypervisor_typeâ value as null. Therefore, we are using
that method without needing it; that method will just return a random host of
the environment.
---
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.
---