# Quota Surge Issue Resolution

## Issue

**Error**: Insufficient vCPU quota (0 available, need 2)
- **Root Cause**: AKS surge nodes consume quota during node pool creation
- **Standard_B2s**: Needs 2 vCPUs for node + 1 vCPU for surge = 3 vCPUs total during creation
- **Available**: 4 vCPUs (should be enough, but surge consumes extra)

## Solution Applied

### Use maxUnavailable Instead of maxSurge
```hcl
upgrade_settings {
  max_surge = "0"  # No surge nodes, prevents quota consumption
}
```

### Benefits
- **No surge nodes**: Eliminates extra quota consumption
- **Deployment uses existing nodes**: No additional quota needed during creation
- **Fits quota**: 2 vCPUs needed (within 4 available)

## Configuration

### Validator Node Pool
- **Count**: 1 node
- **VM Size**: Standard_B2s (2 vCPUs, 4GB RAM)
- **Surge**: 0 (max_surge = 0)
- **Total vCPUs**: 2 (no surge overhead)

### Resource Allocation
- **System**: 3 × Standard_D2s_v3 = 6 vCPUs
- **Validators**: 1 × Standard_B2s = 2 vCPUs
- **Total**: 8 vCPUs (within 10 limit) ✅

## Alternative Solutions

### Option 1: Wait for Quota to Clear
- If temporary quota hold, wait and retry
- Check for ongoing deployments consuming quota

### Option 2: Request Quota Increase
- Request 2 more vCPUs (total 12)
- Allows surge nodes and more flexibility

### Option 3: Deploy as Pods (No New Nodes)
- Deploy Besu validators as pods on existing system nodes
- No additional quota needed
- Use node selectors to prefer system nodes

## References

- [AKS maxSurge and maxUnavailable](https://aka.ms/aks/maxUnavailable)
- [AKS Node Pool Upgrade Settings](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-settings)
