juicedata / juicefs-csi-driver

JuiceFS CSI Driver
https://github.com/juicedata/juicefs
Apache License 2.0
219 stars 83 forks source link

[BUG] Nomad - Capacity 0 is too small #752

Closed azoller1 closed 1 year ago

azoller1 commented 1 year ago

What happened: Hello, I tried to use the latest csi driver version with nomad, but it seems to think the capacity is set to 0 GiB when it should be unlimited if the capacity is not set correct? I even tried to manually set the capacity and it still thinks it is 0. This does not allow the volume to be created. Here are the logs with a specified capacity:

 "Name": "juicefs-couchdb",
  "UUID": "8161f68e-6913-4edf-b707-6a57c0840c5a",
  "Storage": "minio",
  "Bucket": "https://buckets.com/couchdb-obsidian",
  "AccessKey": "alexz",
  "SecretKey": "removed",
  "BlockSize": 4096,
  "Compression": "none",
  "Capacity": 10737418240,
  "EncryptAlgo": "aes256gcm-rsa",
  "KeyEncrypted": true,
  "TrashDays": 1,
  "MetaVersion": 1,
  "MinClientVersion": "1.1.0-A",
  "DirStats": true
} [format.go:508]
E0915 17:27:09.904190       7 node.go:169] set quota: capacity 0 is too small, at least 1GiB for quota
E0915 17:27:09.904199       7 driver.go:100] GRPC error: rpc error: code = Internal desc = set quota: capacity 0 is too small, at least 1GiB for quota
I0915 17:27:10.452640       7 node.go:189] NodeUnpublishVolume: volume_id is juicefs-couchdb

I use the exact same configuration with the csi driver version 0.19.0 and everything works. Guess it is not a big deal since version 0.19.0 works OK for me!

My volume.hcl file I use to create the nomad (csi) volume is here:

type = "csi"
id   = "juicefs-couchdb"
name = "juicefs-couchdb"

capability {
  access_mode     = "multi-node-multi-writer"
  attachment_mode = "file-system"
}
plugin_id = "juicefs0"

secrets {
  name       = "juicefs-couchdb"
  metaurl    = "redis://192.168.1.3:6380/5"
  bucket     = "https://buckets.com/couchdb-obsidian"
  storage    = "minio"
  access-key = "alexz"
  secret-key = "hidden"
  capacity   = "10"
}

I also try to edit the metadata DB with the juicefs config command and still does not work.

Environment: CSI driver version tested: v0.22.1 Object storage: Minio S3 Metadata engine: Redis v6.2, on-premise Nomad version: 1.6.2

zwwhdls commented 1 year ago

Hi @azoller1 , can you provide the log of jfs-node job?

Hexilee commented 1 year ago

Hi @azoller1, could you try to set capacity by capacity_max and capacity_min, refer to https://developer.hashicorp.com/nomad/docs/other-specifications/volume ?

type = "csi"
id   = "juicefs-couchdb"
name = "juicefs-couchdb"

capability {
  access_mode     = "multi-node-multi-writer"
  attachment_mode = "file-system"
}
plugin_id = "juicefs0"
capacity_max = "200G"
capacity_min = "200G"

secrets {
  name       = "juicefs-couchdb"
  metaurl    = "redis://192.168.1.3:6380/5"
  bucket     = "https://buckets.com/couchdb-obsidian"
  storage    = "minio"
  access-key = "alexz"
  secret-key = "hidden"
}
azoller1 commented 1 year ago

Hello,

Setting the capacity_min/max as you suggested appears to work! I guess I did not dig far enough in the nomad docs.. Thanks for your help!

Also, thanks for having support for nomad. One of the few CSI drivers with good support! @Hexilee @zwwhdls