| 139 | == Node Status == |
| 140 | |
| 141 | There is a line-based RPC mechanism for query node status. A web interface for this is in active development. |
| 142 | |
| 143 | Commands are in the format: {{{command arg1 [arg2 ...]}}} |
| 144 | |
| 145 | Replies are in the format: {{{reply_type python-eval'able-string}}} |
| 146 | |
| 147 | As an example, here is a status request and reply (reply line-wrapped for readability): |
| 148 | |
| 149 | {{{ |
| 150 | status_request DeterTest/ratsnest-medium |
| 151 | status_reply {'hv:qemu:pnode-0000': {'cnode17': [None, None], 'cnode20': [None, |
| 152 | None], 'cnode8': [None, None]}, 'hv:qemu:pnode-0010': {'lnode6': [None, None], |
| 153 | 'lnode7': [None, None]}, 'hv:qemu:pnode-0005': {'lnode11': [None, None], |
| 154 | 'lnode12': [None, None], 'lnode13': [None, None]}, 'hv:qemu:pnode-0004': |
| 155 | {'lnode4': [None, None], 'lnode1': [None, None]}, 'hv:qemu:pnode-0007': |
| 156 | {'cnode16': [None, None], 'cnode15': [None, None], 'cnode19': [None, None]}, |
| 157 | 'hv:qemu:pnode-0008': {'cnode14': [None, None], 'cnode9': [None, None], |
| 158 | 'cnode18': [None, None]}} |
| 159 | }}} |
| 160 | |
| 161 | Example Python code for parsing the reply: |
| 162 | |
| 163 | {{{ |
| 164 | from ast import literal_eval |
| 165 | type, body = line.split(' ', 1) |
| 166 | message = literal_eval(body) |
| 167 | }}} |
| 168 | |
| 169 | === Reply format === |
| 170 | |
| 171 | Reply bodies take the form of a dict of dicts. The key of the first level of dicts is the hypervisor name. The key of the second level is node name. Each node name is a two-item array. The first element is boot status and the second element is start command exit code or qemu process exit code (if dead). Both of these will be None if the hv is unreachable. |
| 172 | |
| 173 | Possible boot status: |
| 174 | |
| 175 | * {{{running}}} - qemu has been started but the OS has not booted |
| 176 | * {{{booted}}} - the inner OS has fully booted |
| 177 | * {{{dead}}} - qemu process has died |
| 178 | |
| 179 | === Caveat === |
| 180 | |
| 181 | '''Note:''' Node status is only available for qemu virtual nodes. If your experiment is mixed mode, there is no status available for pnodes. The only way to query their status is from DETER. If they've booted and their exit code is 0, then they are running. |
| 182 | |