// @Test(priority=3)
 public void tearDown() {
   List<StoragePoolVO> ds = primaryStoreDao.findPoolByName(this.primaryName);
   for (int i = 0; i < ds.size(); i++) {
     StoragePoolVO store = ds.get(i);
     store.setUuid(null);
     primaryStoreDao.remove(ds.get(i).getId());
     primaryStoreDao.expunge(ds.get(i).getId());
   }
 }
  public DataStore createPrimaryDataStore() {
    try {
      String uuid = UUID.nameUUIDFromBytes(this.getPrimaryStorageUrl().getBytes()).toString();
      List<StoragePoolVO> pools = primaryDataStoreDao.findPoolByName(this.primaryName);
      if (pools.size() > 0) {
        return this.dataStoreMgr.getPrimaryDataStore(pools.get(0).getId());
      }

      /*
       * DataStoreProvider provider =
       * dataStoreProviderMgr.getDataStoreProvider
       * ("cloudstack primary data store provider"); Map<String, Object>
       * params = new HashMap<String, Object>(); URI uri = new
       * URI(this.getPrimaryStorageUrl()); params.put("url",
       * this.getPrimaryStorageUrl()); params.put("server",
       * uri.getHost()); params.put("path", uri.getPath());
       * params.put("protocol",
       * Storage.StoragePoolType.NetworkFilesystem); params.put("zoneId",
       * dcId); params.put("clusterId", clusterId); params.put("name",
       * this.primaryName); params.put("port", 1); params.put("podId",
       * this.podId); params.put("roles",
       * DataStoreRole.Primary.toString()); params.put("uuid", uuid);
       * params.put("providerName", String.valueOf(provider.getName()));
       *
       * DataStoreLifeCycle lifeCycle = provider.getDataStoreLifeCycle();
       * DataStore store = lifeCycle.initialize(params); ClusterScope
       * scope = new ClusterScope(clusterId, podId, dcId);
       * lifeCycle.attachCluster(store, scope);
       */

      StoragePoolVO pool = new StoragePoolVO();
      pool.setClusterId(clusterId);
      pool.setDataCenterId(dcId);
      URI uri = new URI(this.getPrimaryStorageUrl());
      pool.setHostAddress(uri.getHost());
      pool.setPath(uri.getPath());
      pool.setPort(0);
      pool.setName(this.primaryName);
      pool.setUuid(this.getPrimaryStorageUuid());
      pool.setStatus(StoragePoolStatus.Up);
      pool.setPoolType(StoragePoolType.VMFS);
      pool.setPodId(podId);
      pool.setScope(ScopeType.CLUSTER);
      pool.setStorageProviderName("cloudstack primary data store provider");
      pool = this.primaryStoreDao.persist(pool);
      DataStore store = this.dataStoreMgr.getPrimaryDataStore(pool.getId());
      return store;
    } catch (Exception e) {
      return null;
    }
  }