mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-11 05:17:41 +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));"
|
||||
|
||||
# TODO: Before the final release, check if the default vdc in the core
|
||||
# is also empty
|
||||
# The defat vdc in a bootstrap contains the group users and cluster ALL.
|
||||
# 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);"
|
||||
|
||||
vdc_last_oid = 99
|
||||
|
@ -58,6 +58,15 @@ VdcPool::VdcPool(SqlDB * db, bool is_federation_slave)
|
||||
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.
|
||||
// Regular ones start from ID 100
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user