use of org.apache.cloudstack.storage.command.AttachPrimaryDataStoreCmd in project cloudstack by apache.
the class SamplePrimaryDataStoreLifeCycleImpl method attachCluster.
protected void attachCluster(DataStore store) {
// send down AttachPrimaryDataStoreCmd command to all the hosts in the
// cluster
List<EndPoint> endPoints = selector.selectAll(store);
CreatePrimaryDataStoreCmd createCmd = new CreatePrimaryDataStoreCmd(store.getUri());
EndPoint ep = endPoints.get(0);
HostVO host = hostDao.findById(ep.getId());
if (host.getHypervisorType() == HypervisorType.XenServer) {
ep.sendMessage(createCmd);
}
endPoints.get(0).sendMessage(createCmd);
AttachPrimaryDataStoreCmd cmd = new AttachPrimaryDataStoreCmd(store.getUri());
for (EndPoint endp : endPoints) {
endp.sendMessage(cmd);
}
}
Aggregations