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

[ISSUE] Windows nomad agent won't run containers due to MemorySwappiness error #3181

Closed
billykwooten opened this issue Sep 10, 2017 · 3 comments

Comments

@billykwooten
Copy link

billykwooten commented Sep 10, 2017

Nomad version

Nomad v0.6.2

Operating system and Environment details

Windows Server 2016 (running on ESXi)
Consul 0.9.2

Client:
 Version:      17.06.1-ee-2
 API version:  1.30
 Go version:   go1.8.3
 Git commit:   8e43158
 Built:        Wed Aug 23 21:16:53 2017
 OS/Arch:      windows/amd64

Server:
 Version:      17.06.1-ee-2
 API version:  1.30 (minimum version 1.24)
 Go version:   go1.8.3
 Git commit:   8e43158
 Built:        Wed Aug 23 21:25:53 2017
 OS/Arch:      windows/amd64
 Experimental: false

Issue

I get the following error when running the below nomad job on a Windows-based nomad agent:

failed to start task "frontend" for alloc "bd161efe-cd35-ed79-72c6-19ce553123f0": Failed to create container: API error (500): {"message":"invalid option: Windows does not support MemorySwappiness"}

Reproduction steps

Run the following job against windows server 2016 running docker 17.06.1-ee-2:

# This declares a job named "docs". There can be exactly one
# job declaration per job file.
job "test-job" {
  # Specify this job should run in the region named "us". Regions
  # are defined by the Nomad servers' configuration.
  region = "US"

  # Spread the tasks in this job between us-west-1 and us-east-1.
  datacenters = ["testdc"]

  # Run this job as a "service" type. Each job type has different
  # properties. See the documentation below for more examples.
  type = "service"

  # Specify this job to have rolling updates, two-at-a-time, with
  # 30 second intervals.
  update {
    stagger      = "30s"
    max_parallel = 2
  }

  # Jobs must run on a windows kernel
  constraint {
    attribute = "${attr.kernel.name}"
    value     = "windows"
  }

  # A group defines a series of tasks that should be co-located
  # on the same client (host). All tasks within a group will be
  # placed on the same host.
  group "webservice" {
    # Specify the number of these tasks we want.
    count = 2

    # Create an individual task (unit of work). This particular
    # task utilizes a Docker container to front a web application.
    task "frontend" {
      # Specify the driver to be "docker". Nomad supports
      # multiple drivers.
      driver = "docker"

      # Configuration is specific to each driver.
      config {
        image = "hello-world:nanoserver"
        network_mode = "bridge"
        port_map = {
          http = 80
        }
      }

      # The service block tells Nomad how to register this service
      # with Consul for service discovery and monitoring.
      service {
        # This tells Consul to monitor the service on the port
        # labled "http". Since Nomad allocates high dynamic port
        # numbers, we use labels to refer to them.
        name = "test-com"
        tags = ["traefik.tags=traefik"]
       port = "http"
        check {
          name     = "alive-http"
          port     = "http"
          type     = "tcp"
          interval = "15s"
          timeout  = "3s"
        }
      }

      # It is possible to set environment variables which will be
      # available to the job when it runs.
      env {
      }

      # Specify the maximum resources required to run the job,
      # include CPU, memory, and bandwidth.
      resources {
        cpu    = 120 # MHz
        memory = 128 # MB

        network {
          mbits = 100

          # This requests a dynamic port named "http". This will
          # be something like "46283", but we refer to it via the
          # label "http".
          port "http" {}

          # This requests a static port on 443 on the host. This
          # will restrict this task to running once per host, since
          # there is only one port 443 on each host.
        }
      }
    }
  }
}
@billykwooten
Copy link
Author

The above fixed it @dadgar, I just built a new binary with 7148b65 and it works as expected now.

@dadgar
Copy link
Contributor

dadgar commented Sep 11, 2017

Thanks for verifying @CRYSON

dadgar added a commit that referenced this issue Sep 11, 2017
@github-actions
Copy link

github-actions bot commented Dec 8, 2022

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 8, 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