intel / pmem-csi

Persistent Memory Container Storage Interface Driver
Apache License 2.0
164 stars 55 forks source link

more flexible tracking of namespaces used by PMEM-CSI #475

Open pohly opened 4 years ago

pohly commented 4 years ago

LVM mode uses "pmem-csi" as name. Direct mode uses some number ("3139354fcdce525afc802bc0d64203a6fa41f9e3"). Example of using first LVM mode on a node, then two volumes with direct mode:

$ _work/pmem-govm/ssh.2 sudo ndctl list -RN 
{
  "regions":[
    {
      "dev":"region0",
      "size":68717379584,
      "available_size":24693964800,
      "max_available_extent":24693964800,
      "type":"pmem",
      "iset_id":10248187106440278,
      "persistence_domain":"unknown",
      "namespaces":[
        {
          "dev":"namespace0.2",
          "mode":"fsdax",
          "map":"dev",
          "size":1073741824,
          "uuid":"371c52c9-0d06-11ea-946f-0242ac110004",
          "sector_size":512,
          "align":1073741824,
          "blockdev":"pmem0.2",
          "name":"3139354fcdce525afc802bc0d64203a6fa41f9e3"
        },
        {
          "dev":"namespace0.4",
          "mode":"fsdax",
          "map":"dev",
          "size":1073741824,
          "uuid":"37123a03-0d06-11ea-946f-0242ac110004",
          "sector_size":512,
          "align":1073741824,
          "blockdev":"pmem0.4",
          "name":"287ff2808e47b7d266f601c129c0640251970262"
        },
        {
          "dev":"namespace0.1",
          "mode":"sector",
          "size":6435082240,
          "uuid":"bf300d93-0d05-11ea-aeb1-0242ac110004",
          "sector_size":4096,
          "blockdev":"pmem0.1s",
          "name":"pmem-csi"
        },
        {
          "dev":"namespace0.0",
          "mode":"fsdax",
          "map":"dev",
          "size":32212254720,
          "uuid":"befdd91f-0d05-11ea-aeb1-0242ac110004",
          "sector_size":512,
          "align":1073741824,
          "blockdev":"pmem0",
          "name":"pmem-csi"
        }
      ]
    }
  ]
}

This can be a bit confusing. In Kubernetes, we have:

$ kubectl get pvc
NAME                STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS       AGE
pmem-csi-pvc-ext4   Bound    pvc-9fb9bb27-89c6-4108-bed7-161ed9056822   1Mi        RWO            pmem-csi-sc-ext4   5m48s
pmem-csi-pvc-xfs    Bound    pvc-bee4559b-5b14-4c50-8892-57ce130a31ad   1Mi        RWO            pmem-csi-sc-xfs    5m48s

Some potential ideas for enhancing this: [] use "pmem-csi-" as prefix in direct mode, more visibly correlate the namespace with some identifier (PV name?) in Kubernetes [] describe ndctl and LVM output for various scenarios, to assist users with troubleshooting [] enhance unit tests so that they catch the bug in https://github.com/intel/pmem-csi/pull/420#discussion_r349144373 and others: set up various scenarios for PMEM usage on a host and check that PMEM-CSI in direct mode handles them correctly [] also add other scenarios for PMEM-CSI in LVM mode [] describe and test migration scenarios for going back and forth from LVM mode to direct mode [] support mixing both modes, potentially even on the same host (?) - might be too complicated

okartau commented 4 years ago

describe and test migration scenarios for going back and forth from LVM mode to direct mode

We have chapter "Notes about switching device mode" in DEVELOPMENT that addresses most typical issues there. It's brief and can be expanded.

pohly commented 4 years ago

We have chapter "Notes about switching device mode" in DEVELOPMENT that addresses most typical issues there. It's brief and can be expanded.

Good, so we have something to start with. We just need to move it into a section for admins.