Repository: harvester/harvester

Issue #2990: [BUG] Recently Added Disk That Doesn't Have Disk Tag(s) Doesn't Display Storage Information On detail/harvesterhci.io/host/HarvesterHostDisk.vue
Created: 2022-10-19T18:56:13Z
Describe the bug
When you add a disk to a node in a multi-node cluster - but you do not tag it with any disk tags & you format it with ext4 - looking at the Host on the "Detail" tab, specifically the "Storage" section, it displays an empty box and no Storage information
To Reproduce
Steps to reproduce the behavior:

Have a Multi-Node Cluster or Single Node
Goto "Hosts"
Ensure you are on the "Details" Tab
Goto "Storage"
Visually Audit that you have 1 Box, that shows your current Storage information, you will see, that on your base storage, it shows storage information without any disk tags, or node tags as you haven't provided that information
Add node tags to node, add disk tags to main disk
Save
Add additional disk (that you have prepared with sudo gdisk /dev/abc &&|| sudo fdisk /dev/abc
Select force-format-ext4
Save
View Hosts - Details Tab - Storage Section
You will see an additional box, that is completely empty, with no disk information on the additional storage disk

Expected behavior
That even if the storage disk is added, force formatted and doesn't have disk tags, that it would still display the storage information, like the main disk does when the node doesn't have any disk tags or node tags on the node.
Environment

Harvester ISO version: v1.1.0-rc3
Underlying Infrastructure: 3 node thinkcentre lenovo multi-node cluster bare-metal:

Intel(R) Xeon(R) CPU E3-1265L v3 @ 2.50GHz
16Gib DDR4
400ish GIB disk



API Info

We can see with: GET https://192.168.1.158/v1/harvester/harvesterhci.io.blockdevices it returns JSON of:

{
  "type": "collection",
  "links": {
    "self": "https://192.168.1.158/v1/harvester/harvesterhci.io.blockdevices"
  },
  "createTypes": {
    "harvesterhci.io.blockdevice": "https://192.168.1.158/v1/harvester/harvesterhci.io.blockdevices"
  },
  "actions": {},
  "resourceType": "harvesterhci.io.blockdevice",
  "revision": "65807",
  "data": [
    {
      "id": "longhorn-system/c68bc42159d969a03b96f0fdebec3eef",
      "type": "harvesterhci.io.blockdevice",
      "links": {
        "remove": "https://192.168.1.158/v1/harvester/harvesterhci.io.blockdevices/longhorn-system/c68bc42159d969a03b96f0fdebec3eef",
        "self": "https://192.168.1.158/v1/harvester/harvesterhci.io.blockdevices/longhorn-system/c68bc42159d969a03b96f0fdebec3eef",
        "update": "https://192.168.1.158/v1/harvester/harvesterhci.io.blockdevices/longhorn-system/c68bc42159d969a03b96f0fdebec3eef",
        "view": "https://192.168.1.158/apis/harvesterhci.io/v1beta1/namespaces/longhorn-system/blockdevices/c68bc42159d969a03b96f0fdebec3eef"
      },
      "apiVersion": "harvesterhci.io/v1beta1",
      "kind": "BlockDevice",
      "metadata": {
        "creationTimestamp": "2022-10-19T17:59:46Z",
        "fields": [
          "c68bc42159d969a03b96f0fdebec3eef",
          "disk",
          "/dev/sdb",
          "/var/lib/harvester/extra-disks/c68bc42159d969a03b96f0fdebec3eef",
          "thinkcentre-node-bottom",
          "Active",
          "30m"
        ],
        "finalizers": [
          "wrangler.cattle.io/harvester-block-device-handler"
        ],
        "generation": 6,
        "labels": {
          "kubernetes.io/hostname": "thinkcentre-node-bottom",
          "ndm.harvesterhci.io/device-type": "disk"
        },
        "managedFields": [
          {
            "apiVersion": "harvesterhci.io/v1beta1",
            "fieldsType": "FieldsV1",
            "fieldsV1": {
              "f:spec": {
                "f:fileSystem": {
                  "f:forceFormatted": {},
                  "f:provisioned": {}
                }
              }
            },
            "manager": "harvester",
            "operation": "Update",
            "time": "2022-10-19T18:00:22Z"
          },
          {
            "apiVersion": "harvesterhci.io/v1beta1",
            "fieldsType": "FieldsV1",
            "fieldsV1": {
              "f:metadata": {
                "f:finalizers": {
                  ".": {},
                  "v:\"wrangler.cattle.io/harvester-block-device-handler\"": {}
                },
                "f:labels": {
                  ".": {},
                  "f:kubernetes.io/hostname": {},
                  "f:ndm.harvesterhci.io/device-type": {}
                }
              },
              "f:spec": {
                ".": {},
                "f:devPath": {},
                "f:fileSystem": {
                  ".": {},
                  "f:mountPoint": {}
                },
                "f:nodeName": {}
              },
              "f:status": {
                ".": {},
                "f:conditions": {},
                "f:deviceStatus": {
                  ".": {},
                  "f:capacity": {
                    ".": {},
                    "f:physicalBlockSizeBytes": {},
                    "f:sizeBytes": {}
                  },
                  "f:details": {
                    ".": {},
                    "f:busPath": {},
                    "f:deviceType": {},
                    "f:driveType": {},
                    "f:isRemovable": {},
                    "f:model": {},
                    "f:serialNumber": {},
                    "f:storageController": {},
                    "f:uuid": {},
                    "f:vendor": {},
                    "f:wwn": {}
                  },
                  "f:devPath": {},
                  "f:fileSystem": {
                    ".": {},
                    "f:LastFormattedAt": {},
                    "f:mountPoint": {},
                    "f:type": {}
                  },
                  "f:partitioned": {}
                },
                "f:provisionPhase": {},
                "f:state": {}
              }
            },
            "manager": "node-disk-manager",
            "operation": "Update",
            "time": "2022-10-19T18:00:25Z"
          }
        ],
        "name": "c68bc42159d969a03b96f0fdebec3eef",
        "namespace": "longhorn-system",
        "relationships": null,
        "resourceVersion": "38769",
        "state": {
          "error": false,
          "message": "Resource is current",
          "name": "active",
          "transitioning": false
        },
        "uid": "f207e5b8-86ca-47a8-af6f-72ca46afc330"
      },
      "spec": {
        "devPath": "/dev/sdb",
        "fileSystem": {
          "forceFormatted": true,
          "mountPoint": "",
          "provisioned": true
        },
        "nodeName": "thinkcentre-node-bottom"
      },
      "status": {
        "conditions": [
          {
            "error": false,
            "lastUpdateTime": "2022-10-19T18:00:25Z",
            "message": "Done device ext4 filesystem formatting",
            "status": "False",
            "transitioning": false,
            "type": "Formatting"
          },
          {
            "error": false,
            "lastUpdateTime": "2022-10-19T18:00:25Z",
            "status": "True",
            "transitioning": false,
            "type": "Mounted"
          },
          {
            "error": false,
            "lastUpdateTime": "2022-10-19T18:00:25Z",
            "message": "Added disk c68bc42159d969a03b96f0fdebec3eef to longhorn node `thinkcentre-node-bottom` as an additional disk",
            "status": "True",
            "transitioning": false,
            "type": "AddedToNode"
          }
        ],
        "deviceStatus": {
          "capacity": {
            "physicalBlockSizeBytes": 512,
            "sizeBytes": 15376318464
          },
          "details": {
            "busPath": "pci-0000:00:14.0-usb-0:2:1.0-scsi-0:0:0:0",
            "deviceType": "disk",
            "driveType": "HDD",
            "isRemovable": true,
            "model": "SanDisk_3.2Gen1",
            "serialNumber": "00006616010321104340",
            "storageController": "SCSI",
            "uuid": "dc79022b-bede-47eb-b8dc-65874897be66",
            "vendor": "USB",
            "wwn": "unknown"
          },
          "devPath": "/dev/sdb",
          "fileSystem": {
            "LastFormattedAt": "2022-10-19T18:00:25Z",
            "mountPoint": "/var/lib/harvester/extra-disks/c68bc42159d969a03b96f0fdebec3eef",
            "type": "ext4"
          },
          "partitioned": false
        },
        "provisionPhase": "Provisioned",
        "state": "Active"
      }
    }
  ]
}
We see the devPath, /dev/sdb, that has the mountPoint, showing that it is the extra disk.
We can see that under "deviceStatus" - "capacity" there is the "sizeBytes" information present.
When we look at the edit, in the async function when we fetch the disks:
https://github.com/harvester/dashboard/blob/master/pkg/harvester/edit/harvesterhci.io.host/index.vue#L52-L99
I'm not sure if the Harvester Disks mixin:
https://github.com/harvester/dashboard/blob/master/pkg/harvester/mixins/harvester-disk.js
That gets used on the "Detail" section as described in this - if that needs more edits to supply:
https://github.com/harvester/dashboard/blob/master/pkg/harvester/detail/harvesterhci.io.host/HarvesterHostDisk.vue
Additional context





Extra Additional Content

  
    
    

    adding-disk-tags-show-information.mp4
    
  

  

  




[
  {
    "conditions": [
      {
        "lastProbeTime": "",
        "lastTransitionTime": "2022-10-19T18:00:34Z",
        "message": "Disk c68bc42159d969a03b96f0fdebec3eef(/var/lib/harvester/extra-disks/c68bc42159d969a03b96f0fdebec3eef) on node thinkcentre-node-bottom is ready",
        "reason": "",
        "status": "True",
        "type": "Ready"
      },
      {
        "lastProbeTime": "",
        "lastTransitionTime": "2022-10-19T18:00:34Z",
        "message": "Disk c68bc42159d969a03b96f0fdebec3eef(/var/lib/harvester/extra-disks/c68bc42159d969a03b96f0fdebec3eef) on node thinkcentre-node-bottom is schedulable",
        "reason": "",
        "status": "True",
        "type": "Schedulable"
      }
    ],
    "diskUUID": "60afa664-b740-41fd-b029-d4eb35f02884",
    "scheduledReplica": {},
    "storageAvailable": "14 GiB",
    "storageMaximum": "14 GiB",
    "storageScheduled": "0 GiB",
    "allowScheduling": true,
    "evictionRequested": false,
    "path": "/var/lib/harvester/extra-disks/c68bc42159d969a03b96f0fdebec3eef",
    "storageReserved": "0 GiB",
    "tags": [
      "bottom-extra"
    ],
    "name": "c68bc42159d969a03b96f0fdebec3eef",
    "isNew": false,
    "blockDevice": "[object Router]",
    "displayName": "/dev/sdb",
    "forceFormatted": true
  },
  {
    "conditions": [
      {
        "lastProbeTime": "",
        "lastTransitionTime": "2022-10-19T17:48:34Z",
        "message": "Disk default-disk-6c6808403dbb7009(/var/lib/harvester/defaultdisk) on node thinkcentre-node-bottom is ready",
        "reason": "",
        "status": "True",
        "type": "Ready"
      },
      {
        "lastProbeTime": "",
        "lastTransitionTime": "2022-10-19T17:48:34Z",
        "message": "Disk default-disk-6c6808403dbb7009(/var/lib/harvester/defaultdisk) on node thinkcentre-node-bottom is schedulable",
        "reason": "",
        "status": "True",
        "type": "Schedulable"
      }
    ],
    "diskUUID": "8d1e4d8b-3ff6-4995-922f-bdfb6d3a6d73",
    "scheduledReplica": {
      "pvc-00816ee4-b760-4fbf-a291-8d83ccaf2a30-r-1694b3b5": 5368709120,
      "pvc-13e8de6b-2626-4730-9273-74f9337916d3-r-0d10ac11": 53687091200,
      "pvc-3ad96d77-0095-49b1-ac03-f5631a66bae5-r-b0090986": 2147483648
    },
    "storageAvailable": "336 GiB",
    "storageMaximum": "338 GiB",
    "storageScheduled": "57 GiB",
    "allowScheduling": true,
    "evictionRequested": false,
    "path": "/var/lib/harvester/defaultdisk",
    "storageReserved": "101 GiB",
    "tags": [
      "main-bottom"
    ],
    "name": "default-disk-6c6808403dbb7009",
    "isNew": false,
    "displayName": "default-disk-6c6808403dbb7009",
    "forceFormatted": false
  }
]
Workaround

adding a tag(s) to the extra disk then allows the extra disk to have information displayed on:
https://github.com/harvester/dashboard/blob/master/pkg/harvester/detail/harvesterhci.io.host/HarvesterHostDisk.vue
(though as noted earlier, by default, the main disk will display information regardless of tags, whereas added disks do not)

Duplicate issue #3242: [BUG] Second host storage disk does not show in UI details
Created: 2022-12-06T01:37:31Z
Describe the bug
Added a second storage disk to a host and doesn't appear in the UI detail page:

It does appear in the config view:

Developer tools shows the following JS error in the console:
TypeError: e.value.tags is undefined
    Y HarvesterHostDisk.vue:1
    VueJS 40
    t index.vue:106
    u runtime.js:45
    n runtime.js:274
    t runtime.js:97
    Ee harvester-v1.1.1.umd.min.detail.js:1
    o harvester-v1.1.1.umd.min.detail.js:1
    promise callback*Ee harvester-v1.1.1.umd.min.detail.js:1
    o harvester-v1.1.1.umd.min.detail.js:1
    Re harvester-v1.1.1.umd.min.detail.js:1
    Re harvester-v1.1.1.umd.min.detail.js:1
    fetch index.vue:50
    e NuxtJS
    u runtime.js:45
    n runtime.js:274
    t runtime.js:97
    Babel 4
    NuxtJS 3
    VueJS 13
console.js:31:30
    e console.js:31
    VueJS 43
    t index.vue:106
    u runtime.js:45
    n runtime.js:274
    t runtime.js:97
    Ee harvester-v1.1.1.umd.min.detail.js:1
    o harvester-v1.1.1.umd.min.detail.js:1
    (Async: promise callback)
    Ee harvester-v1.1.1.umd.min.detail.js:1
    o harvester-v1.1.1.umd.min.detail.js:1
    Re harvester-v1.1.1.umd.min.detail.js:1
    Re harvester-v1.1.1.umd.min.detail.js:1
    fetch index.vue:50
    e NuxtJS
    u runtime.js:45
    n runtime.js:274
    t runtime.js:97
    Babel 4
    NuxtJS 3
    VueJS 13

To Reproduce
Steps to reproduce the behavior:

Launch a new Harvester environment with at least one host and a host with at least two physical disks
Add the second disk to the host in the Harvester UI

Expected behavior
Expect to see the second storage disk in the detail UI.
Support bundle
NA
Environment

Harvester ISO version: v1.1.1 (can also reproduce on v1.1.0)
Underlying Infrastructure (e.g. Baremetal with Dell PowerEdge R630): Equinix m3.small.x86

Closing comment (2022-12-06T01:55:59Z): @dnoland1
Thanks for opening this 😄  -
This seems to be similar to:
#2990
It seems, that it stays that way unless disk-tags are added to the disk.
Do you notice that if you add disk-tags to the second disk, that the disk then displays in the UI?