[[TOC(Software/eAM*, depth=2, heading=Aggregate Managers)]] [[TOC(Software/eAM/aI*, depth=4, heading=Inventory AM)]] === 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 Scheduler Database ==== To change testbed name, make it active and change list of nodes do the following: * 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 =''; }}} ==== Updating Inventory Database ==== Core of is the '''mkinv''' with commands: '''add''', '''delete''', '''rename''' and '''swap''' {{{ /usr/share/omf-aggmgr-5.4/omf-aggmgr/ogs_inventory/scripts# ./mkinv --help Command that manages inventory Usage: mkinv CMD [options] file1 file2 file3 With: CMD mandatory command - one of: add,delete,rename,swap Options: -o, --orbit ORBIT fqdn to ip mapping -g, --geni GENI fqdn to ip mapping -b, --backup backup inventory database before applying changes -h, --help print this help message -d, --debug turns on debugging -u, --url URL inventory AM url Files: one or more yaml configuration files }}} ===== add - add a number of nodes ====== Configuration file example for adding 3 nodes: nodeA, nodeB and nodeC to domain '''outdoor.orbit-lab.org''': {{{ --- domains: grid.orbit-lab.org: nodes: nodeA.outdoor.orbit-lab.org: CM_type: 3 nodeB.outdoor.orbit-lab.org: CM_type: 3 nodeC.outdoor.orbit-lab.org: CM_type: 3 }}} With this configuration saved in file '''file1.yaml''' nodes are added with: {{{ ./mkinv add -o file1.yaml }}} ===== delete - delete a number of nodes ===== Configuration file example for deleting nodeA and nodeB from '''grid.orbit-lab.org''' domain: {{{ --- domains: grid.orbit-lab.org: nodes: nodeA.grid.orbit-lab.org: CM_type: X nodeB.grid.orbit-lab.org: CM_type: X }}} {{{ ./mkinv delete file.yaml }}} ===== rename - rename a number of nodes ===== ===== swap - swap a number of node pairs ===== Default attributes are configured in '''inv-defatt.yml''' file; three sections: global attributes are in '''attributes''' section, domain specific overrides are in '''domains''' section; '''mandatory''' section lists mandatory attributes that should be present when adding the resource/node. {{{ # NOTE: use only 'spaces' to indent ! # ('tab' indents are not supported by the ruby yaml parser used to read this file) # # --- # Global attributes attributes: CM_type: 3 CM_port: 1 INF_data_switch_port_id: 0 INF_control_switch_port_id: 0 INF_default_disk: /dev/sda INF_pxe_image: omf-5.4 INF_reset_timeout: 80 INF_max_frisbee_rate: 700000000 # Domain specific attributes domains: grid.orbit-lab.org: INF_data_switch_port_id: 1 # Mandatory attributes mandatory: - "CM_type" - "CM_ip" - "CM_port" - "CM_mac" - "INF_x_coor" - "INF_y_coor" - "INF_control_ip" - "INF_control_mac" - "INF_default_disk" - "INF_pxe_image" }}} ==== Updating Topologies ==== '''mktopo'''