[[TOC(Software/eAM/aI*, depth=3)]] === Domain management === ==== Adding new testbed ==== Currently, information about resources i.e. testbeds are kept into 2 databases, scheduler database (newScheduler) and inventory database (inventory54). To add new virtual domain we need to update both databases. There is a script addVirtualDomais.rb on internal2, /usr/share/omf-aggmgr-5.4/omf-aggmgr/ogs_loginCommon/w. Calling that script will add virtual domains into inventory database and prepare sql script to run from mysql to update scheduler database. {{{ ruby addVirtualDomais.rb listOfdomains.txt }}} listOfDomains.txt is file with following information domainName; ; Output file is machines.sql There is also file testbed_attributes.yaml to define necessary testbed information. ==== Make testbed inactive ==== To remove testbed from scheduler page just mark it inactive into both databases. For scheduler databases run UPDATE resources set status = 'u' where name=''; For inventory, change INF_status attribute to 0: {{{ wget -qO- 'http://new.orbit-lab.org:5054/inventory/attribute_modify?name=&attribute=INF_status&value=0 }}} ==== Updating testbed information ==== To change testbed name, make it active and change list of nodes do the following: ===== Scheduler database ===== * Make domain active in scheduler database i.e set status to 'a': {{{ Update newScheduler.resources set status='a' where name = ''; }}} * Change name and description: {{{ Update newScheduler.resources set name='', notes='node3-3 i node4-10' where name = ''; }}} or with one statement {{{ Update newScheduler.resources set status='a', name='', notes='node3-3 i node4-10' where name =''; }}} ===== Inventory database ===== * Change name It's not possible to change resource name using inventory service. This can be done directly into database. Anytime you can delete resource with and create new one. To change resource name run flowing script: {{{ UPDATE inventory54.resource SET name='' where name=''; }}} * Make it active, i.e set INF_status to 1 if domain should appear on status page {{{ wget -qO- 'http://new.orbit-lab.org:5054/attribute_modify?name=&attribute=INF_description&value= }}} ===== Define list of nodes ===== * Delete old list of nodes - currently, there is no possibility to do it trough service, it has to be done into database directly {{{ DELETE FROM inventory54.relations WHERE subject_id=(SELECT id FROM inventory54.resources where name=''); }}} Pay attention, is used because name is already changed. If you this before changing the name, than use . * Add nodes - do the flowing for each node that belongs to resource i.e. testbed {{{ wget -qO- 'http://new.orbit-lab.org:5054/relation_add?parent=&child= }}}