Leaseweb Warm Server Pool INTERNAL PLAN

Drafted: 2026-03-19  ·  Author: Neo  ·  Status: Ready to Build
4.4×
margin improvement from day one  ·  $1,800/mo → $7,950/mo at current sales volume

The Problem

The Idea

  1. Background system orders Leaseweb VPS servers in advance
  2. Servers get fully provisioned with OpenClaw base stack while idle
  3. User orders → pull warm server from pool, inject their config, deliver in 20–30 seconds
  4. Pool replenishment runs automatically to maintain minimum inventory per region/size
  5. Browser automation handles ordering until reseller API ready → one-function swap, no other changes

Architecture

┌──────────────────────────────────────────────────────┐ │ USER ORDER FLOW │ │ xCloud checkout → PoolManager::assign() → deliver │ │ (20–30 seconds, server already warm) │ └──────────────────────────────────────────────────────┘ ↓ triggers ┌──────────────────────────────────────────────────────┐ │ POOL REPLENISHMENT │ │ PoolReplenisher → order via browser/API │ │ → wait for Leaseweb delivery (5–50 min) │ │ → ServerWarmer provisions base stack │ │ → marks server as WARM in pool │ └──────────────────────────────────────────────────────┘

Why This Is Viable

ConcernAssessment
Browser automation fragilityTemporary bridge only — swap to API when ready. Portal ordering UI rarely changes.
Leaseweb provisioning timeAbsorbed by pre-warming. User never sees it.
Pool cost (idle servers)3 warm VPS1 = $10.50/mo idle. Covered by the first sale.
20–30s delivery claimSSH in + inject config only. No package installs. Already proven in xCloud pipeline.
Pool depletion on demand spikeLow-watermark alerts + configurable min. Vultr handles overflow transparently.
Reseller account limitsConfirm max concurrent orders with Aziz before go-live.

Components

1. Database — leaseweb_server_pool

id
region          -- 'us-east-1', 'sin-01', etc.
size            -- 'VPS02_1' (4vCPU/6GB), 'VPS02_2', etc.
status          -- ordering | provisioning | warming | warm | assigned | failed
leaseweb_id     -- VPS ID from Leaseweb (once delivered)
ip_address
root_password   -- encrypted
ssh_key_id
ordered_at
warmed_at
assigned_at
assigned_to     -- xCloud server_id
notes

2. PoolManager Service (Laravel)

PoolManager::getWarm(region, size)        // atomic find + lock warm server
PoolManager::assign(poolServer, xServer)  // mark assigned, link to xCloud server
PoolManager::getInventory()               // counts per region/size/status
PoolManager::needsReplenishment()         // compare against thresholds

3. PoolReplenisher Job (Queue Worker)

Runs every 5 minutes OR triggered on each assignment:

  1. For each region/size combo → check pool count vs minimum threshold
  2. If below minimum → dispatch OrderLeasewebServer job
  3. Triggers browser automation → places order
  4. Poll Leaseweb until server is ACTIVE (max 90 min)
  5. Once active → dispatch WarmServer job

4. LeasewebPortalOrderer — Playwright (temporary bridge)

// scripts/leaseweb/order-vps.js
const { chromium } = require('playwright');

async function orderVPS({ region, size, credentials }) {
    const browser = await chromium.launch({ headless: true });
    const page = await browser.newPage();

    await page.goto('https://my.leaseweb.com/login');
    await page.fill('#username', credentials.email);
    await page.fill('#password', credentials.password);
    await page.click('[type=submit]');
    // Handle 2FA via stored TOTP secret...

    await page.goto('https://my.leaseweb.com/order/vps');
    await page.selectOption('[name=location]', region);
    await page.click(`[data-plan="${size}"]`);
    await page.selectOption('[name=os]', 'Ubuntu 22.04');
    await page.click('[data-term="1_MONTH"]');
    await page.click('[data-action=confirm-order]');

    const vpsId = await page.textContent('[data-vps-id]');
    await browser.close();
    return { vpsId, orderedAt: new Date().toISOString() };
}
When reseller API is ready → replace orderVPS() with a single API call. Zero other changes.

5. ServerWarmer — Base Provisioning Script

# Base system
apt-get update && apt-get upgrade -y
apt-get install -y curl wget git unzip nginx

# Node.js 22 LTS
curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
apt-get install -y nodejs

# OpenClaw CLI
npm install -g openclaw@latest

