Github user likitha commented on the pull request:
https://github.com/apache/cloudstack/pull/541#issuecomment-117515627
@wilderrodrigues ,
Background -
1. When CS tries to live migrate a volume, it chooses a host endpoint to
perform the migration by selecting any host that has the storage containing the
volume mounted on it. Now when we attempt to migrate a volume that is on a zone
wide storage, the endpoint could be any host in the zone because in case of
zone wide storage, every host in the zone has the storage mounted on it.
2. During migration, vCenter expects the target datastore/storage pool to
be mounted on the source host because the VM obviously needs to be able to
access the target datastore.
Now in the mentioned issue, say a host that doesn't contain the VM is
chosen as the endpoint. As mentioned above, it could happen because today CS
chooses any host that has the source storage mounted on it. In that case
migration will fail because this host cant see the target datastore.
By picking the host containing the volume's VM as endpoint we ensure that
both the source and target storage pools are visible to the VM irrespective of
the scope of the storage pool.
Previously, similar fixes have been made for other operations like volume
deletion, snapshot creation because in these cases as well the underlying
resource needs the VM of the volume to be visible to the host endpoint.
---
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.
---