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

CSI: 'alloc status -verbose' queries volume name and not volume source #9297

Closed
tgross opened this issue Nov 9, 2020 · 1 comment · Fixed by #9354
Closed

CSI: 'alloc status -verbose' queries volume name and not volume source #9297

tgross opened this issue Nov 9, 2020 · 1 comment · Fixed by #9354

Comments

@tgross
Copy link
Member

tgross commented Nov 9, 2020

The nomad alloc status -verbose :id command queries the CSI volumes associated with the allocation. But the query sent to the server uses the name of the volume from group.volume and not the volume source (which is the volume ID). This result in an error message:

Error retrieving volume info for "test": Unexpected response code: 404 (volume not found)

This is similar to #9249 which suggests that maybe the problem is in the API and not the UI. (Or that we copied the same behavior.)

Example jobspec:

# a job that mounts an EBS volume and writes its job ID as a file
job "use-ebs-volume" {
  datacenters = ["dc1", "dc2"]

  constraint {
    attribute = "${attr.kernel.name}"
    value     = "linux"
  }

  group "group" {
    volume "test" {
      type   = "csi"
      source = "ebs-vol0"
    }

    task "task" {
      driver = "docker"

      config {
        image   = "busybox:1"
        command = "/bin/sh"
        args    = ["-c", "echo 'ok' > ${NOMAD_TASK_DIR}/test/${NOMAD_ALLOC_ID}; sleep 3600"]
      }

      volume_mount {
        volume      = "test"
        destination = "${NOMAD_TASK_DIR}/test"
        read_only   = false
      }

      resources {
        cpu    = 500
        memory = 128
      }
    }
  }
}

Volume spec:

type = "csi"
id = "ebs-vol0"
name = "ebs-vol0"
external_id = "vol-xxxxxxx"
access_mode = "single-node-writer"
attachment_mode = "file-system"
plugin_id = "aws-ebs0"

Results:

$ nomad alloc status -verbose 83b
ID                  = 83b3638b-9d48-8325-3242-bb57ecf9cbd3
Eval ID             = 5e68473b-d641-86d7-5a3c-76270d07a98c
Name                = use-ebs-volume.group[0]
Node ID             = 838c671c-4fc2-8101-7fa6-912af5eb41df
Node Name           = ip-172-31-13-5
Job ID              = use-ebs-volume
Job Version         = 0
Client Status       = running
Client Description  = Tasks are running
Desired Status      = run
Desired Description = <none>
Created             = 2020-11-09T14:35:18-05:00
Modified            = 2020-11-09T14:35:33-05:00
Deployment ID       = c8d0cdf3-0c3f-c867-8eb8-08467e92dc13
Deployment Health   = healthy
Evaluated Nodes     = 2
Filtered Nodes      = 0
Exhausted Nodes     = 0
Allocation Time     = 207.268µs
Failures            = 0

Task "task" is "running"
Task Resources
CPU        Memory          Disk     Addresses
0/500 MHz  76 KiB/128 MiB  300 MiB

Error retrieving volume info for "test": Unexpected response code: 404 (volume not found)
Task Events:
Started At     = 2020-11-09T19:35:23Z
Finished At    = N/A
Total Restarts = 0
Last Restart   = N/A

Recent Events:
Time                       Type        Description
2020-11-09T14:35:23-05:00  Started     Task started by client
2020-11-09T14:35:22-05:00  Driver      Downloading image
2020-11-09T14:35:21-05:00  Task Setup  Building Task Directory
2020-11-09T14:35:18-05:00  Received    Task received by client

Placement Metrics
  * No nodes are available in datacenter "dc2"
Node                                  binpack  job-anti-affinity  node-affinity  node-reschedule-penalty  final score
102faa3a-6a23-6a0c-6ec9-9d95711fef00  0.453    0                  0              0                        0.453
838c671c-4fc2-8101-7fa6-912af5eb41df  0.453    0                  0              0                        0.453
@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 Oct 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant