github.com/blixtra/nomad@v0.7.2-0.20171221000451-da9a1d7bb050/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. As of Nomad 0.7.1, alloc status also shows allocation
    15  modification time in addition to create time.
    16  
    17  ## Usage
    18  
    19  ```
    20  nomad alloc-status [options] <allocation>
    21  ```
    22  
    23  An allocation ID or prefix must be provided. If there is an exact match, the
    24  full details of the allocation will be displayed. Otherwise, a list of matching
    25  allocations and information will be displayed.
    26  
    27  ## General Options
    28  
    29  <%= partial "docs/commands/_general_options" %>
    30  
    31  ## Alloc Status Options
    32  
    33  * `-short`: Display short output. Shows only the most recent task event.
    34  * `-verbose`: Show full information.
    35  * `-json` : Output the allocation in its JSON format.
    36  * `-t` : Format and display the allocation using a Go template.
    37  
    38  ## Examples
    39  
    40  Short status of an alloc:
    41  
    42  ```
    43  $ nomad alloc-status --short 0af996ed
    44  ID                  = 0af996ed
    45  Eval ID             = be9bde98
    46  Name                = example.cache[0]
    47  Node ID             = 43c0b14e
    48  Job ID              = example
    49  Job Version         = 0
    50  Client Status       = running
    51  Client Description  = <none>
    52  Desired Status      = run
    53  Desired Description = <none>
    54  Created At          = 07/25/17 16:12:48 UTC
    55  Deployment ID       = 0c83a3b1
    56  Deployment Health   = healthy
    57  
    58  Tasks
    59  Name   State    Last Event  Time
    60  redis  running  Started     07/25/17 16:12:48 UTC
    61  web    running  Started     07/25/17 16:12:49 UTC
    62  ```
    63  
    64  Full status of an alloc, which shows one of the tasks dying and then being restarted:
    65  
    66  ```
    67  $ nomad alloc-status 0af996ed
    68  ID                  = 0af996ed
    69  Eval ID             = be9bde98
    70  Name                = example.cache[0]
    71  Node ID             = 43c0b14e
    72  Job ID              = example
    73  Job Version         = 0
    74  Client Status       = running
    75  Client Description  = <none>
    76  Desired Status      = run
    77  Desired Description = <none>
    78  Created             = 5m ago
    79  Modified            = 5m ago
    80  Deployment ID       = 0c83a3b1
    81  Deployment Health   = healthy
    82  
    83  Task "redis" is "running"
    84  Task Resources
    85  CPU        Memory           Disk     IOPS  Addresses
    86  1/500 MHz  6.3 MiB/256 MiB  300 MiB  0     db: 127.0.0.1:27908
    87  
    88  Task Events:
    89  Started At     = 07/25/17 16:12:48 UTC
    90  Finished At    = N/A
    91  Total Restarts = 0
    92  Last Restart   = N/A
    93  
    94  Recent Events:
    95  Time                   Type        Description
    96  07/25/17 16:12:48 UTC  Started     Task started by client
    97  07/25/17 16:12:48 UTC  Task Setup  Building Task Directory
    98  07/25/17 16:12:48 UTC  Received    Task received by client
    99  
   100  Task "web" is "running"
   101  Task Resources
   102  CPU        Memory           Disk     IOPS  Addresses
   103  1/500 MHz  6.3 MiB/256 MiB  300 MiB  0     db: 127.0.0.1:30572
   104  
   105  Task Events:
   106  Started At     = 07/25/17 16:12:49 UTC
   107  >>>>>>> alloc-status
   108  Finished At    = N/A
   109  Total Restarts = 0
   110  Last Restart   = N/A
   111  
   112  Recent Events:
   113  07/25/17 16:12:49 UTC  Started     Task started by client
   114  07/25/17 16:12:48 UTC  Task Setup  Building Task Directory
   115  07/25/17 16:12:48 UTC  Received    Task received by client
   116  ```
   117  
   118  Verbose status can also be accessed:
   119  
   120  ```
   121  $ nomad alloc-status -verbose 0af996ed
   122  ID                  = 0af996ed-aff4-8ddb-a566-e55ebf8969c9
   123  Eval ID             = be9bde98-0490-1beb-ced0-012d10ddf22e
   124  Name                = example.cache[0]
   125  Node ID             = 43c0b14e-7f96-e432-a7da-06605257ce0c
   126  Job ID              = example
   127  Job Version         = 0
   128  Client Status       = running
   129  Client Description  = <none>
   130  Desired Status      = run
   131  Desired Description = <none>
   132  Created             = 07/25/17 16:12:48 UTC
   133  Modified            = 07/25/17 16:12:48 UTC
   134  Deployment ID       = 0c83a3b1-8a7b-136b-0e11-8383dc6c9276
   135  Deployment Health   = healthy
   136  Evaluated Nodes     = 1
   137  Filtered Nodes      = 0
   138  Exhausted Nodes     = 0
   139  Allocation Time     = 38.474µs
   140  Failures            = 0
   141  
   142  Task "redis" is "running"
   143  Task Resources
   144  CPU        Memory           Disk     IOPS  Addresses
   145  1/500 MHz  6.3 MiB/256 MiB  300 MiB  0     db: 127.0.0.1:27908
   146  
   147  Task Events:
   148  Started At     = 07/25/17 16:12:48 UTC
   149  Finished At    = N/A
   150  Total Restarts = 0
   151  Last Restart   = N/A
   152  
   153  Recent Events:
   154  Time                   Type        Description
   155  07/25/17 16:12:48 UTC  Started     Task started by client
   156  07/25/17 16:12:48 UTC  Task Setup  Building Task Directory
   157  07/25/17 16:12:48 UTC  Received    Task received by client
   158  
   159  Task "web" is "running"
   160  Task Resources
   161  CPU        Memory           Disk     IOPS  Addresses
   162  1/500 MHz  6.3 MiB/256 MiB  300 MiB  0     db: 127.0.0.1:30572
   163  
   164  Task Events:
   165  Started At     = 07/25/17 16:12:49 UTC
   166  Finished At    = N/A
   167  Total Restarts = 0
   168  Last Restart   = N/A
   169  
   170  Recent Events:
   171  Time                   Type        Description
   172  07/25/17 16:12:49 UTC  Started     Task started by client
   173  07/25/17 16:12:48 UTC  Task Setup  Building Task Directory
   174  07/25/17 16:12:48 UTC  Received    Task received by client
   175  ```