createTemplate();
}
@Test
public void testCreatePrimaryStorage() {
DataStoreProvider provider = dataStoreProviderMgr.getDataStoreProvider("default primary data store provider");
Map<String, String> params = new HashMap<String, String>();
URI uri = null;
try {
uri = new URI(this.getPrimaryStorageUrl());
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
params.put("url", this.getPrimaryStorageUrl());
params.put("server", uri.getHost());
params.put("path", uri.getPath());
params.put("protocol", uri.getScheme());
params.put("dcId", dcId.toString());
params.put("clusterId", clusterId.toString());
params.put("name", this.primaryName);
params.put("port", "1");
params.put("roles", DataStoreRole.Primary.toString());
params.put("uuid", UUID.nameUUIDFromBytes(this.getPrimaryStorageUrl().getBytes()).toString());
params.put("providerId", String.valueOf(provider.getId()));
DataStoreLifeCycle lifeCycle = provider.getLifeCycle();
this.primaryStore = lifeCycle.initialize(params);
ClusterScope scope = new ClusterScope(clusterId, podId, dcId);
lifeCycle.attachCluster(this.primaryStore, scope);
}