예제 #1
0
  @Override
  public String getSecondaryStorageStoreUrl(long dcId) {

    String secUrl = null;
    DataStore secStore = _dataStoreMgr.getImageStore(dcId);
    if (secStore != null) {
      secUrl = secStore.getUri();
    }

    if (secUrl == null) {
      // we are using non-NFS image store, then use cache storage instead
      s_logger.info("Secondary storage is not NFS, we need to use staging storage");
      DataStore cacheStore = _dataStoreMgr.getImageCacheStore(dcId);
      if (cacheStore != null) {
        secUrl = cacheStore.getUri();
      } else {
        s_logger.warn("No staging storage is found when non-NFS secondary storage is used");
      }
    }

    return secUrl;
  }