cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mc...@apache.org
Subject [3/50] [abbrv] git commit: refs/heads/vim51_win8 - fix adding nfs primary storage and build and load
Date Mon, 25 Feb 2013 20:46:47 GMT
fix adding nfs primary storage and build and load


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/3bb713c5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/3bb713c5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/3bb713c5

Branch: refs/heads/vim51_win8
Commit: 3bb713c5ced89eee6d0b0a1f970ad88bcf5f7d54
Parents: 8a52347
Author: Edison Su <sudison@gmail.com>
Authored: Thu Feb 21 16:24:15 2013 -0800
Committer: Edison Su <sudison@gmail.com>
Committed: Thu Feb 21 16:24:39 2013 -0800

----------------------------------------------------------------------
 .../AncientPrimaryDataStoreLifeCyclImpl.java       |   14 ++++++++++----
 ...DefaultPrimaryDataStoreProviderManagerImpl.java |    6 ++++--
 .../AncientPrimaryDataStoreProviderImpl.java       |    3 +++
 .../com/cloud/ucs/database/UcsBladeDaoImpl.java    |    5 ++++-
 .../com/cloud/ucs/database/UcsManagerDaoImpl.java  |    5 ++++-
 .../src/com/cloud/storage/StorageManagerImpl.java  |   13 +++----------
 6 files changed, 28 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/3bb713c5/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/lifecycle/AncientPrimaryDataStoreLifeCyclImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/lifecycle/AncientPrimaryDataStoreLifeCyclImpl.java
b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/lifecycle/AncientPrimaryDataStoreLifeCyclImpl.java
index 3ce14ee..2167ba1 100644
--- a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/lifecycle/AncientPrimaryDataStoreLifeCyclImpl.java
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/lifecycle/AncientPrimaryDataStoreLifeCyclImpl.java
@@ -204,7 +204,11 @@ public class AncientPrimaryDataStoreLifeCyclImpl implements
 
         String scheme = uri.getScheme();
         String storageHost = uri.getHost();
-        String hostPath = uri.getPath().replaceFirst("/", "");
+        String hostPath = uri.getPath();
+        Object localStorage = dsInfos.get("localStorage");
+        if (localStorage != null) {
+            hostPath = hostPath.replace("/", "");
+        }
         String userInfo = uri.getUserInfo();
         int port = uri.getPort();
         StoragePoolVO pool = null;
@@ -310,7 +314,6 @@ public class AncientPrimaryDataStoreLifeCyclImpl implements
                     "Unable to figure out the scheme for URI: " + uri);
         }
 
