Quick Installation
- Purchase the module and download
haikhavan_cloud_iaas-ioncube-8.2-1.0.0-install.zipfrom your VPSrv Client Area Downloads. - Upload and extract the ZIP into your WHMCS root directory so files land in
modules/addons/haikhavan_cloud_iaas/andmodules/servers/haikhavan_cloud_iaas/. - Verify PHP 8.2–8.4 with ionCube PHP Loader 14+ / 15.5+ is enabled on your server.
- Go to System Settings → Addon Modules in WHMCS Admin, click Activate next to Haikhavan Multi-Cloud IaaS & VPS Orchestrator, and assign administrator role access.
Version: 1.0.0
Compatibility: WHMCS 9.1.2+ (also compatible with 8.10+ / 9.x)
PHP Version: PHP 8.1 – 8.3
Module Type: Unified WHMCS Server Module (modules/servers/haikhavan_cloud_iaas) + Companion Addon (modules/addons/haikhavan_cloud_iaas)
Haikhavan Multi-Cloud IaaS & VPS Orchestrator (haikhavan_cloud_iaas) — Technical Documentation
Engineering specification for Haikhavan Multi-Cloud IaaS & VPS Orchestrator v1.0.0 (WHMCS Server Module + Companion Addon).
1. Dual-Module Architecture
Both the Server Module (modules/servers/haikhavan_cloud_iaas/haikhavan_cloud_iaas.php) and Companion Addon (modules/addons/haikhavan_cloud_iaas/) share a single autoloaded Haikhavan\CloudIaas\ library under modules/addons/haikhavan_cloud_iaas/lib/:
modules/
├── servers/haikhavan_cloud_iaas/
│ ├── haikhavan_cloud_iaas.php # All 11 WHMCS Server Module callbacks + 6 Admin Custom Button handlers
│ ├── whmcs.json # type: whmcs-servers manifest
│ └── templates/clientarea.tpl # Embedded Client Area overview card on productdetails
└── addons/haikhavan_cloud_iaas/
├── haikhavan_cloud_iaas.php # Addon lifecycle callbacks
├── hooks.php # 5 WHMCS hooks (Navbar, Sidebar, AdminServicesTab, AdminHomeWidgets, DailyCronJob)
├── whmcs.json # type: whmcs-addons manifest
├── lib/
│ ├── Database.php # 8 mod_hk_cloud_* tables, AES-256-CBC+HMAC vault, plan/region/OS catalogs, audit logger
│ ├── CloudOrchestrator.php # Provisioning, power, rebuild, resize, snapshots, firewall, SSH keys, Floating IPs, FinOps Margin Comparator, Idle Detector & Spend Guardrails
│ ├── AdminController.php # Admin dashboard/instance renderer & CSRF-protected JSON AJAX API
│ ├── ClientController.php # Client overview/manage renderer & ownership-verified CSRF-protected JSON AJAX API
│ └── Drivers/
│ ├── CloudDriverInterface.php # 13-method typed driver interface
│ ├── AbstractCloudDriver.php # Shared cURL transport, vault decryption & 24h telemetry builder
│ ├── DriverFactory.php # 8-driver registry & wholesale rate lookup
│ ├── LocalSandboxDriver.php # Local Multi-Cloud Sandbox Simulator
│ ├── HetznerCloudDriver.php # Hetzner Cloud REST API v1
│ ├── DigitalOceanDriver.php # DigitalOcean Droplets API v2
│ ├── VultrDriver.php # Vultr Cloud Compute API v2
│ ├── AwsEc2Driver.php # AWS EC2 / Lightsail with native AWS Signature Version 4 (zero SDK)
│ ├── OvhCloudDriver.php # OVHcloud Public Cloud API v1
│ └── OpenStackSolusDriver.php # OpenStack Nova/Keystone v3 & SolusVM 2 REST API v1
├── templates/
│ ├── admin/{dashboard.php, instance.php}
│ └── client/{overview.tpl, manage.tpl}
└── assets/
├── css/haikhavan_cloud_iaas.css
└── js/haikhavan_cloud_iaas.js # Zero-CDN ES6 controller + Canvas Margin Bar & 24h Live Telemetry Line Charts
2. Database Schema (mod_hk_cloud_*)
mod_hk_cloud_providers— Encrypted provider vault (id,name,driver_type,endpoint_url,region_default,credentials_encrypted,is_default,status,last_test_*, timestamps).mod_hk_cloud_instances— Cloud compute instances (id,userid,serviceid,provider_id,remote_id,hostname,region,plan_slug,vcpu,ram_mb,disk_gb,os_image,ipv4,ipv6,power_state,cloud_init_script,backups_enabled,wholesale_monthly_usd,retail_monthly_usd,monthly_budget_cap_usd,avg_cpu_24h,avg_net_mbps_24h,is_idle_flagged,last_metrics_json, timestamps).mod_hk_cloud_snapshots— Snapshots & backups (id,instance_id,remote_snapshot_id,label,snap_type,size_gb,monthly_cost_usd,status,created_at).mod_hk_cloud_firewall_rules— Inbound/outbound Cloud Firewall rules (id,instance_id,direction,protocol,port_range,source_cidr,action,description,created_at).mod_hk_cloud_ssh_keys— Client SSH public key vault (id,userid,name,fingerprint[SHA-256],public_key,created_at).mod_hk_cloud_floating_ips— Floating/Reserved IP pool (id,userid,provider_id,instance_idnullable for unattached/orphaned detection,ip_addressUNIQUE,region,monthly_cost_usd,status,created_at).mod_hk_cloud_spend_alerts— Spend guardrail alerts (id,userid,instance_id,threshold_usd,current_spend_usd,severity[warning|critical],message,acknowledged,created_at).mod_hk_cloud_audit_log— Full provisioning, power, firewall & rebuild audit trail.
3. WHMCS Server Module Callbacks (modules/servers/haikhavan_cloud_iaas/haikhavan_cloud_iaas.php)
haikhavan_cloud_iaas_MetaData()— Declares API v1.1, SSL port 443, and SSO labels.haikhavan_cloud_iaas_ConfigOptions()— 10 product configuration options (Driver, Region, Tier, OS Image, Max Snapshots, Spend Cap, Firewall/FIP/Backup toggles, Cloud-Init User-Data).haikhavan_cloud_iaas_TestConnection()— Tests default cloud driver connectivity.haikhavan_cloud_iaas_CreateAccount()— Deploys VM viaCloudOrchestrator::provisionInstance()and writesdedicatedipback totblhosting.haikhavan_cloud_iaas_SuspendAccount()/UnsuspendAccount()/TerminateAccount()— Full billing lifecycle automation.haikhavan_cloud_iaas_ChangePackage()— Performs vertical compute tier resize (vcpu,ram_mb,disk_gb, wholesale/retail pricing).haikhavan_cloud_iaas_AdminCustomButtonArray()— Exposes Start, Graceful Stop, Reboot, Hard Reset, Take Snapshot, and Sync Telemetry in WHMCS Admin Service view.haikhavan_cloud_iaas_UsageUpdate()— Syncs disk/bandwidth usage totblhostingand evaluates spend guardrails.haikhavan_cloud_iaas_ClientArea()— Embeds live server status and Cloud Control Panel launcher insideclientareaproductdetails.
4. Security Architecture
- AES-256-CBC + HMAC-SHA256 Vault: All cloud API tokens and AWS keys are encrypted at rest with Encrypt-then-MAC derived from WHMCS
$cc_encryption_hashand verified in constant time withhash_equals(). - CSRF Enforcement: Separate Admin (
$_SESSION['hkcloud_admin_csrf']) and Client ($_SESSION['hkcloud_client_csrf']) tokens validated on every write AJAX request (HTTP 403on failure). - Client Ownership Isolation:
ClientController::requireOwned()verifiesinstance.userid === $_SESSION['uid']before any power, firewall, snapshot, rebuild, resize, or Floating IP action. - OpenSSH Public Key Validation: Validates key header (
ssh-ed25519,ssh-rsa,ecdsa-sha2-*) and computes RFC 4716 / OpenSSHSHA256:fingerprint before storing.
5. AJAX API Reference
- Admin (
admin/addonmodules.php?module=haikhavan_cloud_iaas&ajax=1):provision_instance,power_action,terminate_instance,rebuild_os,resize_instance,create_snapshot,restore_snapshot,delete_snapshot,add_firewall,delete_firewall,add_ssh_key,allocate_fip,release_fip,ack_alert,run_finops_scan,save_provider,test_provider,get_comparator(read),get_metrics(read). - Client (
index.php?m=haikhavan_cloud_iaas&ajax=1):provision_instance,power_action,rebuild_os,resize_instance,create_snapshot,restore_snapshot,add_firewall,delete_firewall,add_ssh_key,delete_ssh_key,allocate_fip,release_fip,get_metrics(read).