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
- Fetch target node capacity data (CPU, RAM, disk) when modal opens
- Calculate total resources of VMs on the source node
- 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
- Show warning banner if target cannot hold all VMs
- Disable Start
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:
Current Code
File: /root/AnhyWhere/web/src/pages/admin/ClusterResources.jsx (lines 665-746)
The DrainModal:
Expected Behavior