mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-25 06:03:36 +03:00
Feature #3471: Bootstrap adds the cluster ALL to the default VDC
This commit is contained in:
parent
ffcc50bac4
commit
09a7409303
@ -53,8 +53,9 @@ EOT
|
|||||||
|
|
||||||
@db.run "CREATE TABLE vdc_pool (oid INTEGER PRIMARY KEY, name VARCHAR(128), body MEDIUMTEXT, uid INTEGER, gid INTEGER, owner_u INTEGER, group_u INTEGER, other_u INTEGER, UNIQUE(name));"
|
@db.run "CREATE TABLE vdc_pool (oid INTEGER PRIMARY KEY, name VARCHAR(128), body MEDIUMTEXT, uid INTEGER, gid INTEGER, owner_u INTEGER, group_u INTEGER, other_u INTEGER, UNIQUE(name));"
|
||||||
|
|
||||||
# TODO: Before the final release, check if the default vdc in the core
|
# The defat vdc in a bootstrap contains the group users and cluster ALL.
|
||||||
# is also empty
|
# But this may have changed, so the default VDC is left empty and
|
||||||
|
# a new VDC 'users' is be created with the current resource providers
|
||||||
@db.run "INSERT INTO vdc_pool VALUES(0,'default','<VDC><ID>0</ID><NAME>default</NAME><GROUPS></GROUPS><CLUSTERS></CLUSTERS><HOSTS></HOSTS><DATASTORES></DATASTORES><VNETS></VNETS><TEMPLATE></TEMPLATE></VDC>',0,0,1,0,0);"
|
@db.run "INSERT INTO vdc_pool VALUES(0,'default','<VDC><ID>0</ID><NAME>default</NAME><GROUPS></GROUPS><CLUSTERS></CLUSTERS><HOSTS></HOSTS><DATASTORES></DATASTORES><VNETS></VNETS><TEMPLATE></TEMPLATE></VDC>',0,0,1,0,0);"
|
||||||
|
|
||||||
vdc_last_oid = 99
|
vdc_last_oid = 99
|
||||||
|
@ -58,6 +58,15 @@ VdcPool::VdcPool(SqlDB * db, bool is_federation_slave)
|
|||||||
goto error_bootstrap;
|
goto error_bootstrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Vdc* vdc = get(rc, true);
|
||||||
|
|
||||||
|
vdc->add_group(GroupPool::USERS_ID, error_str);
|
||||||
|
vdc->add_cluster(Nebula::instance().get_zone_id(), Vdc::ALL_RESOURCES, error_str);
|
||||||
|
|
||||||
|
update(vdc);
|
||||||
|
|
||||||
|
vdc->unlock();
|
||||||
|
|
||||||
// The first 100 Vdc IDs are reserved for system Vdcs.
|
// The first 100 Vdc IDs are reserved for system Vdcs.
|
||||||
// Regular ones start from ID 100
|
// Regular ones start from ID 100
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user