-        Object localStorage = dsInfos.get("localStorage");
         if (localStorage == null) {
             List<StoragePoolVO> pools = primaryDataStoreDao
                     .listPoolByHostPath(storageHost, hostPath);
@@ -463,8 +466,11 @@ public class AncientPrimaryDataStoreLifeCyclImpl implements
 
     @Override
     public boolean attachZone(DataStore dataStore, ZoneScope scope) {
-        // TODO Auto-generated method stub
-        return false;
+        StoragePoolVO pool = this.primaryDataStoreDao.findById(dataStore.getId());
+        pool.setScope(ScopeType.ZONE);
+        pool.setStatus(StoragePoolStatus.Up);
+        this.primaryDataStoreDao.update(pool.getId(), pool);
+        return true;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/3bb713c5/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/manager/DefaultPrimaryDataStoreProviderManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/manager/DefaultPrimaryDataStoreProviderManagerImpl.java
b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/manager/DefaultPrimaryDataStoreProviderManagerImpl.java
index f395061..e181ada 100644
--- a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/manager/DefaultPrimaryDataStoreProviderManagerImpl.java
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/manager/DefaultPrimaryDataStoreProviderManagerImpl.java
@@ -36,6 +36,8 @@ import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
 import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
 import org.springframework.stereotype.Component;
 
+import com.cloud.storage.StorageManager;
+
 @Component
 public class DefaultPrimaryDataStoreProviderManagerImpl implements PrimaryDataStoreProviderManager
{
     @Inject
@@ -45,6 +47,7 @@ public class DefaultPrimaryDataStoreProviderManagerImpl implements PrimaryDataSt
     @Inject
     PrimaryDataStoreDao dataStoreDao;
     Map<String, PrimaryDataStoreDriver> driverMaps;
+    @Inject StorageManager storageMgr;
 
     @PostConstruct
     public void config() {
@@ -77,7 +80,6 @@ public class DefaultPrimaryDataStoreProviderManagerImpl implements PrimaryDataSt
 
     @Override
     public boolean registerHostListener(String uuid, HypervisorHostListener listener) {
-        // TODO Auto-generated method stub
-        return false;
+        return storageMgr.registerHostListener(uuid, listener);
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/3bb713c5/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/provider/AncientPrimaryDataStoreProviderImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/provider/AncientPrimaryDataStoreProviderImpl.java
b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/provider/AncientPrimaryDataStoreProviderImpl.java
index 0ef1704..e7d6516 100644
--- a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/provider/AncientPrimaryDataStoreProviderImpl.java
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/provider/AncientPrimaryDataStoreProviderImpl.java
@@ -23,6 +23,7 @@ import java.util.Map;
 import javax.inject.Inject;
 
 import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreLifeCycle;
+import org.apache.cloudstack.engine.subsystem.api.storage.HypervisorHostListener;
 import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreDriver;
 import org.apache.cloudstack.storage.datastore.PrimaryDataStoreProviderManager;
 import org.apache.cloudstack.storage.datastore.driver.AncientPrimaryDataStoreDriverImpl;
@@ -59,6 +60,8 @@ public class AncientPrimaryDataStoreProviderImpl implements
         uuid = (String)params.get("uuid");
         id = (Long)params.get("id");
         storeMgr.registerDriver(uuid, this.driver);
+        HypervisorHostListener listener = ComponentContext.inject(DefaultHostListener.class);
+        storeMgr.registerHostListener(uuid, listener);
         return true;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/3bb713c5/plugins/hypervisors/ucs/src/com/cloud/ucs/database/UcsBladeDaoImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/ucs/src/com/cloud/ucs/database/UcsBladeDaoImpl.java b/plugins/hypervisors/ucs/src/com/cloud/ucs/database/UcsBladeDaoImpl.java
index 8f65f6a..570d1a3 100644
--- a/plugins/hypervisors/ucs/src/com/cloud/ucs/database/UcsBladeDaoImpl.java
+++ b/plugins/hypervisors/ucs/src/com/cloud/ucs/database/UcsBladeDaoImpl.java
@@ -17,11 +17,14 @@
 package com.cloud.ucs.database;
 
 import javax.ejb.Local;
+
+import org.springframework.stereotype.Component;
 
 import com.cloud.utils.db.DB;
 import com.cloud.utils.db.GenericDaoBase;
 @Local(value = { UcsBladeDao.class })
-@DB(txn = false)
+@DB(txn = false)
+@Component
 public class UcsBladeDaoImpl extends GenericDaoBase<UcsBladeVO, Long> implements UcsBladeDao
{
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/3bb713c5/plugins/hypervisors/ucs/src/com/cloud/ucs/database/UcsManagerDaoImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/ucs/src/com/cloud/ucs/database/UcsManagerDaoImpl.java b/plugins/hypervisors/ucs/src/com/cloud/ucs/database/UcsManagerDaoImpl.java
index bccc0fa..8a4c73e 100644
--- a/plugins/hypervisors/ucs/src/com/cloud/ucs/database/UcsManagerDaoImpl.java
+++ b/plugins/hypervisors/ucs/src/com/cloud/ucs/database/UcsManagerDaoImpl.java
@@ -17,12 +17,15 @@
 package com.cloud.ucs.database;
 
 import javax.ejb.Local;
+
+import org.springframework.stereotype.Component;
 
 import com.cloud.utils.db.DB;
 import com.cloud.utils.db.GenericDaoBase;
 
 @Local(value = { UcsManagerDao.class })
-@DB(txn = false)
+@DB(txn = false)
+@Component
 public class UcsManagerDaoImpl  extends GenericDaoBase<UcsManagerVO, Long> implements
UcsManagerDao {
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/3bb713c5/server/src/com/cloud/storage/StorageManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/StorageManagerImpl.java b/server/src/com/cloud/storage/StorageManagerImpl.java
index f2d92e5..9daf77d 100755
--- a/server/src/com/cloud/storage/StorageManagerImpl.java
+++ b/server/src/com/cloud/storage/StorageManagerImpl.java
@@ -772,8 +772,10 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager,
C
 
         if (storeProvider == null) {
             storeProvider = dataStoreProviderMgr.getDefaultPrimaryDataStoreProvider();
+            if (storeProvider == null) {
             throw new InvalidParameterValueException(
-                    "invalid storage provider uuid" + providerUuid);
+                    "can't find storage provider: " + providerUuid);
+            }
         }
 
         Long clusterId = cmd.getClusterId();
@@ -983,15 +985,6 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager,
C
         HypervisorHostListener listener = hostListeners.get(provider.getUuid());
         listener.hostConnect(hostId, pool.getId());
     }
-    
-  
-
-   
-
-  
-   
-
-    
 
     @Override
     public void createCapacityEntry(StoragePoolVO storagePool, short capacityType, long allocated)
{


Mime
View raw message