Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DiskMB property of the HTTP API Job Spec is not having any effect on disk requirement #2401

Closed
ncodes opened this issue Mar 5, 2017 · 2 comments

Comments

@ncodes
Copy link

ncodes commented Mar 5, 2017

Nomad version

Nomad v0.5.4

Operating system and Environment details

Ubuntu 16.04.1 LTS (GNU/Linux 4.4.0-64-generic x86_64)

Issue

I am currently creating jobs through the HTTP API and I noticed that the disk resource is always set to 0 in the Task Resource section of nomad alloc-status .... Running nomad inspect ... on the job shows EphemeralDisk.SizeMB of task group still set to the default 300 even when DiskMB of the job spec is set to a different value. I looked at the source and found TaskGroups.EphemeralDisk , applied it, ran nomad alloc-status ... and got the expected value. But the output of nomad alloc-status ... still showed Disk to be 0.

Reproduction

curl -X POST http://localhost:4646/v1/jobs -d '{ ... }'

Nomad Client logs (if appropriate)

ID                  = 0ed83e2d
Eval ID             = be1e1274
Name                = 1834baa0-d9c1-4a4a-b63c-57ae59941778.1834baa0-d9c1-4a4a-b63c-57ae59941778[0]
Node ID             = 4cd92524
Job ID              = 1834baa0-d9c1-4a4a-b63c-57ae59941778
Client Status       = running
Client Description  = <none>
Desired Status      = run
Desired Description = <none>
Created At          = 03/05/17 17:24:48 UTC

Task "task-1834baa0-d9c1-4a4a-b63c-57ae59941778" is "running"
Task Resources
CPU        Memory          Disk  IOPS  Addresses
4/100 MHz  58 MiB/512 MiB  0 B   0     connector: 10.132.0.2:33769

Recent Events:
Time                   Type                   Description
03/05/17 17:24:54 UTC  Started                Task started by client
03/05/17 17:24:48 UTC  Driver                 Downloading image ...
03/05/17 17:24:48 UTC  Downloading Artifacts  Client is downloading artifacts
03/05/17 17:24:48 UTC  Received               Task received by client`

Job file (if appropriate)

This is the initial job spec without the EphemeralDisk task group property.

  "Job": {
    "Region": "global",
    "ID": "task",
    "Name": "task",
    "Type": "service",
    "Priority": 50,
    "AllAtOnce": false,
    "Datacenters": [
      "dc1"
    ],
    "Constraints": [
      {
        "LTarget": "${attr.kernel.name}",
        "RTarget": "linux",
        "Operand": "="
      }
    ],
    "TaskGroups": [
      {
        "Name": "task",
        "Count": 1,
        "Constraints": null,
        "Tasks": [
          {
            "Name": "task-1",
            "Driver": "docker",
            "Config": {
              "image": "golang:1.7.5-wheezy",
              "force_pull": true,
              "command": "bash",
              "network_mode": "host",
              "args": [""],
              "privileged": true,
              "port_map": []
            },
            "Env": {
            },
            "Services": [],
            "Meta": {
            },
            "LogConfig": {
              "MaxFiles": 10,
              "MaxFileSizeMB": 10
            },
            "Templates": [],
            "Artifacts": [],
            "Resources": {
              "CPU": 500,
              "MemoryMB": 512,
              "IOPS": 0,
              "Networks": [
                {
                  "MBits": 200,
                  "DynamicPorts":[
                    { "Label":"connector"}
                  ]
                }
              ]
            },
            "DispatchPayload": {}
          }
        ],
        "Resources": {
          "CPU": 500,
          "MemoryMB": 512,
          "DiskMB": 430,
          "IOPS": 0,
          "Networks": []
        },
        "RestartPolicy": {
          "Interval": 300000000000,
          "Attempts": 10,
          "Delay": 25000000000,
          "Mode": "delay"
        },
        "Meta": {}
      }
    ],
    "Update": {
      "Stagger": 10000000000,
      "MaxParallel": 1
    }
  }
}

This one includes the EphemeralDisk property

  "Job": {
    "Region": "global",
    "ID": "task",
    "Name": "task",
    "Type": "service",
    "Priority": 50,
    "AllAtOnce": false,
    "Datacenters": [
      "dc1"
    ],
    "Constraints": [
      {
        "LTarget": "${attr.kernel.name}",
        "RTarget": "linux",
        "Operand": "="
      }
    ],
    "TaskGroups": [
      {
        "Name": "task",
        "Count": 1,
        "Constraints": null,
        "Tasks": [
          {
            "Name": "task-1",
            "Driver": "docker",
            "Config": {
              "image": "golang:1.7.5-wheezy",
              "force_pull": true,
              "command": "bash",
              "network_mode": "host",
              "args": [""],
              "privileged": true,
              "port_map": []
            },
            "Env": {
            },
            "Services": [],
            "Meta": {
            },
            "LogConfig": {
              "MaxFiles": 10,
              "MaxFileSizeMB": 10
            },
            "Templates": [],
            "Artifacts": [],
            "Resources": {
              "CPU": 500,
              "MemoryMB": 512,
              "IOPS": 0,
              "Networks": [
                {
                  "MBits": 200,
                  "DynamicPorts":[
                    { "Label":"connector"}
                  ]
                }
              ]
            },
            "DispatchPayload": {}
          }
        ],
        "Resources": {
          "CPU": 500,
          "MemoryMB": 512,
          "DiskMB": 430,
          "IOPS": 0,
          "Networks": []
        },
       "EphemeralDisk": {
          "Sticky": false,
          "Migrate": false,
          "SizeMB": 200
        },
        "RestartPolicy": {
          "Interval": 300000000000,
          "Attempts": 10,
          "Delay": 25000000000,
          "Mode": "delay"
        },
        "Meta": {}
      }
    ],
    "Update": {
      "Stagger": 10000000000,
      "MaxParallel": 1
    }
  }
}
@ncodes ncodes changed the title DiskMB does not set job disk requirement DiskMB does not set disk requirement Mar 5, 2017
@ncodes ncodes changed the title DiskMB does not set disk requirement DiskMB property of HTTP API JSON Job Spec does not set disk requirement Mar 5, 2017
@ncodes ncodes changed the title DiskMB property of HTTP API JSON Job Spec does not set disk requirement DiskMB property of HTTP API JSON Job Spec does is not having any effect on disk requirement Mar 5, 2017
@ncodes ncodes changed the title DiskMB property of HTTP API JSON Job Spec does is not having any effect on disk requirement DiskMB property of HTTP API JSON Job Spec is not having any effect on disk requirement Mar 5, 2017
@ncodes ncodes changed the title DiskMB property of HTTP API JSON Job Spec is not having any effect on disk requirement DiskMB property of HTTP API Job Spec is not having any effect on disk requirement Mar 5, 2017
@ncodes ncodes changed the title DiskMB property of HTTP API Job Spec is not having any effect on disk requirement DiskMB property of the HTTP API Job Spec is not having any effect on disk requirement Mar 5, 2017
dadgar added a commit that referenced this issue Mar 6, 2017
@dadgar
Copy link
Contributor

dadgar commented Mar 6, 2017

@ncodes Thanks for catching that! Will be fixed in 0.5.5

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants