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

DiskLayout return empty array for some VPS on Ubuntu 22.04 LTS #919

Open
NodeFarmer opened this issue Jul 3, 2024 · 0 comments
Open

DiskLayout return empty array for some VPS on Ubuntu 22.04 LTS #919

NodeFarmer opened this issue Jul 3, 2024 · 0 comments

Comments

@NodeFarmer
Copy link

Describe the bug
On some VPS from specific providers (eg. Racknerd), the DiskLayout function won't pass the following filter :
devices = outJSON.blockdevices.filter(item => { return (item.type === 'disk') && item.size > 0 && (item.model !== null || (item.mountpoint === null && item.label === null && item.fstype === null && item.parttype === null && item.path && item.path.indexOf('/ram') !== 0 && item.path.indexOf('/loop') !== 0 && item['disc-max'] && item['disc-max'] !== 0)); });

Indeed, for some VPS, model is empty and disc-max = 0

To Reproduce
Steps to reproduce the behavior:

  1. used function 'DiskLayout'
  2. code snippet :
    devices = outJSON.blockdevices.filter(item => { return (item.type === 'disk') && item.size > 0 && (item.model !== null || (item.mountpoint === null && item.label === null && item.fstype === null && item.parttype === null && item.path && item.path.indexOf('/ram') !== 0 && item.path.indexOf('/loop') !== 0 && item['disc-max'] && item['disc-max'] !== 0)); });
  3. start app / code
  4. See output/error :
    empty array []

Expected behavior
Virtual disk with no model or disc-max with 0 should be listed

Environment (please complete the following information):

  • systeminformation package version: 5.22.11

  • OS:
    Platform : linux
    Distro : Ubuntu
    Release : 22.04.4 LTS
    Codename : jammy
    Kernel : 5.15.0-113-generic
    Arch : x64
    Hostname : racknerd-e6d31ce
    Codepage : UTF-8
    Build :

  • Hardware : VPS
    Manufacturer : Red Hat
    Model : KVM
    Version : RHEL 7.6.0 PC (i440FX + PIIX, 1996)
    Virtual : true
    VirtualHost : KVM

Additional context
Here is the result of following command on this VPS for vda disk that should be listed :
export LC_ALL=C; lsblk -ablJO 2>/dev/null; unset LC_ALL

{
"name": "vda",
"kname": "vda",
"path": "/dev/vda",
"maj:min": "252:0",
"fsavail": null,
"fssize": null,
"fstype": null,
"fsused": null,
"fsuse%": null,
"fsroots": [
null
],
"fsver": null,
"mountpoint": null,
"mountpoints": [
null
],
"label": null,
"uuid": null,
"ptuuid": "48791ef7-02bb-4e82-9b4f-c54cc3d49f2e",
"pttype": "gpt",
"parttype": null,
"parttypename": null,
"partlabel": null,
"partuuid": null,
"partflags": null,
"ra": 128,
"ro": false,
"rm": false,
"hotplug": false,
"model": null,
"serial": null,
"size": 32212254720,
"state": null,
"owner": "root",
"group": "disk",
"mode": "brw-rw----",
"alignment": 0,
"min-io": 512,
"opt-io": 0,
"phy-sec": 512,
"log-sec": 512,
"rota": true,
"sched": "mq-deadline",
"rq-size": 256,
"type": "disk",
"disc-aln": 0,
"disc-gran": 0,
"disc-max": 0,
"disc-zero": false,
"wsame": 0,
"wwn": null,
"rand": false,
"pkname": null,
"hctl": null,
"tran": null,
"subsystems": "block:virtio:pci",
"rev": null,
"vendor": "0x1af4",
"zoned": "none",
"dax": false
},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant