Maintenance & modifications
Every change to a pool, whether the client, a staff member or the system asks for it, goes through one path: a change row, a guarded job, an AWS or licence-provider call, and an applied row. Billable changes move the billing timeline; sites and licence tiers are logged but never billed.
States
stateDiagram-v2 [*] --> queued: order, Stripe risk normal [*] --> pending_review: order, Stripe risk elevated or highest pending_review --> queued: staff approve pending_review --> rejected: staff reject or 7 days without a decision rejected --> [*] queued --> provisioning: job starts provisioning --> active: step 20 activate provisioning --> failed: max exceptions failed --> provisioning: resume command failed --> terminating: abort command active --> suspended: unpaid invoice or staff request suspended --> active: paid or staff request active --> cancellation_pending: cancel request cancellation_pending --> active: cancel_termination (inside window) cancellation_pending --> terminating: due date / abort window passed terminating --> closing_account: instance gone, final invoice closing_account --> closed: CloseAccount succeeded closed --> [*]
Instance state (running, stopped, rebooting) is separate from these lifecycle states and is read live from EC2; the cached copy in dedicated_instances.instance_state only serves list pages.
Sites on the pool
One product, two kinds of parent
A pool site is a Rochen One Site (466) whose parent_id is the pool. Dedicated::ownsSite() (a 466 whose parent is product 464) is asked wherever the code assumes the parent is the Shared plan.
Create
The order carries {product: 466, parentId: pool}. The Shared store sees the parent is a pool and hands over to Dedicated::storeSite(): server = the pool's own row, limits and quota into custom fields, no ResourceLevel option row, no change to any plan's options, no billing-log row, no trial credit. Deployment uses a seam extracted from the Shared deploy (today's is tier-only and always logs): same account creation, adopt rule, DNS, quota, Softaculous and mail set-up, with limits passed straight to applyLVELimits and a pool-site "ready" mail.
Resource limits, free
The Server Resources picker offers Tier 1–8 presets and custom values for speed, pmem, io, iops, ep, nproc. Either way the values are applied on the pool and stored in the site's custom fields. Changes are logged on the site and never billed.
Manage like Shared
Details, resources, disk, PHP, mail, databases, monitoring and delete work as for a shared site because the product and server type are the same. Update and delete skip the plan-option maths and the billing log when the parent is a pool. The weekly disk refresh already covers 466 rows on any server.
Only while the pool is active
Creating, changing or deleting a site is refused (409) unless the pool is Active. A site's own suspend or delete from the app still works per site.
Children follow the parent
Suspending, unsuspending, cancelling or terminating the pool does the same to every site row in the same transaction. Sites the client had suspended individually stay suspended when the pool comes back.
Licence tiers
RetierDedicatedLicencesJob counts the live Rochen One Site services whose parent is the pool, applies the rules in config/dedicated.php (cPanel by accounts; Imunify360 by accounts; LiteSpeed by instance size and accounts; CloudLinux, KernelCare, JetBackup, MailChannels fixed), and changes the provider package or key limit when the tier differs from dedicated_instances.licences.
| Trigger | Direction | What happens |
|---|---|---|
Site created, or the daily dedicated:retier-licences reconcile finds a mismatch | up | at once: Manage2 change package / CLN update key limit; tracking options and licences json updated; change_licence row (not billable) |
| Site deleted | down | only after 24 hours below the threshold, to avoid flapping |
| Template applied (resize) | either | LiteSpeed re-evaluated for the new instance size |
| Provider call fails | — | row failed, retried next day; Maintenance ticket after 3 failures. LiteSpeed changes open a ticket until an API is confirmed |
| Daily reconcile finds cPanel accounts on the server that are not app rows | — | Maintenance ticket; tiers follow the app rows |
Endpoints
| Call | Payload | Handled by | Notes |
|---|---|---|---|
PATCH /v1/hosting/{id} | {template} or {diskSize: [{device, size, iops, throughput, mountPoint}]} | Dedicated::updateHosting() | same payloads the AWS server pages already send, so servers/[id]/resources and /disk work unchanged |
PATCH /v1/hosting-configuration/{id} | {command: reboot_server | start_server | stop_server} | DedicatedConfigurationController | synchronous EC2 calls; each writes a change row |
PATCH /v1/hosting-configuration/{id} | {command: cancel_termination} | same | allowed only while cancellation_pending |
GET /v1/hosting-configuration/{id}?command=state | — | existing | live EC2 state, polled by the details card |
GET …?command=provisioning | — | new | plan progress while queued / provisioning / terminating |
GET …?command=history | — | new | the change log, newest first, paginated |
GET …?command=licences | — | new | current tier per software, the account count that drives it, and when it was last checked |
GET …?command=sites | — | new | the sites on the pool with their limits |
HostingPolicy refuses update and upgrade while DedicatedInstance::inFlightFor() or DedicatedServerChange::inFlightFor() is true, the same rule the migration flow uses. Every endpoint is added to public/docs/api.html.
Jobs, guards, rollback
All jobs are unique per hosting on the dedicated queue with the lock dedicated:change:{hosting}. Each starts by moving its change row to applying and ends with applied, failed or rolled_back.
| Job | Guards | Steps | Rollback |
|---|---|---|---|
ResizeDedicatedInstanceJob | can_scale · template belongs to the pool's region group · differs from current · no change in flight · instance running or stopped | stop → wait stopped → ModifyInstanceAttribute type → start → wait running → change applied (new billing span), Templates option updated → LiteSpeed re-tier queued | modify fails → start with the old type, change rolled_back; start fails → change failed, Maintenance ticket, client mail |
ResizeDedicatedDiskJob | grow only · 6 h since the last applied resize_disk · gp3 ratio: throughput ≤ IOPS ÷ 4, IOPS ≤ 500 × GB · within the region's min/max | ModifyVolume → wait past modifying → SSM command: pvresize, lvextend, xfs_growfs /home → change applied, options updated | ModifyVolume failed → nothing changed, failed. Filesystem grow failed → the volume did grow, so the change is applied with an error and a ticket "filesystem not grown" |
| reboot · start · stop | can_reboot · instance state allows it | one EC2 call, synchronous, change row written | none needed |
RetierDedicatedLicencesJob | live count available · tier differs · 24 h hysteresis on the way down | provider change package or key limit → licences json + tracking options → change_licence row (not billable) | provider call failed → row failed, retried; nothing else changed |
RotateDedicatedKeyJob (staff only, dedicated:rotate-key) | instance running | new key pair → SSM command replaces authorized_keys → old key pair deleted → refs updated | SSM command failed → new key deleted, old kept |
Change-log rules
One row per intent
Created with status = requested and the actor (client, admin, system) before any job is dispatched, so a request that never ran is still visible.
Whole configuration
to holds the full resulting configuration, never a delta, so any row can be read on its own and the billing routine needs no replay.
Immutable once applied
applied_at is written once. Mistakes are corrected with a new reconcile row, which is how a manual AWS-side change gets recorded too.
Billable flag
Only create, resize_instance, resize_disk and terminate move the billing timeline. Reboots, key rotations and licence changes are logged but do not start a span.
Audit
Every applied or failed change also writes a tbllogs row; dedicated:show {hosting} prints configuration, plan and log for support.
Drift check
dedicated:reconcile (weekly) compares instance type, volume size, IOPS and throughput against EC2 and opens a Maintenance ticket on mismatch, replacing the legacy matchInstances mails.
Suspend, stop, reboot — and the cascade to sites
| Action | Who | Instance | Pool status | Site rows | Billing |
|---|---|---|---|---|---|
| Suspend | rochen-api for an unpaid invoice (dedicated:suspend-overdue), or a staff request from WHMCS | stopped | Suspended | all Suspended, marked as suspended by the pool | continues (type and volumes reserved) |
| Unsuspend | rochen-api on payment, or a staff request | started | Active | the ones the pool suspended return to Active; sites the client suspended themselves stay suspended | continues |
| Stop | client (can_reboot) | stopped | Active | unchanged (offline until started) | continues; the app says so next to the button |
| Start · Reboot | client | started / rebooted | Active | unchanged | continues |
| Cancel · Terminate | client, staff, or overdue policy | terminated | Terminated | all Terminated in the same transaction | final invoice |
| Review rejected | staff, or 7 days without a decision | never created | Cancelled | none exist yet | nothing billed |
The licences are untouched by suspension. Licence tiers are not recalculated while a pool is suspended.
Limits and monitoring (proposals)
Instance-size ceiling
Accounts with fewer than 3 paid months, or any overdue history, may run one pool up to m7i.xlarge; established accounts up to m7i.4xlarge; larger sizes or more pools need a staff approval recorded on the client. The store and the resize page hide sizes above the ceiling and say why. Thresholds to agree with Chris and Ben.
New pool alert
Every deployment mails devops with client, account age, fraud score, template, region and hostname, so new accounts get a human look early, as Chris asked.
Transfer and abuse alerts
dedicated:log-data-transfer opens a Maintenance ticket when a pool younger than 30 days passes 1 TB outbound in 7 days, or any pool passes 5 TB in a month; Zabbix keeps the usual host alerts. Staff can suspend from WHMCS, which stops the instance.
Credentials
Each pool's secrets live in SSM for the instance and as one item in the 1Password inbox vault for staff; the deployer can write there and nowhere else.
WHMCS: hands off, in code
WHMCS keeps showing pools and their sites as ordinary services, but never acts on them. Each automation and module entry point asks one of two helpers and steps aside; where staff press a button, WHMCS records a request that rochen-api carries out.
rochen_isDedicatedPool($packageId) (product 464) and rochen_isDedicatedSite($hostingId) (a 466 whose parent is a 464), in one include deployed before anything that calls itdedicated_server_changes with actor = admin, the admin's id and status = requested; dedicated:apply-requested-changes picks it up every minute| Where in WHMCS | What it would do to a pool or pool site today | With the skip |
|---|---|---|
includes/processinvoices.php: invoice run and upcoming-invoice reminder | zero-value line, auto-paid invoice, due date advanced; reminder mail every month | pool skipped beside the existing site skip |
includes/invoicefunctions.php: per-service step when an invoice is paid | advances the due date again, unsuspends (starts the instance), renews | nothing for a pool |
admin/cron.php: suspension, termination and cancellation-request handling; includes/overdueterminations.php | stops the instance, queues terminations, lists pools for staff | pools and pool sites excluded |
modules/servers/aws: Create, Suspend, Unsuspend, Start, Stop, terminate hook, service-save hook | calls EC2 directly or writes legacy queue rows that the old cron applies; Create could start a real legacy deployment | for a pool: record a request (suspend, unsuspend, start, stop, terminate) or do nothing (create, save), return success |
modules/servers/aws/classes/awscron.php: daily match check | mails devops about every pool as "no tracking row" | pools excluded |
modules/servers/one: Suspend, Unsuspend, Terminate, the termination queue, and the admin-save checks that write billing logs, plan options and quotas | would write Shared billing-log rows and plan options against a pool, and call the server directly | for a pool site: record a request or return early; nothing is written |
admin/clientshosting.php: service page | probes AWS for status, offers Setup / Snapshot and Generate Invoice, can assign the active server of a type | those are hidden for pools; a banner says the service is managed by the API; Approve deployment and Reject appear while the pool is under review |
Product settings
464: automatic setup off (it is still "on order" today), the links to option groups 8 and 10 removed, server group = Dedicated. 466: six new admin-only custom fields for the limits. No new product.
Templates
The admin page configdedicatedtemplates.php edits dedicated_templates; a pool's configuration itself is changed in the app or through the API.
Audit
Requests and their outcome are in the change log; each applied or failed change also writes an API log row in the shape the domain audit uses (actor, source, admin id, changes).
Not touched
The abandoned client portal, and the Fully Managed Services products, which keep using the legacy module unchanged.
In the app
Web only for buying
The pool purchase page and site creation are web flows, like every purchase in the app. The mobile apps show and manage what exists.
Site chooser
"Create Site" opens the chooser. Pools join it with their own card (no slots meter: sites are unlimited and free), and choosing one opens the pool-site form, modelled on the Twenty "add a site to a plan" page.
Pool page
Reuses the AWS server cards: details with live state and Start/Stop, the template picker, volumes, graphs. New: a provisioning card (steps, or "being reviewed by our team"), a Sites card, an Included Software card with current tiers, and History. The API marks pools with line: "dedicated"; with it the app hides Launch WHM and Launch cPanel and lists the pool's children as sites, not as software licences.
Site pages
The Shared site pages serve pool sites. When the parent is a pool the Resources page drops prices and offers custom values, the Disk page shows the pool's allocation instead of the plan's storage tiers, and the Shared price calculation no longer counts those sites.
Resize pages
servers/[id]/resources and /disk work as for MCS, with the review block stating that a template change restarts the server and when the new rate starts.
No access page
The client has no root, SSH or WHM. The pool's hosting row has null credentials; the root credentials live once, on the pool's tblservers row. The API never exposes them.