mirror of https://github.com/apache/cloudstack.git
fix adding nfs primary storage and build and load
This commit is contained in:
parent
8a523476ec
commit
3bb713c5ce
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue