Skip to content

Add Disk Usage to the VM ranking panel - #875

Open
traviswu-bigstack wants to merge 2 commits into
developfrom
travis.wu/vm-disk-usage-ranking
Open

traviswu-bigstack wants to merge 2 commits into
developfrom
travis.wu/vm-disk-usage-ranking

Conversation

@traviswu-bigstack

Copy link
Copy Markdown
Contributor

What type of PR is this?

/kind feature

What this PR does / why we need it

Adds a fourth option to the VM ranking panel on /home/chart: Disk Usage, ranking VMs by bytes allocated in the storage pool. The card previously offered CPU, Memory and disk I/O, but nothing about how much space a VM actually occupies — the top-line ask from the customer request behind bigstack-oss/cubecos#1449.

Labelled "Disk Usage" rather than "Storage Usage" because it sits beside "Cpu Usage" and "Memory Usage", where the user is picking a resource, not an API metric name.

Which issue(s) this PR fixes

Part of bigstack-oss/cubecos#1449. Needs bigstack-oss/cube-cos-api#663 (serves storageUsage) and bigstack-oss/cube-cos-openapi#115 (the enum).

Special notes for your reviewer

The SDK diff is generated, not hand-written — pnpm api:generate against the bumped spec submodule. Worth knowing that the metric type enum appears twice in the generated client, GetMetricByHostOrVmMetricTypeEnum and GetMetricByTypesMetricTypeEnum. Editing only one of them still type-checks, which is a quiet way to leave the other caller unable to name the value; regenerating keeps both in step.

Verified on a live single-node cluster: the dropdown offers Disk Usage and the panel renders eight VMs with sparklines. Note this panel was previously blank for every metric on that cluster — cube-cos-api was querying the retired monasca database — so it is worth re-checking against a cluster that has bigstack-oss/cube-cos-api#663.

Additional documentation


Adds a fourth VM ranking option: per-VM bytes allocated in the storage pool,
served by the storageUsage metric type (cube-cos-api#663).

Labelled "Disk Usage" rather than "Storage Usage" because it sits beside Cpu
Usage and Memory Usage, where the user is picking a resource, not an API
metric name.

The SDK is regenerated from the spec submodule rather than hand-edited. The
enum appears twice in the generated client -- GetMetricByHostOrVm and
GetMetricByTypes -- and editing one of them by hand type-checks while leaving
the other caller unable to name the value.

Signed-off-by: Travis Wu <travis.wu@bigstack.co>
@traviswu-bigstack

Copy link
Copy Markdown
Contributor Author

Build / Check are red for a pre-existing reason, not this change

Both fail on 12 TS2741: Property 'deviceProfile' is missing errors in src/mocks/gpu.ts — no file this PR touches.

The cause is that this repo's spec submodule was pinned at a34418d, several commits behind the spec's own develop. Picking up storageUsage means moving the pin forward, which also picks up feat(gpu): document a pgpu card's device profile — and the GPU mocks here were never updated for it.

I verified this is drift rather than anything in this PR: bumping the submodule to the spec's develop tip without my commit and regenerating produces the same 12 errors. develop here has no deviceProfile in those mocks at all.

So it needs a separate fix — adding deviceProfile to the twelve GPU mock objects — which belongs with the GPU feature, not inside a storage PR. Happy to file it as its own issue if that's useful. Until then this PR stays draft; it already depends on bigstack-oss/cube-cos-api#663 and bigstack-oss/cube-cos-openapi#115 landing first.

The mocks predate deviceProfile, so moving the spec submodule forward at all
failed the build with twelve TS2741 errors in src/mocks/gpu.ts. Unrelated to
the metric type this branch adds -- the same twelve appear on the spec's
develop tip without it.

Only a pgpu card names a Cyborg device profile; sriovVgpu and migBackedVgpu
are scheduled through the PCI alias on each of their profiles, so those and
unset cards are null. One of the three pgpu cards is left null as well, which
is the documented state of a card whose profile has not been created yet or
could not be looked up.

Signed-off-by: Travis Wu <travis.wu@bigstack.co>
@traviswu-bigstack
traviswu-bigstack marked this pull request as ready for review September 16, 2026 06:23
@traviswu-bigstack
traviswu-bigstack requested a review from a team as a code owner September 16, 2026 06:23
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

Successfully merging this pull request may close these issues.

1 participant