# Complete Quota Analysis and Solutions

## Current Quota Status

### vCPU Quota
- **Total Limit**: 10 vCPUs
- **Currently Used**: 10 vCPUs (all quota consumed)
- **Available**: 0 vCPUs
- **System Nodes**: 3 × Standard_D2s_v3 = 6 vCPUs
- **Other Usage**: 4 vCPUs (likely other resources or temporary holds)

## AKS VM Size Restrictions

### Restricted Sizes
- ❌ **Standard_B1s**: 1 vCPU, 1GB RAM - Too small
- ❌ **Standard_B1ms**: 1 vCPU, 2GB RAM - Too small
- ⚠️ **Standard_B2s**: 2 vCPUs, 4GB RAM - AKS-compatible but quota exhausted

### Allowed Sizes (When Quota Available)
- ✅ **Standard_B2s**: 2 vCPUs, 4GB RAM - Minimum for AKS
- ✅ **Standard_B2ms**: 2 vCPUs, 8GB RAM - Better performance
- ✅ **Standard_D2s_v3**: 2 vCPUs, 8GB RAM - Production recommended

## Solutions

### Solution 1: Deploy as Pods (No Quota Needed) ✅ RECOMMENDED
Deploy Besu validators as Kubernetes pods on existing system nodes:

**Advantages**:
- No additional quota needed
- Can deploy immediately
- Uses existing node capacity
- Cost-effective (no new VMs)

**Implementation**:
```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: besu-validator
  namespace: besu-network
spec:
  replicas: 1
  selector:
    matchLabels:
      app: besu-validator
  template:
    metadata:
      labels:
        app: besu-validator
    spec:
      nodeSelector:
        pool: system  # Use existing system nodes
      containers:
      - name: besu
        image: hyperledger/besu:latest
        resources:
          requests:
            cpu: 500m
            memory: 2Gi
          limits:
            cpu: 1000m
            memory: 4Gi
```

### Solution 2: Request Quota Increase
Request additional vCPUs from Azure:

**Steps**:
1. Check current quota: `az vm list-usage --location westeurope`
2. Request increase via Azure Portal
3. Wait for approval (typically 24-48 hours)
4. Deploy new node pool after quota increase

**Recommended Request**:
- Request 2-4 additional vCPUs
- Allows deployment of 1-2 validator nodes
- Provides buffer for future scaling

### Solution 3: Use Different Region
Deploy to a region with available quota:

**Considerations**:
- Data sovereignty requirements
- Latency implications
- Cost differences
- Region availability

## Recommended Approach

### Immediate (No Quota Needed)
1. **Deploy Besu validators as pods on existing nodes**
   - Uses existing 6 vCPUs from system nodes
   - No additional quota required
   - Can deploy immediately

2. **Deploy monitoring stack**
   - Prometheus and Grafana as pods
   - Lightweight, runs on existing nodes

### Short-term (Request Quota Increase)
1. **Request vCPU quota increase**
   - Request 2-4 additional vCPUs
   - Enables dedicated validator node pool

2. **Deploy validator node pool**
   - 1-2 nodes × Standard_B2s (2 vCPUs each)
   - Dedicated resources for validators

### Long-term (Optimize Configuration)
1. **Scale up after validation**
   - Upgrade to Standard_B2ms or Standard_D2s_v3
   - Add more validators for fault tolerance
   - Deploy sentries and RPC nodes

## Configuration Summary

### Current Configuration
- **System**: 3 × Standard_D2s_v3 (2 vCPUs, 8GB RAM) = 6 vCPUs
- **Quota Used**: 10/10 vCPUs (100%)
- **Available**: 0 vCPUs

### Proposed Configuration (Pods)
- **System**: 3 × Standard_D2s_v3 (2 vCPUs, 8GB RAM) = 6 vCPUs
- **Besu Validators**: 1-2 pods on system nodes (0 additional quota)
- **Total**: 6 vCPUs (within 10 limit)

### Proposed Configuration (After Quota Increase)
- **System**: 3 × Standard_D2s_v3 (2 vCPUs, 8GB RAM) = 6 vCPUs
- **Validators**: 1-2 × Standard_B2s (2 vCPUs, 4GB RAM) = 2-4 vCPUs
- **Total**: 8-10 vCPUs (within 12-14 limit after increase)

## Next Steps

1. ✅ Review quotas - Complete
2. ✅ Identify AKS-compatible VM sizes - Complete
3. ✅ Update configuration - Complete
4. ⏳ Deploy validators as pods (immediate)
5. ⏳ Request quota increase (for dedicated nodes)
6. ⏳ Deploy node pool after quota approval
