| | 53 | Core of is the '''mkinv''' with commands: '''add''', '''delete''', '''rename''' and '''swap''' |
| | 54 | {{{ |
| | 55 | /usr/share/omf-aggmgr-5.4/omf-aggmgr/ogs_inventory/scripts# ./mkinv --help |
| | 56 | Command that manages inventory |
| | 57 | Usage: |
| | 58 | mkinv CMD [options] file1 file2 file3 |
| | 59 | |
| | 60 | With: |
| | 61 | CMD mandatory command - one of: add,delete,rename,swap |
| | 62 | Options: |
| | 63 | -o, --orbit ORBIT fqdn to ip mapping |
| | 64 | -g, --geni GENI fqdn to ip mapping |
| | 65 | -b, --backup backup inventory database before applying changes |
| | 66 | -h, --help print this help message |
| | 67 | -d, --debug turns on debugging |
| | 68 | -u, --url URL inventory AM url |
| | 69 | Files: |
| | 70 | one or more yaml configuration files |
| | 71 | |
| | 72 | }}} |
| | 73 | |
| | 74 | ===== add - add a number of nodes ====== |
| | 75 | |
| | 76 | Configuration file example for adding 3 nodes: nodeA, nodeB and nodeC to domain '''outdoor.orbit-lab.org''': |
| | 77 | |
| | 78 | {{{ |
| | 79 | --- |
| | 80 | domains: |
| | 81 | grid.orbit-lab.org: |
| | 82 | nodes: |
| | 83 | nodeA.outdoor.orbit-lab.org: |
| | 84 | CM_type: 3 |
| | 85 | nodeB.outdoor.orbit-lab.org: |
| | 86 | CM_type: 3 |
| | 87 | nodeC.outdoor.orbit-lab.org: |
| | 88 | CM_type: 3 |
| | 89 | |
| | 90 | }}} |
| | 91 | |
| | 92 | With this configuration saved in file '''file1.yaml''' nodes are added with: |
| | 93 | |
| | 94 | {{{ |
| | 95 | ./mkinv add -o file1.yaml |
| | 96 | }}} |
| | 97 | |
| | 98 | ===== delete - delete a number of nodes ===== |
| | 99 | |
| | 100 | Configuration file example for deleting nodeA and nodeB from '''grid.orbit-lab.org''' domain: |
| | 101 | |
| | 102 | {{{ |
| | 103 | --- |
| | 104 | domains: |
| | 105 | grid.orbit-lab.org: |
| | 106 | nodes: |
| | 107 | nodeA.grid.orbit-lab.org: |
| | 108 | CM_type: X |
| | 109 | nodeB.grid.orbit-lab.org: |
| | 110 | CM_type: X |
| | 111 | }}} |
| | 112 | |
| | 113 | |
| | 114 | {{{ |
| | 115 | ./mkinv delete file.yaml |
| | 116 | }}} |
| | 117 | ===== rename - rename a number of nodes ===== |
| | 118 | ===== swap - swap a number of node pairs ===== |
| | 119 | |
| | 120 | 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. |
| | 121 | |
| | 122 | {{{ |
| | 123 | # NOTE: use only 'spaces' to indent ! |
| | 124 | # ('tab' indents are not supported by the ruby yaml parser used to read this file) |
| | 125 | # |
| | 126 | # |
| | 127 | --- |
| | 128 | # Global attributes |
| | 129 | attributes: |
| | 130 | CM_type: 3 |
| | 131 | CM_port: 1 |
| | 132 | INF_data_switch_port_id: 0 |
| | 133 | INF_control_switch_port_id: 0 |
| | 134 | INF_default_disk: /dev/sda |
| | 135 | INF_pxe_image: omf-5.4 |
| | 136 | INF_reset_timeout: 80 |
| | 137 | INF_max_frisbee_rate: 700000000 |
| | 138 | |
| | 139 | # Domain specific attributes |
| | 140 | domains: |
| | 141 | grid.orbit-lab.org: |
| | 142 | INF_data_switch_port_id: 1 |
| | 143 | |
| | 144 | # Mandatory attributes |
| | 145 | mandatory: |
| | 146 | - "CM_type" |
| | 147 | - "CM_ip" |
| | 148 | - "CM_port" |
| | 149 | - "CM_mac" |
| | 150 | - "INF_x_coor" |
| | 151 | - "INF_y_coor" |
| | 152 | - "INF_control_ip" |
| | 153 | - "INF_control_mac" |
| | 154 | - "INF_default_disk" |
| | 155 | - "INF_pxe_image" |
| | 156 | }}} |
| | 157 | |
| | 158 | ==== Updating Topologies ==== |
| | 159 | |
| | 160 | |
| | 161 | '''mktopo''' |