mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-22 18:50:08 +03:00
feature #2731: Datastores with ID < 100 can now be removed or added to a cluster
This commit is contained in:
parent
4d2a2528d6
commit
12a9b8db46
@ -118,18 +118,7 @@ string& Cluster::get_ds_location(string &ds_location)
|
||||
|
||||
int Cluster::add_datastore(int id, Datastore::DatastoreType ds_type, string& error_msg)
|
||||
{
|
||||
if ( id == DatastorePool::SYSTEM_DS_ID )
|
||||
{
|
||||
ostringstream oss;
|
||||
oss << "Datastore "<< DatastorePool::SYSTEM_DS_ID
|
||||
<< " cannot be added to any cluster.";
|
||||
|
||||
error_msg = oss.str();
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
int rc = datastores.add_collection_id(id);
|
||||
int rc = datastores.add_collection_id(id);
|
||||
|
||||
if ( rc < 0 )
|
||||
{
|
||||
|
@ -241,14 +241,6 @@ int DatastorePool::drop(PoolObjectSQL * objsql, string& error_msg)
|
||||
|
||||
int rc;
|
||||
|
||||
// Return error if the datastore is a default one.
|
||||
if( datastore->get_oid() < 100 )
|
||||
{
|
||||
error_msg = "System Datastores (ID < 100) cannot be deleted.";
|
||||
NebulaLog::log("DATASTORE", Log::ERROR, error_msg);
|
||||
return -2;
|
||||
}
|
||||
|
||||
if( datastore->get_collection_size() > 0 )
|
||||
{
|
||||
ostringstream oss;
|
||||
|
Loading…
x
Reference in New Issue
Block a user