github.com/diptanu/nomad@v0.5.7-0.20170516172507-d72e86cbe3d9/website/source/docs/commands/alloc-status.html.md.erb (about)

     1  ---
     2  layout: "docs"
     3  page_title: "Commands: alloc-status"
     4  sidebar_current: "docs-commands-alloc-status"
     5  description: >
     6    Display status and metadata about existing allocations and their tasks.
     7  ---
     8  
     9  # Command: alloc-status
    10  
    11  The `alloc-status` command displays status information and metadata about an
    12  existing allocation and its tasks. It can be useful while debugging to reveal
    13  the underlying reasons for scheduling decisions or failures, as well as the
    14  current state of its tasks.
    15  
    16  ## Usage
    17  
    18  ```
    19  nomad alloc-status [options] <allocation>
    20  ```
    21  
    22  An allocation ID or prefix must be provided. If there is an exact match, the
    23  full details of the allocation will be displayed. Otherwise, a list of matching
    24  allocations and information will be displayed.
    25  
    26  ## General Options
    27  
    28  <%= partial "docs/commands/_general_options" %>
    29  
    30  ## Alloc Status Options
    31  
    32  * `-short`: Display short output. Shows only the most recent task event.
    33  * `-verbose`: Show full information.
    34  * `-json` : Output the allocation in its JSON format.
    35  * `-t` : Format and display allocation using a Go template.
    36  
    37  ## Examples
    38  
    39  Short status of an alloc:
    40  
    41  ```
    42  $ nomad alloc-status --short 13901f26
    43  ID            = 13901f26
    44  Eval ID       = c3c9a1db
    45  Name          = example.cache[0]
    46  Node ID       = 1f029d38
    47  Job ID        = example
    48  Client Status = running
    49  Created At    = 29/03/16 03:04:53 UTC
    50  
    51  ==> Tasks
    52  Name   State    Last Event  Time
    53  redis  running  Started     29/03/16 03:04:53 UTC
    54  web    running  Started     29/03/16 03:04:53 UTC
    55  ```
    56  
    57  Full status of an alloc, which shows one of the tasks dying and then being restarted:
    58  
    59  ```
    60  $ nomad alloc-status a7365fe4
    61  ID            = a7365fe4
    62  Eval ID       = c3c9a1db
    63  Name          = example.cache[0]
    64  Node ID       = 1f029d38
    65  Job ID        = example
    66  Client Status = running
    67  Created At    = 29/03/16 03:04:53 UTC
    68  
    69  ==> Task Resources
    70  Task: "redis"
    71  CPU  Memory MB  Disk MB  IOPS  Addresses
    72  500  256        300      0     db: 127.0.0.1:46321
    73  
    74  Task: "web"
    75  CPU  Memory MB  Disk MB  IOPS  Addresses
    76  500  256        300      0     db: 127.0.0.1:38537
    77  
    78  ==> Task "redis" is "running"
    79  Recent Events:
    80  Time                   Type      Description
    81  29/03/16 03:04:53 UTC  Started   Task started by client
    82  29/03/16 03:04:51 UTC  Received  Task received by client
    83  
    84  ==> Task "web" is "pending"
    85  Recent Events:
    86  Time                   Type        Description
    87  29/03/16 03:07:18 UTC  Restarting  Task restarting in 18.580059474s
    88  29/03/16 03:07:18 UTC  Terminated  Exit Code: 137, Exit Message: "Docker container exited with non-zero exit code: 137"
    89  29/03/16 03:04:53 UTC  Started     Task started by client
    90  29/03/16 03:04:51 UTC  Received    Task received by client
    91  ```
    92  
    93  Verbose status can also be accessed:
    94  
    95  ```
    96  $ nomad alloc-status --verbose a7365fe4
    97  ID              = a7365fe4-cb28-a6e9-f3d4-f99e49c89776
    98  Eval ID         = c3c9a1db-dbeb-8afa-0a83-4f1b8b5a03f5
    99  Name            = example.cache[0]
   100  Node ID         = 1f029d38-8d4b-a552-261f-e457b60f9b4b
   101  Job ID          = example
   102  Client Status   = running
   103  Created At      = 29/03/16 03:04:53 UTC
   104  Evaluated Nodes = 1
   105  Filtered Nodes  = 0
   106  Exhausted Nodes = 0
   107  Allocation Time = 1.085001ms
   108  Failures        = 0
   109  
   110  ==> Task Resources
   111  Task: "web"
   112  CPU  Memory MB  Disk MB  IOPS  Addresses
   113  500  256        300      0     db: 127.0.0.1:38537
   114  
   115  Task: "redis"
   116  CPU  Memory MB  Disk MB  IOPS  Addresses
   117  500  256        300      0     db: 127.0.0.1:46321
   118  
   119  ==> Task "redis" is "running"
   120  Recent Events:
   121  Time                   Type      Description
   122  29/03/16 03:04:53 UTC  Started   Task started by client
   123  29/03/16 03:04:51 UTC  Received  Task received by client
   124  
   125  ==> Task "web" is "running"
   126  Recent Events:
   127  Time                   Type        Description
   128  29/03/16 03:07:38 UTC  Started     Task started by client
   129  29/03/16 03:07:18 UTC  Restarting  Task restarting in 18.580059474s
   130  29/03/16 03:07:18 UTC  Terminated  Exit Code: 137, Exit Message: "Docker container exited with non-zero exit code: 137"
   131  29/03/16 03:04:53 UTC  Started     Task started by client
   132  29/03/16 03:04:51 UTC  Received    Task received by client
   133  
   134  ==> Status
   135  Allocation "13901f26-cb28-a6e9-f3d4-f99e49c89776" status "running" (0/1 nodes filtered)
   136    * Score "1f029d38-8d4b-a552-261f-e457b60f9b4b.binpack" = 10.334026
   137  ```