# Directory structure
mkdir -p /root/.openclaw/workspace /root/.openclaw/credentials /var/log/openclaw
chmod 700 /root/.openclaw

# Mark warm
touch /root/.openclaw/.warm_ready
echo "WARM_TIMESTAMP=$(date -u +%s)" >> /root/.openclaw/.env

Estimated: 5–8 minutes after Leaseweb delivers the VPS. Runs in background, user never sees it.

6. PoolDeliverer — The Fast Path (20–30 seconds)

  1. PoolManager::getWarm(region, size) → reserve server atomically (<1ms)
  2. SSH in to warm server
  3. Inject user config (gateway token, AI provider key, Telegram token)
  4. Run openclaw gateway install --port 18789 --token $TOKEN --force
  5. Configure nginx vhost for xCloud site name
  6. Run existing OpenClaw onboarding partials (already tested)
  7. Return: IP, gateway token, control UI URL → xCloud marks server ACTIVE
  8. Dispatch PoolReplenisher to order replacement

Pool Configuration (Demand-Based)

// config/leaseweb_pool.php
return [
    'pools' => [
        ['region' => 'us-east-1',    'size' => 'VPS02_1', 'min' => 3, 'max' => 6],  // highest demand
        ['region' => 'us-west-1',    'size' => 'VPS02_1', 'min' => 2, 'max' => 4],
        ['region' => 'eu-west-3',    'size' => 'VPS02_1', 'min' => 2, 'max' => 4],  // Amsterdam
        ['region' => 'eu-central-1', 'size' => 'VPS02_1', 'min' => 1, 'max' => 3],  // Frankfurt
        ['region' => 'sin-01',       'size' => 'VPS02_1', 'min' => 1, 'max' => 3],  // Singapore
        ['region' => 'au-1',         'size' => 'VPS02_1', 'min' => 1, 'max' => 2],
        // Larger sizes — lower demand, 1 warm per key region
        ['region' => 'us-east-1',    'size' => 'VPS02_2', 'min' => 1, 'max' => 2],
        ['region' => 'eu-west-3',    'size' => 'VPS02_2', 'min' => 1, 'max' => 2],
    ],
];

Initial idle cost: ~12 warm servers × $3.50/mo avg = ~$42/mo. Single sale covers it.

Margin Math

Vultr (current)Leaseweb (proposed)
VPS1 cost (4vCPU/6GB)~$24/mo$3.50/mo
xCloud sell price~$30/mo~$30/mo
Gross margin$6/mo (~20%)$26.50/mo (~88%)
At 10 sales/day × 30 days$1,800/mo$7,950/mo

Fallback: No Warm Server Available

Migration Path

1
Build pool system + browser automationDB migration, PoolManager, Playwright orderer, ServerWarmer
2
Shadow modePool builds up silently — Vultr still fulfills all orders. Zero risk.
3
Enable pool delivery for US + EUHighest demand + savings. Validate 20–30s delivery claim.
4
All regions — Vultr becomes fallback only
5
Swap browser automation → reseller APIOne function replacement when Leaseweb delivers.
6
Decommission Vultr for OpenClaw entirely

Phase 1→3 target: 2 weeks.

Implementation Checklist

Backend (Laravel)

Browser Automation

Provisioning Scripts

xCloud UI

Open Questions for Aziz / Leaseweb

  1. Reseller API ETA — rough timeline?
  2. Max concurrent VPS orders — any rate limits on reseller account?
  3. Root credentials delivery — email? API endpoint after order?
  4. Support SLA — recovery path if VPS fails to provision?
  5. Billing model — monthly commitment or hourly? (Impacts pool rotation cost)

Risks

RiskLikelihoodImpactMitigation
Portal UI change breaks automationMediumMediumFall back to Vultr; fix within hours
Leaseweb delivery >2hLowLowPool absorbs it; user never sees it
2FA blocks automationLowHighTOTP stored secret; or request portal API key auth
Reseller limits block bulk orderingLowMediumPre-clear with Aziz
Pool over-allocatedLowLowSet max thresholds; auto-expire after 30 days

Next Steps

  1. Nobin: Confirm with Aziz — root credentials delivery method + max concurrent orders
  2. Neo: Start Phase 1 — DB migration + PoolManager + browser automation
  3. Shadow mode — pool builds while Vultr still delivers
  4. First pool delivery → validate 20–30s claim
  5. Flip switch for US region