Freenas-api-iscsi driver formatting disk every time instead of just initially
See original GitHub issueHi! I am newish to Nomad and the Democratic-csi plugin; I had gotten local host folders to work and thought I should switch to network storage since I have TrueNAS Scale.
Democratic-csi seems to be formatting iscsi disks every time they are mounted in a container, which erases all the data.
I am using Nomad 1.3.1 with TrueNAS Scale 22.02.2 and the freenas-api-iscsi driver.
I initially created the container and added a text file to the mounted iscsi folder. I then stopped the container, waited for the node processes to finish, and then started it again. When I started it for the second time I noticed that the democratic node had this line in the log file:
executing filesystem command: mkfs.ext4 /dev/sde
The mounted iscsi folder did not contain the text file from the first container. Is there a check for existing file systems that is failing? Otherwise I am not sure why the democratic node would format the iscsi disk every time.
See the complete logs and configurations below:
storage_wikijs-db.hcl
id = "wikijs-db-data"
name = "wikijs-db-data"
type = "csi"
plugin_id = "org.democratic-csi.iscsi"
capacity_max = "5Gib"
capacity_min = "2Gib"
//Suggested to have only one capability
// capability {
// access_mode = "single-node-reader-only"
// attachment_mode = "block-device"
// }
capability {
access_mode = "single-node-writer"
attachment_mode = "file-system"
}
mount_options {
fs_type = "ext4"
mount_flags = ["noatime"]
}
wikijs.job
job "wikijs" {
datacenters = ["dc1"]
type = "service"
meta {
version = "23"
}
group "Wikijs" {
update {
max_parallel = 1
}
# Prestart task
task "set-permissions" {
driver = "docker"
volume_mount {
volume = "wikijs-data"
destination = "/wiki/data"
read_only = false
}
config {
image = "busybox:1.28"
command = "sh"
args = ["-c", "echo -n 'Setting permissions\n'; chown 1000:1000 -R /wiki/data"]
network_mode = "bridge"
}
resources {
cpu = 200
memory = 128
}
lifecycle {
hook = "prestart"
sidecar = false
}
}
# End of Prestart Task
volume "wikijs-data" {
type = "csi"
read_only = false
source = "wikijs-data"
attachment_mode = "file-system"
access_mode = "single-node-writer"
mount_options {
fs_type = "ext4"
mount_flags = ["noatime"]
}
}
volume "wikijs-db-data" {
type = "csi"
read_only = false
source = "wikijs-db-data"
attachment_mode = "file-system"
access_mode = "single-node-writer"
mount_options {
fs_type = "ext4"
mount_flags = ["noatime"]
}
}
task "wiki" {
driver = "docker"
volume_mount {
volume = "wikijs-data"
destination = "/wiki/data"
read_only = false
}
config {
image = "ghcr.io/requarks/wiki:2"
port_map {
http = 3000
}
}
env {
DB_TYPE = "postgres"
DB_HOST = "${NOMAD_IP_http}"
#DB_HOST = "wiki-db.services.dc1.consul"
#DB_HOST = "{{ env "NOMAD_IP_http" }}wiki-db.homelab"
DB_PORT = "25432"
DB_USER = "postgres"
DB_PASS = "<password here>"
DB_NAME = "wikijs"
}
service {
name = "wiki"
port = "http"
tags = [
"traefik.enable=true",
"traefik.http.middlewares.httpsRedirect.redirectscheme.scheme=https",
"traefik.http.routers.${NOMAD_TASK_NAME}_insecure.middlewares=httpsRedirect",
"traefik.http.routers.${NOMAD_TASK_NAME}_insecure.rule=Host(`${NOMAD_TASK_NAME}`)",
"traefik.http.routers.${NOMAD_TASK_NAME}.tls.domains[0].sans=${NOMAD_TASK_NAME}",
"traefik.http.routers.${NOMAD_TASK_NAME}.tls.certresolver=myresolver",
"traefik.http.routers.${NOMAD_TASK_NAME}.middlewares=httpsRedirect"
]
check {
type = "http"
path = "/"
#port = "http"
interval = "30s"
timeout = "2s"
}
}
resources {
cpu = 500
memory = 512
network {
port "http" {}
}
}
}
task "wiki-db" {
driver = "docker"
volume_mount {
volume = "wikijs-db-data"
destination = "/appdata"
read_only = false
}
#user = "postgres"
config {
image = "postgres:14-bullseye"
port_map {
db = 5432
}
}
env {
POSTGRES_DB = "wikijs"
POSTGRES_USER = "postgres"
POSTGRES_PASSWORD = "<password here>"
PGPASSWORD = "<password here>"
PGDATA = "/appdata/db/postgres/"
}
service {
name = "${NOMAD_TASK_NAME}"
tags = ["postgres"]
port = "db"
check {
type = "tcp"
port = "db"
interval = "30s"
timeout = "2s"
}
}
resources {
network {
port "db" {
static = "25432"
}
}
}
}
}
}
democratic-csi iscsi node logs
These are the logs from the node that was hosting this container. This issue affects all of the nodes.
Initial creation of container
{"host":"nomad4","level":"info","message":"new request - driver: FreeNASApiDriver method: NodeStageVolume call: {\"metadata\":{\"user-agent\":[\"grpc-go/1.45.0\"]},\"request\":{\"publish_context\":{},\"secrets\":\"redacted\",\"volume_context\":{\"node_attach_driver\":\"iscsi\",\"portal\":\"192.168.1.130:3260\",\"portals\":\"\",\"interface\":\"\",\"iqn\":\"iqn.2005-10.org.freenas.ctl:csi-wikijs-db-data-clustera\",\"lun\":\"0\",\"provisioner_driver\":\"freenas-api-iscsi\"},\"volume_id\":\"wikijs-db-data\",\"staging_target_path\":\"/local/csi/staging/wikijs-db-data/rw-file-system-single-node-writer\",\"volume_capability\":{\"access_mode\":{\"mode\":\"SINGLE_NODE_WRITER\"},\"mount\":{\"mount_flags\":[\"noatime\"],\"fs_type\":\"ext4\",\"volume_mount_group\":\"\"},\"access_type\":\"mount\"}},\"cancelled\":false}","service":"democratic-csi","timestamp":"2022-07-01T18:40:06.066Z"}
executing iscsi command: iscsiadm -m node -T iqn.2005-10.org.freenas.ctl:csi-wikijs-db-data-clustera -p 192.168.1.130:3260 -o new
executing iscsi command: iscsiadm -m node -T iqn.2005-10.org.freenas.ctl:csi-wikijs-db-data-clustera -p 192.168.1.130:3260 -o update --name node.startup --value manual
executing iscsi command: iscsiadm -m node -T iqn.2005-10.org.freenas.ctl:csi-wikijs-db-data-clustera -p 192.168.1.130:3260 -l
executing iscsi command: iscsiadm -m session
executing iscsi command: iscsiadm -m session -r 336 --rescan
retry - failed condition, not trying again
executing filesystem command: realpath /dev/disk/by-path/ip-192.168.1.130:3260-iscsi-iqn.2005-10.org.freenas.ctl:csi-wikijs-db-data-clustera-lun-0
{"host":"nomad4","level":"info","message":"successfully logged into portal 192.168.1.130:3260 and created device /dev/disk/by-path/ip-192.168.1.130:3260-iscsi-iqn.2005-10.org.freenas.ctl:csi-wikijs-db-data-clustera-lun-0 with realpath /dev/sdc","service":"democratic-csi","timestamp":"2022-07-01T18:40:08.189Z"}
executing filesystem command: sh -c for file in $(ls -la /dev/mapper/* | grep "\->" | grep -oP "\-> .+" | grep -oP " .+"); do echo $(F=$(echo $file | grep -oP "[a-z0-9-]+");echo $F":"$(ls "/sys/block/${F}/slaves/");); done;
executing filesystem command: realpath /dev/sdc
executing filesystem command: lsblk -a -b -J -O /dev/sdc
executing filesystem command: realpath /dev/sdc
executing filesystem command: lsblk -a -b -l -J -O
executing filesystem command: realpath /dev/sda
executing filesystem command: realpath /dev/sdc
executing filesystem command: lsblk -a -b -J -O /dev/sdc
executing filesystem command: mkfs.ext4 /dev/sdc
executing filesystem command: blkid -p -o export /dev/sdc
executing filesystem command: realpath /dev/sdc
executing mount command: findmnt --source /dev/sdc --mountpoint /local/csi/staging/wikijs-db-data/rw-file-system-single-node-writer --output source,target,fstype,label,options -b -J --nofsroot
executing filesystem command: realpath /dev/sdc
executing mount command: findmnt --source /dev/sdc --mountpoint /local/csi/staging/wikijs-db-data/rw-file-system-single-node-writer --output source,target,fstype,label,options -b -J --nofsroot
executing filesystem command: realpath /dev/sdc
executing filesystem command: lsblk -a -b -l -J -O
executing filesystem command: realpath /dev/sda
executing mount command: mount -t ext4 -o noatime,defaults /dev/sdc /local/csi/staging/wikijs-db-data/rw-file-system-single-node-writer
executing filesystem command: realpath /dev/sdc
executing filesystem command: lsblk -a -b -l -J -O
executing filesystem command: realpath /dev/sda
executing filesystem command: resize2fs /dev/sdc
{"host":"nomad4","level":"info","message":"new response - driver: FreeNASApiDriver method: NodeStageVolume response: {}","service":"democratic-csi","timestamp":"2022-07-01T18:40:10.457Z"}
{"host":"nomad4","level":"info","message":"new request - driver: FreeNASApiDriver method: NodePublishVolume call: {\"metadata\":{\"user-agent\":[\"grpc-go/1.45.0\"]},\"request\":{\"publish_context\":{},\"secrets\":\"redacted\",\"volume_context\":{\"portal\":\"192.168.1.130:3260\",\"portals\":\"\",\"interface\":\"\",\"iqn\":\"iqn.2005-10.org.freenas.ctl:csi-wikijs-db-data-clustera\",\"lun\":\"0\",\"provisioner_driver\":\"freenas-api-iscsi\",\"node_attach_driver\":\"iscsi\"},\"volume_id\":\"wikijs-db-data\",\"staging_target_path\":\"/local/csi/staging/wikijs-db-data/rw-file-system-single-node-writer\",\"target_path\":\"/local/csi/per-alloc/979f2355-c806-90e6-0145-e7f9af2111f7/wikijs-db-data/rw-file-system-single-node-writer\",\"volume_capability\":{\"access_mode\":{\"mode\":\"SINGLE_NODE_WRITER\"},\"mount\":{\"mount_flags\":[\"noatime\"],\"fs_type\":\"ext4\",\"volume_mount_group\":\"\"},\"access_type\":\"mount\"},\"readonly\":false},\"cancelled\":false}","service":"democratic-csi","timestamp":"2022-07-01T18:40:10.458Z"}
retry - failed condition, not trying again
executing filesystem command: mkdir -p -m 0750 /local/csi/per-alloc/979f2355-c806-90e6-0145-e7f9af2111f7/wikijs-db-data/rw-file-system-single-node-writer
executing mount command: findmnt --mountpoint /local/csi/staging/wikijs-db-data/rw-file-system-single-node-writer --output source,target,fstype,label,options -b -J --nofsroot
executing mount command: findmnt --mountpoint /local/csi/per-alloc/979f2355-c806-90e6-0145-e7f9af2111f7/wikijs-db-data/rw-file-system-single-node-writer --output source,target,fstype,label,options -b -J --nofsroot
executing mount command: mount --bind -o noatime,defaults /local/csi/staging/wikijs-db-data/rw-file-system-single-node-writer /local/csi/per-alloc/979f2355-c806-90e6-0145-e7f9af2111f7/wikijs-db-data/rw-file-system-single-node-writer
{"host":"nomad4","level":"info","message":"new response - driver: FreeNASApiDriver method: NodePublishVolume response: {}","service":"democratic-csi","timestamp":"2022-07-01T18:40:10.515Z"}
{"host":"nomad4","level":"info","message":"new request - driver: FreeNASApiDriver method: NodeStageVolume call: {\"metadata\":{\"user-agent\":[\"grpc-go/1.45.0\"]},\"request\":{\"publish_context\":{},\"secrets\":\"redacted\",\"volume_context\":{\"provisioner_driver\":\"freenas-api-iscsi\",\"node_attach_driver\":\"iscsi\",\"portal\":\"192.168.1.130:3260\",\"portals\":\"\",\"interface\":\"\",\"iqn\":\"iqn.2005-10.org.freenas.ctl:csi-wikijs-data-clustera\",\"lun\":\"0\"},\"volume_id\":\"wikijs-data\",\"staging_target_path\":\"/local/csi/staging/wikijs-data/rw-file-system-single-node-writer\",\"volume_capability\":{\"access_mode\":{\"mode\":\"SINGLE_NODE_WRITER\"},\"mount\":{\"mount_flags\":[\"noatime\"],\"fs_type\":\"ext4\",\"volume_mount_group\":\"\"},\"access_type\":\"mount\"}},\"cancelled\":false}","service":"democratic-csi","timestamp":"2022-07-01T18:40:10.518Z"}
executing iscsi command: iscsiadm -m node -T iqn.2005-10.org.freenas.ctl:csi-wikijs-data-clustera -p 192.168.1.130:3260 -o new
executing iscsi command: iscsiadm -m node -T iqn.2005-10.org.freenas.ctl:csi-wikijs-data-clustera -p 192.168.1.130:3260 -o update --name node.startup --value manual
executing iscsi command: iscsiadm -m node -T iqn.2005-10.org.freenas.ctl:csi-wikijs-data-clustera -p 192.168.1.130:3260 -l
executing iscsi command: iscsiadm -m session
executing iscsi command: iscsiadm -m session -r 337 --rescan
retry - failed condition, not trying again
executing filesystem command: realpath /dev/disk/by-path/ip-192.168.1.130:3260-iscsi-iqn.2005-10.org.freenas.ctl:csi-wikijs-data-clustera-lun-0
{"host":"nomad4","level":"info","message":"successfully logged into portal 192.168.1.130:3260 and created device /dev/disk/by-path/ip-192.168.1.130:3260-iscsi-iqn.2005-10.org.freenas.ctl:csi-wikijs-data-clustera-lun-0 with realpath /dev/sde","service":"democratic-csi","timestamp":"2022-07-01T18:40:12.625Z"}
executing filesystem command: sh -c for file in $(ls -la /dev/mapper/* | grep "\->" | grep -oP "\-> .+" | grep -oP " .+"); do echo $(F=$(echo $file | grep -oP "[a-z0-9-]+");echo $F":"$(ls "/sys/block/${F}/slaves/");); done;
executing filesystem command: realpath /dev/sde
executing filesystem command: lsblk -a -b -J -O /dev/sde
executing filesystem command: realpath /dev/sde
executing filesystem command: lsblk -a -b -l -J -O
executing filesystem command: realpath /dev/sda
executing filesystem command: realpath /dev/sde
executing filesystem command: lsblk -a -b -J -O /dev/sde
executing filesystem command: mkfs.ext4 /dev/sde
executing filesystem command: blkid -p -o export /dev/sde
executing filesystem command: realpath /dev/sde
executing mount command: findmnt --source /dev/sde --mountpoint /local/csi/staging/wikijs-data/rw-file-system-single-node-writer --output source,target,fstype,label,options -b -J --nofsroot
executing filesystem command: realpath /dev/sde
executing mount command: findmnt --source /dev/sde --mountpoint /local/csi/staging/wikijs-data/rw-file-system-single-node-writer --output source,target,fstype,label,options -b -J --nofsroot
executing filesystem command: realpath /dev/sde
executing filesystem command: lsblk -a -b -l -J -O
executing filesystem command: realpath /dev/sda
executing mount command: mount -t ext4 -o noatime,defaults /dev/sde /local/csi/staging/wikijs-data/rw-file-system-single-node-writer
executing filesystem command: realpath /dev/sde
executing filesystem command: lsblk -a -b -l -J -O
executing filesystem command: realpath /dev/sda
executing filesystem command: resize2fs /dev/sde
{"host":"nomad4","level":"info","message":"new response - driver: FreeNASApiDriver method: NodeStageVolume response: {}","service":"democratic-csi","timestamp":"2022-07-01T18:40:14.873Z"}
{"host":"nomad4","level":"info","message":"new request - driver: FreeNASApiDriver method: NodePublishVolume call: {\"metadata\":{\"user-agent\":[\"grpc-go/1.45.0\"]},\"request\":{\"publish_context\":{},\"secrets\":\"redacted\",\"volume_context\":{\"node_attach_driver\":\"iscsi\",\"portal\":\"192.168.1.130:3260\",\"portals\":\"\",\"interface\":\"\",\"iqn\":\"iqn.2005-10.org.freenas.ctl:csi-wikijs-data-clustera\",\"lun\":\"0\",\"provisioner_driver\":\"freenas-api-iscsi\"},\"volume_id\":\"wikijs-data\",\"staging_target_path\":\"/local/csi/staging/wikijs-data/rw-file-system-single-node-writer\",\"target_path\":\"/local/csi/per-alloc/979f2355-c806-90e6-0145-e7f9af2111f7/wikijs-data/rw-file-system-single-node-writer\",\"volume_capability\":{\"access_mode\":{\"mode\":\"SINGLE_NODE_WRITER\"},\"mount\":{\"mount_flags\":[\"noatime\"],\"fs_type\":\"ext4\",\"volume_mount_group\":\"\"},\"access_type\":\"mount\"},\"readonly\":false},\"cancelled\":false}","service":"democratic-csi","timestamp":"2022-07-01T18:40:14.874Z"}
retry - failed condition, not trying again
executing filesystem command: mkdir -p -m 0750 /local/csi/per-alloc/979f2355-c806-90e6-0145-e7f9af2111f7/wikijs-data/rw-file-system-single-node-writer
executing mount command: findmnt --mountpoint /local/csi/staging/wikijs-data/rw-file-system-single-node-writer --output source,target,fstype,label,options -b -J --nofsroot
executing mount command: findmnt --mountpoint /local/csi/per-alloc/979f2355-c806-90e6-0145-e7f9af2111f7/wikijs-data/rw-file-system-single-node-writer --output source,target,fstype,label,options -b -J --nofsroot
executing mount command: mount --bind -o noatime,defaults /local/csi/staging/wikijs-data/rw-file-system-single-node-writer /local/csi/per-alloc/979f2355-c806-90e6-0145-e7f9af2111f7/wikijs-data/rw-file-system-single-node-writer
{"host":"nomad4","level":"info","message":"new response - driver: FreeNASApiDriver method: NodePublishVolume response: {}","service":"democratic-csi","timestamp":"2022-07-01T18:40:14.929Z"}
{"host":"nomad4","level":"info","message":"new request - driver: FreeNASApiDriver method: Probe call: {\"metadata\":{\"user-agent\":[\"grpc-go/1.45.0\"]},\"request\":{},\"cancelled\":false}","service":"democratic-csi","timestamp":"2022-07-01T18:40:18.951Z"}
{"host":"nomad4","level":"info","message":"new response - driver: FreeNASApiDriver method: Probe response: {\"ready\":{\"value\":true}}","service":"democratic-csi","timestamp":"2022-07-01T18:40:18.951Z"}
{"host":"nomad4","level":"info","message":"new request - driver: FreeNASApiDriver method: Probe call: {\"metadata\":{\"user-agent\":[\"grpc-go/1.45.0\"]},\"request\":{},\"cancelled\":false}","service":"democratic-csi","timestamp":"2022-07-01T18:40:33.082Z"}
{"host":"nomad4","level":"info","message":"new response - driver: FreeNASApiDriver method: Probe response: {\"ready\":{\"value\":true}}","service":"democratic-csi","timestamp":"2022-07-01T18:40:33.082Z"}
{"host":"nomad4","level":"info","message":"new request - driver: FreeNASApiDriver method: NodeGetCapabilities call: {\"metadata\":{\"user-agent\":[\"grpc-go/1.45.0\"]},\"request\":{},\"cancelled\":false}","service":"democratic-csi","timestamp":"2022-07-01T18:40:33.085Z"}
{"host":"nomad4","level":"info","message":"new response - driver: FreeNASApiDriver method: NodeGetCapabilities response: {\"capabilities\":[{\"rpc\":{\"type\":\"STAGE_UNSTAGE_VOLUME\"}},{\"rpc\":{\"type\":\"GET_VOLUME_STATS\"}},{\"rpc\":{\"type\":\"EXPAND_VOLUME\"}},{\"rpc\":{\"type\":\"SINGLE_NODE_MULTI_WRITER\"}}]}","service":"democratic-csi","timestamp":"2022-07-01T18:40:33.085Z"}
Stopping container
{"host":"nomad4","level":"info","message":"new request - driver: FreeNASApiDriver method: NodeUnpublishVolume call: {\"metadata\":{\"user-agent\":[\"grpc-go/1.45.0\"]},\"request\":{\"volume_id\":\"wikijs-data\",\"target_path\":\"/local/csi/per-alloc/979f2355-c806-90e6-0145-e7f9af2111f7/wikijs-data/rw-file-system-single-node-writer\"},\"cancelled\":false}","service":"democratic-csi","timestamp":"2022-07-01T18:42:21.244Z"}
executing mount command: findmnt --mountpoint /local/csi/per-alloc/979f2355-c806-90e6-0145-e7f9af2111f7/wikijs-data/rw-file-system-single-node-writer --output source,target,fstype,label,options -b -J --nofsroot
{"host":"nomad4","level":"info","message":"new request - driver: FreeNASApiDriver method: NodeUnpublishVolume call: {\"metadata\":{\"user-agent\":[\"grpc-go/1.45.0\"]},\"request\":{\"volume_id\":\"wikijs-db-data\",\"target_path\":\"/local/csi/per-alloc/979f2355-c806-90e6-0145-e7f9af2111f7/wikijs-db-data/rw-file-system-single-node-writer\"},\"cancelled\":false}","service":"democratic-csi","timestamp":"2022-07-01T18:42:21.252Z"}
executing mount command: findmnt --mountpoint /local/csi/per-alloc/979f2355-c806-90e6-0145-e7f9af2111f7/wikijs-db-data/rw-file-system-single-node-writer --output source,target,fstype,label,options -b -J --nofsroot
executing mount command: umount /local/csi/per-alloc/979f2355-c806-90e6-0145-e7f9af2111f7/wikijs-data/rw-file-system-single-node-writer
executing mount command: umount /local/csi/per-alloc/979f2355-c806-90e6-0145-e7f9af2111f7/wikijs-db-data/rw-file-system-single-node-writer
executing filesystem command: rmdir /local/csi/per-alloc/979f2355-c806-90e6-0145-e7f9af2111f7/wikijs-data/rw-file-system-single-node-writer
{"host":"nomad4","level":"info","message":"new response - driver: FreeNASApiDriver method: NodeUnpublishVolume response: {}","service":"democratic-csi","timestamp":"2022-07-01T18:42:21.285Z"}
executing filesystem command: rmdir /local/csi/per-alloc/979f2355-c806-90e6-0145-e7f9af2111f7/wikijs-db-data/rw-file-system-single-node-writer
{"host":"nomad4","level":"info","message":"new request - driver: FreeNASApiDriver method: NodeUnstageVolume call: {\"metadata\":{\"user-agent\":[\"grpc-go/1.45.0\"]},\"request\":{\"volume_id\":\"wikijs-data\",\"staging_target_path\":\"/local/csi/staging/wikijs-data/rw-file-system-single-node-writer\"},\"cancelled\":false}","service":"democratic-csi","timestamp":"2022-07-01T18:42:21.289Z"}
executing mount command: findmnt --mountpoint /local/csi/staging/wikijs-data/rw-file-system-single-node-writer/block_device --output source,target,fstype,label,options -b -J --nofsroot
{"host":"nomad4","level":"info","message":"new response - driver: FreeNASApiDriver method: NodeUnpublishVolume response: {}","service":"democratic-csi","timestamp":"2022-07-01T18:42:21.292Z"}
executing mount command: findmnt --mountpoint /local/csi/staging/wikijs-data/rw-file-system-single-node-writer --output source,target,fstype,label,options -b -J --nofsroot
{"host":"nomad4","level":"info","message":"new request - driver: FreeNASApiDriver method: NodeUnstageVolume call: {\"metadata\":{\"user-agent\":[\"grpc-go/1.45.0\"]},\"request\":{\"volume_id\":\"wikijs-db-data\",\"staging_target_path\":\"/local/csi/staging/wikijs-db-data/rw-file-system-single-node-writer\"},\"cancelled\":false}","service":"democratic-csi","timestamp":"2022-07-01T18:42:21.301Z"}
executing mount command: findmnt --mountpoint /local/csi/staging/wikijs-db-data/rw-file-system-single-node-writer/block_device --output source,target,fstype,label,options -b -J --nofsroot
executing mount command: findmnt --mountpoint /local/csi/staging/wikijs-data/rw-file-system-single-node-writer --output source,target,fstype,label,options -b -J --nofsroot
executing filesystem command: realpath /dev/sde
executing mount command: findmnt --mountpoint /local/csi/staging/wikijs-db-data/rw-file-system-single-node-writer --output source,target,fstype,label,options -b -J --nofsroot
executing mount command: findmnt --mountpoint /local/csi/staging/wikijs-db-data/rw-file-system-single-node-writer --output source,target,fstype,label,options -b -J --nofsroot
executing filesystem command: lsblk -a -b -l -J -O
executing filesystem command: realpath /dev/sdc
executing filesystem command: lsblk -a -b -l -J -O
executing filesystem command: realpath /dev/sda
executing filesystem command: realpath /dev/sde
executing filesystem command: lsblk -a -b -J -O /dev/sde
executing filesystem command: realpath /dev/sda
executing filesystem command: realpath /dev/sdc
executing filesystem command: lsblk -a -b -J -O /dev/sdc
executing mount command: findmnt --mountpoint /local/csi/staging/wikijs-data/rw-file-system-single-node-writer --output source,target,fstype,label,options -b -J --nofsroot
executing mount command: findmnt --mountpoint /local/csi/staging/wikijs-db-data/rw-file-system-single-node-writer --output source,target,fstype,label,options -b -J --nofsroot
executing mount command: umount /local/csi/staging/wikijs-data/rw-file-system-single-node-writer
executing mount command: umount /local/csi/staging/wikijs-db-data/rw-file-system-single-node-writer
executing filesystem command: realpath /dev/sde
executing filesystem command: lsblk -a -b -l -J -O
executing filesystem command: realpath /dev/sda
executing filesystem command: realpath /dev/sde
executing filesystem command: realpath /dev/sde
executing filesystem command: realpath /dev/sdc
executing filesystem command: lsblk -a -b -J -O /dev/sde
executing filesystem command: lsblk -a -b -l -J -O
executing filesystem command: realpath /dev/sde
executing filesystem command: lsblk -a -b -J -O /dev/sde
executing filesystem command: realpath /dev/sda
executing filesystem command: realpath /dev/sdc
executing iscsi command: iscsiadm -m session -P 3
executing filesystem command: realpath /dev/sdc
executing filesystem command: lsblk -a -b -J -O /dev/sdc
executing filesystem command: realpath /dev/sdc
executing filesystem command: lsblk -a -b -J -O /dev/sdc
executing iscsi command: iscsiadm -m node -T iqn.2005-10.org.freenas.ctl:csi-wikijs-data-clustera -p 192.168.1.130:3260,1 -u
executing iscsi command: iscsiadm -m session -P 3
executing iscsi command: iscsiadm -m node -T iqn.2005-10.org.freenas.ctl:csi-wikijs-db-data-clustera -p 192.168.1.130:3260,1 -u
executing iscsi command: iscsiadm -m node -T iqn.2005-10.org.freenas.ctl:csi-wikijs-data-clustera -p 192.168.1.130:3260,1 -o delete
executing filesystem command: rmdir /local/csi/staging/wikijs-data/rw-file-system-single-node-writer
{"host":"nomad4","level":"info","message":"new response - driver: FreeNASApiDriver method: NodeUnstageVolume response: {}","service":"democratic-csi","timestamp":"2022-07-01T18:42:21.568Z"}
executing iscsi command: iscsiadm -m node -T iqn.2005-10.org.freenas.ctl:csi-wikijs-db-data-clustera -p 192.168.1.130:3260,1 -o delete
{"host":"nomad4","level":"info","message":"new request - driver: FreeNASApiDriver method: NodeUnpublishVolume call: {\"metadata\":{\"user-agent\":[\"grpc-go/1.45.0\"]},\"request\":{\"volume_id\":\"wikijs-db-data\",\"target_path\":\"/local/csi/per-alloc/979f2355-c806-90e6-0145-e7f9af2111f7/wikijs-db-data/rw-file-system-single-node-writer\"},\"cancelled\":false}","service":"democratic-csi","timestamp":"2022-07-01T18:42:21.578Z"}
{"host":"nomad4","level":"error","message":"handler error - driver: FreeNASApiDriver method: NodeUnpublishVolume error: {\"name\":\"GrpcError\",\"code\":10,\"message\":\"operation locked due to in progress operation(s): [\\\"volume_id_wikijs-db-data\\\"]\"}","service":"democratic-csi","timestamp":"2022-07-01T18:42:21.578Z"}
{"host":"nomad4","level":"info","message":"new request - driver: FreeNASApiDriver method: NodeUnpublishVolume call: {\"metadata\":{\"user-agent\":[\"grpc-go/1.45.0\"]},\"request\":{\"volume_id\":\"wikijs-db-data\",\"target_path\":\"/local/csi/per-alloc/979f2355-c806-90e6-0145-e7f9af2111f7/wikijs-db-data/rw-file-system-single-node-writer\"},\"cancelled\":false}","service":"democratic-csi","timestamp":"2022-07-01T18:42:21.580Z"}
{"host":"nomad4","level":"error","message":"handler error - driver: FreeNASApiDriver method: NodeUnpublishVolume error: {\"name\":\"GrpcError\",\"code\":10,\"message\":\"operation locked due to in progress operation(s): [\\\"volume_id_wikijs-db-data\\\"]\"}","service":"democratic-csi","timestamp":"2022-07-01T18:42:21.580Z"}
{"host":"nomad4","level":"info","message":"new request - driver: FreeNASApiDriver method: NodeUnpublishVolume call: {\"metadata\":{\"user-agent\":[\"grpc-go/1.45.0\"]},\"request\":{\"volume_id\":\"wikijs-db-data\",\"target_path\":\"/local/csi/per-alloc/979f2355-c806-90e6-0145-e7f9af2111f7/wikijs-db-data/rw-file-system-single-node-writer\"},\"cancelled\":false}","service":"democratic-csi","timestamp":"2022-07-01T18:42:21.585Z"}
{"host":"nomad4","level":"error","message":"handler error - driver: FreeNASApiDriver method: NodeUnpublishVolume error: {\"name\":\"GrpcError\",\"code\":10,\"message\":\"operation locked due to in progress operation(s): [\\\"volume_id_wikijs-db-data\\\"]\"}","service":"democratic-csi","timestamp":"2022-07-01T18:42:21.585Z"}
executing filesystem command: rmdir /local/csi/staging/wikijs-db-data/rw-file-system-single-node-writer
{"host":"nomad4","level":"info","message":"new response - driver: FreeNASApiDriver method: NodeUnstageVolume response: {}","service":"democratic-csi","timestamp":"2022-07-01T18:42:21.590Z"}
Starting container
{"host":"nomad4","level":"info","message":"new response - driver: FreeNASApiDriver method: Probe response: {\"ready\":{\"value\":true}}","service":"democratic-csi","timestamp":"2022-07-01T18:45:18.972Z"}
{"host":"nomad4","level":"info","message":"new request - driver: FreeNASApiDriver method: NodeStageVolume call: {\"metadata\":{\"user-agent\":[\"grpc-go/1.45.0\"]},\"request\":{\"publish_context\":{},\"secrets\":\"redacted\",\"volume_context\":{\"provisioner_driver\":\"freenas-api-iscsi\",\"node_attach_driver\":\"iscsi\",\"portal\":\"192.168.1.130:3260\",\"portals\":\"\",\"interface\":\"\",\"iqn\":\"iqn.2005-10.org.freenas.ctl:csi-wikijs-data-clustera\",\"lun\":\"0\"},\"volume_id\":\"wikijs-data\",\"staging_target_path\":\"/local/csi/staging/wikijs-data/rw-file-system-single-node-writer\",\"volume_capability\":{\"access_mode\":{\"mode\":\"SINGLE_NODE_WRITER\"},\"mount\":{\"mount_flags\":[\"noatime\"],\"fs_type\":\"ext4\",\"volume_mount_group\":\"\"},\"access_type\":\"mount\"}},\"cancelled\":false}","service":"democratic-csi","timestamp":"2022-07-01T18:45:23.092Z"}
executing iscsi command: iscsiadm -m node -T iqn.2005-10.org.freenas.ctl:csi-wikijs-data-clustera -p 192.168.1.130:3260 -o new
executing iscsi command: iscsiadm -m node -T iqn.2005-10.org.freenas.ctl:csi-wikijs-data-clustera -p 192.168.1.130:3260 -o update --name node.startup --value manual
executing iscsi command: iscsiadm -m node -T iqn.2005-10.org.freenas.ctl:csi-wikijs-data-clustera -p 192.168.1.130:3260 -l
executing iscsi command: iscsiadm -m session
executing iscsi command: iscsiadm -m session -r 338 --rescan
retry - failed condition, not trying again
executing filesystem command: realpath /dev/disk/by-path/ip-192.168.1.130:3260-iscsi-iqn.2005-10.org.freenas.ctl:csi-wikijs-data-clustera-lun-0
{"host":"nomad4","level":"info","message":"successfully logged into portal 192.168.1.130:3260 and created device /dev/disk/by-path/ip-192.168.1.130:3260-iscsi-iqn.2005-10.org.freenas.ctl:csi-wikijs-data-clustera-lun-0 with realpath /dev/sdc","service":"democratic-csi","timestamp":"2022-07-01T18:45:26.272Z"}
executing filesystem command: sh -c for file in $(ls -la /dev/mapper/* | grep "\->" | grep -oP "\-> .+" | grep -oP " .+"); do echo $(F=$(echo $file | grep -oP "[a-z0-9-]+");echo $F":"$(ls "/sys/block/${F}/slaves/");); done;
executing filesystem command: realpath /dev/sdc
executing filesystem command: lsblk -a -b -J -O /dev/sdc
executing filesystem command: realpath /dev/sdc
executing filesystem command: lsblk -a -b -l -J -O
executing filesystem command: realpath /dev/sda
executing filesystem command: realpath /dev/sdc
executing filesystem command: lsblk -a -b -J -O /dev/sdc
executing filesystem command: mkfs.ext4 /dev/sdc
executing filesystem command: blkid -p -o export /dev/sdc
executing filesystem command: realpath /dev/sdc
executing mount command: findmnt --source /dev/sdc --mountpoint /local/csi/staging/wikijs-data/rw-file-system-single-node-writer --output source,target,fstype,label,options -b -J --nofsroot
executing filesystem command: realpath /dev/sdc
executing mount command: findmnt --source /dev/sdc --mountpoint /local/csi/staging/wikijs-data/rw-file-system-single-node-writer --output source,target,fstype,label,options -b -J --nofsroot
executing filesystem command: realpath /dev/sdc
executing filesystem command: lsblk -a -b -l -J -O
executing filesystem command: realpath /dev/sda
executing mount command: mount -t ext4 -o noatime,defaults /dev/sdc /local/csi/staging/wikijs-data/rw-file-system-single-node-writer
executing filesystem command: realpath /dev/sdc
executing filesystem command: lsblk -a -b -l -J -O
executing filesystem command: realpath /dev/sda
executing filesystem command: resize2fs /dev/sdc
{"host":"nomad4","level":"info","message":"new response - driver: FreeNASApiDriver method: NodeStageVolume response: {}","service":"democratic-csi","timestamp":"2022-07-01T18:45:28.553Z"}
{"host":"nomad4","level":"info","message":"new request - driver: FreeNASApiDriver method: NodePublishVolume call: {\"metadata\":{\"user-agent\":[\"grpc-go/1.45.0\"]},\"request\":{\"publish_context\":{},\"secrets\":\"redacted\",\"volume_context\":{\"lun\":\"0\",\"provisioner_driver\":\"freenas-api-iscsi\",\"node_attach_driver\":\"iscsi\",\"portal\":\"192.168.1.130:3260\",\"portals\":\"\",\"interface\":\"\",\"iqn\":\"iqn.2005-10.org.freenas.ctl:csi-wikijs-data-clustera\"},\"volume_id\":\"wikijs-data\",\"staging_target_path\":\"/local/csi/staging/wikijs-data/rw-file-system-single-node-writer\",\"target_path\":\"/local/csi/per-alloc/7df45fbd-0ecf-dc5c-72ae-e843c25feff8/wikijs-data/rw-file-system-single-node-writer\",\"volume_capability\":{\"access_mode\":{\"mode\":\"SINGLE_NODE_WRITER\"},\"mount\":{\"mount_flags\":[\"noatime\"],\"fs_type\":\"ext4\",\"volume_mount_group\":\"\"},\"access_type\":\"mount\"},\"readonly\":false},\"cancelled\":false}","service":"democratic-csi","timestamp":"2022-07-01T18:45:28.555Z"}
retry - failed condition, not trying again
executing filesystem command: mkdir -p -m 0750 /local/csi/per-alloc/7df45fbd-0ecf-dc5c-72ae-e843c25feff8/wikijs-data/rw-file-system-single-node-writer
executing mount command: findmnt --mountpoint /local/csi/staging/wikijs-data/rw-file-system-single-node-writer --output source,target,fstype,label,options -b -J --nofsroot
executing mount command: findmnt --mountpoint /local/csi/per-alloc/7df45fbd-0ecf-dc5c-72ae-e843c25feff8/wikijs-data/rw-file-system-single-node-writer --output source,target,fstype,label,options -b -J --nofsroot
executing mount command: mount --bind -o noatime,defaults /local/csi/staging/wikijs-data/rw-file-system-single-node-writer /local/csi/per-alloc/7df45fbd-0ecf-dc5c-72ae-e843c25feff8/wikijs-data/rw-file-system-single-node-writer
{"host":"nomad4","level":"info","message":"new response - driver: FreeNASApiDriver method: NodePublishVolume response: {}","service":"democratic-csi","timestamp":"2022-07-01T18:45:28.610Z"}
{"host":"nomad4","level":"info","message":"new request - driver: FreeNASApiDriver method: NodeStageVolume call: {\"metadata\":{\"user-agent\":[\"grpc-go/1.45.0\"]},\"request\":{\"publish_context\":{},\"secrets\":\"redacted\",\"volume_context\":{\"interface\":\"\",\"iqn\":\"iqn.2005-10.org.freenas.ctl:csi-wikijs-db-data-clustera\",\"lun\":\"0\",\"provisioner_driver\":\"freenas-api-iscsi\",\"node_attach_driver\":\"iscsi\",\"portal\":\"192.168.1.130:3260\",\"portals\":\"\"},\"volume_id\":\"wikijs-db-data\",\"staging_target_path\":\"/local/csi/staging/wikijs-db-data/rw-file-system-single-node-writer\",\"volume_capability\":{\"access_mode\":{\"mode\":\"SINGLE_NODE_WRITER\"},\"mount\":{\"mount_flags\":[\"noatime\"],\"fs_type\":\"ext4\",\"volume_mount_group\":\"\"},\"access_type\":\"mount\"}},\"cancelled\":false}","service":"democratic-csi","timestamp":"2022-07-01T18:45:28.612Z"}
executing iscsi command: iscsiadm -m node -T iqn.2005-10.org.freenas.ctl:csi-wikijs-db-data-clustera -p 192.168.1.130:3260 -o new
executing iscsi command: iscsiadm -m node -T iqn.2005-10.org.freenas.ctl:csi-wikijs-db-data-clustera -p 192.168.1.130:3260 -o update --name node.startup --value manual
executing iscsi command: iscsiadm -m node -T iqn.2005-10.org.freenas.ctl:csi-wikijs-db-data-clustera -p 192.168.1.130:3260 -l
executing iscsi command: iscsiadm -m session
executing iscsi command: iscsiadm -m session -r 339 --rescan
retry - failed condition, not trying again
executing filesystem command: realpath /dev/disk/by-path/ip-192.168.1.130:3260-iscsi-iqn.2005-10.org.freenas.ctl:csi-wikijs-db-data-clustera-lun-0
{"host":"nomad4","level":"info","message":"successfully logged into portal 192.168.1.130:3260 and created device /dev/disk/by-path/ip-192.168.1.130:3260-iscsi-iqn.2005-10.org.freenas.ctl:csi-wikijs-db-data-clustera-lun-0 with realpath /dev/sde","service":"democratic-csi","timestamp":"2022-07-01T18:45:30.709Z"}
executing filesystem command: sh -c for file in $(ls -la /dev/mapper/* | grep "\->" | grep -oP "\-> .+" | grep -oP " .+"); do echo $(F=$(echo $file | grep -oP "[a-z0-9-]+");echo $F":"$(ls "/sys/block/${F}/slaves/");); done;
executing filesystem command: realpath /dev/sde
executing filesystem command: lsblk -a -b -J -O /dev/sde
executing filesystem command: realpath /dev/sde
executing filesystem command: lsblk -a -b -l -J -O
executing filesystem command: realpath /dev/sda
executing filesystem command: realpath /dev/sde
executing filesystem command: lsblk -a -b -J -O /dev/sde
executing filesystem command: mkfs.ext4 /dev/sde
executing filesystem command: blkid -p -o export /dev/sde
executing filesystem command: realpath /dev/sde
executing mount command: findmnt --source /dev/sde --mountpoint /local/csi/staging/wikijs-db-data/rw-file-system-single-node-writer --output source,target,fstype,label,options -b -J --nofsroot
executing filesystem command: realpath /dev/sde
executing mount command: findmnt --source /dev/sde --mountpoint /local/csi/staging/wikijs-db-data/rw-file-system-single-node-writer --output source,target,fstype,label,options -b -J --nofsroot
executing filesystem command: realpath /dev/sde
executing filesystem command: lsblk -a -b -l -J -O
executing filesystem command: realpath /dev/sda
executing mount command: mount -t ext4 -o noatime,defaults /dev/sde /local/csi/staging/wikijs-db-data/rw-file-system-single-node-writer
executing filesystem command: realpath /dev/sde
executing filesystem command: lsblk -a -b -l -J -O
executing filesystem command: realpath /dev/sda
executing filesystem command: resize2fs /dev/sde
{"host":"nomad4","level":"info","message":"new response - driver: FreeNASApiDriver method: NodeStageVolume response: {}","service":"democratic-csi","timestamp":"2022-07-01T18:45:33.004Z"}
{"host":"nomad4","level":"info","message":"new request - driver: FreeNASApiDriver method: NodePublishVolume call: {\"metadata\":{\"user-agent\":[\"grpc-go/1.45.0\"]},\"request\":{\"publish_context\":{},\"secrets\":\"redacted\",\"volume_context\":{\"lun\":\"0\",\"provisioner_driver\":\"freenas-api-iscsi\",\"node_attach_driver\":\"iscsi\",\"portal\":\"192.168.1.130:3260\",\"portals\":\"\",\"interface\":\"\",\"iqn\":\"iqn.2005-10.org.freenas.ctl:csi-wikijs-db-data-clustera\"},\"volume_id\":\"wikijs-db-data\",\"staging_target_path\":\"/local/csi/staging/wikijs-db-data/rw-file-system-single-node-writer\",\"target_path\":\"/local/csi/per-alloc/7df45fbd-0ecf-dc5c-72ae-e843c25feff8/wikijs-db-data/rw-file-system-single-node-writer\",\"volume_capability\":{\"access_mode\":{\"mode\":\"SINGLE_NODE_WRITER\"},\"mount\":{\"mount_flags\":[\"noatime\"],\"fs_type\":\"ext4\",\"volume_mount_group\":\"\"},\"access_type\":\"mount\"},\"readonly\":false},\"cancelled\":false}","service":"democratic-csi","timestamp":"2022-07-01T18:45:33.007Z"}
retry - failed condition, not trying again
executing filesystem command: mkdir -p -m 0750 /local/csi/per-alloc/7df45fbd-0ecf-dc5c-72ae-e843c25feff8/wikijs-db-data/rw-file-system-single-node-writer
executing mount command: findmnt --mountpoint /local/csi/staging/wikijs-db-data/rw-file-system-single-node-writer --output source,target,fstype,label,options -b -J --nofsroot
executing mount command: findmnt --mountpoint /local/csi/per-alloc/7df45fbd-0ecf-dc5c-72ae-e843c25feff8/wikijs-db-data/rw-file-system-single-node-writer --output source,target,fstype,label,options -b -J --nofsroot
executing mount command: mount --bind -o noatime,defaults /local/csi/staging/wikijs-db-data/rw-file-system-single-node-writer /local/csi/per-alloc/7df45fbd-0ecf-dc5c-72ae-e843c25feff8/wikijs-db-data/rw-file-system-single-node-writer
{"host":"nomad4","level":"info","message":"new response - driver: FreeNASApiDriver method: NodePublishVolume response: {}","service":"democratic-csi","timestamp":"2022-07-01T18:45:33.071Z"}
{"host":"nomad4","level":"info","message":"new request - driver: FreeNASApiDriver method: Probe call: {\"metadata\":{\"user-agent\":[\"grpc-go/1.45.0\"]},\"request\":{},\"cancelled\":false}","service":"democratic-csi","timestamp":"2022-07-01T18:45:33.110Z"}
{"host":"nomad4","level":"info","message":"new response - driver: FreeNASApiDriver method: Probe response: {\"ready\":{\"value\":true}}","service":"democratic-csi","timestamp":"2022-07-01T18:45:33.110Z"}
{"host":"nomad4","level":"info","message":"new request - driver: FreeNASApiDriver method: NodeGetCapabilities call: {\"metadata\":{\"user-agent\":[\"grpc-go/1.45.0\"]},\"request\":{},\"cancelled\":false}","service":"democratic-csi","timestamp":"2022-07-01T18:45:33.111Z"}
Issue Analytics
- State:
- Created a year ago
- Comments:50 (28 by maintainers)
I have added an ability to tweak this behavior, but am unlikely to alter the default for the time being: https://github.com/democratic-csi/democratic-csi/commit/516701bd29a41f4b6ffe0b90d26e286c5196706c
If you try the new
next
images and set theFILESYSTEM_TYPE_DETECTION_STRATEGY=blkid
env var in the node deployment it should useblkid
for the check instead oflsblk
. I don’t really love theblkid
feature because if the block device has no partition table and isn’t formatted the command exits with a2
exit code. I have no idea if other scenarios could lead to that exit code which is why I’m a bit hesitant to go that route by default.At this point I think we’re best to simply properly document the need for the udev mount and make sure it is added to all the examples etc.
lsblk --sysroot / -a -J -O /dev/sdc
gives the same fstype: null value.