Skip to content

feat(ui): DrainModal should warn when target node has insufficient capacity #157

Description

@Anhydrite

Problem

The DrainModal component in ClusterResources.jsx does not check or warn the user when the selected target node has insufficient capacity to accept the drained VMs.

Current behavior:

  • Dropdown filters nodes by status === 'online' only
  • Shows VM count per node but NOT available capacity
  • No warning or prevention when target cannot hold all source VMs

Current Code

File: /root/AnhyWhere/web/src/pages/admin/ClusterResources.jsx (lines 665-746)

The DrainModal:

  • Lists available nodes filtered by online status
  • Displays node name and VM count
  • Does NOT fetch or display CPU/RAM/disk capacity
  • Does NOT compare source VMs total resources vs target available

Expected Behavior

  1. Fetch target node capacity data (CPU, RAM, disk) when modal opens
  2. Calculate total resources of VMs on the source node
  3. Display comparison:
    • Source: 4 CPU, 8192 MB RAM, 100 GB disk (3 VMs)
    • Target: 2 CPU available, 4096 MB RAM available, 50 GB disk available
  4. Show warning banner if target cannot hold all VMs
  5. Disable Start

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions