HTTP POST /deployVirtualMachine ├── ApiServlet.processRequest() ├── Authentication & Authorization │ ├── 2FA Check │ ├── CIDR Validation │ ├── DynamicRoleBasedAPIAccessChecker │ └── ApiRateLimitService ├── Resource Validation │ ├── AccountManagerImpl.checkAccess() [multiple] │ ├── NetworkModelImpl.checkNetworkPermissions() │ └── UserDataManagerImpl.validateUserData() ├── DB Allocation (Synchronous) │ ├── UserVmManagerImpl.allocate() │ ├── VirtualMachineManagerImpl.allocate() │ ├── NetworkOrchestrator.allocateNic() │ ├── VolumeOrchestrator.allocateRawVolume() │ └── ResourceLimitManagerImpl.incrementResourceCount() [5x] ├── AsyncJobManagerImpl.submitAsyncJob(job-43) │ └── Return job ID to client └── Background Execution (job-43) ├── DeploymentPlanningManagerImpl....
Drafts
┌─────────────────────────────────────────────────────┐ │ KVM Host │ │ ┌──────┐ ┌──────┐ ┌──────┐ │ │ │ VM 1 │ │ VM 2 │ │ SSVM │ │ │ └──────┘ └──────┘ └──────┘ │ │ │ │ │ │ │ └────────┼────────┘ │ │ │ │ │ ▼ │ │ cloudbr0 (10.0.113.160) │ │ virtual switch + has IP │ │ │ │ │ ▼ │ │ eth0 (no IP, just a port on the bridge) │ └─────────────────────────────────────────────────────┘ │ ▼ Physical Switch │ ┌───────────┼───────────┐ │ │ │ NFS MySQL Mgmt Server
Ubuntu vs Oracle Linux (EL10) - CloudStack Installation Aspect Ubuntu Oracle Linux (EL10) Package Manager apt dnf Extra Repos universe (usually enabled) oracle-epel-release-el10 (install manually) CloudStack Repo .deb packages in /etc/apt/sources.list.d/ .rpm packages in /etc/yum.repos.d/ Networking Netplan (YAML in /etc/netplan/) NetworkManager (nmcli) Bridge Setup Edit YAML, run netplan apply nmcli connection add/modify/up NFS Package nfs-kernel-server nfs-utils NFS Service nfs-kernel-server nfs-server Security AppArmor SELinux Disable Security systemctl disable apparmor setenforce 0 + edit config Firewall ufw or iptables firewalld Libvirt Listen Config /etc/default/libvirtd Systemd override
┌──────────────────────────────────────────────────────────────────────────────────┐ │ │ │ ┌──────────────┐ commands/API ┌──────────────┐ │ │ │ │ ───────────────────────────▶ │ │ │ │ │ Mgmt Server │ │ KVM Host │ │ │ │ │ ◀─────────────────────────── │ │ │ │ └──────┬───────┘ status/heartbeat └──────┬───────┘ │ │ │ │ │ │ │ │ │ │ DB read/write VM disk I/O │ │ │ │ │ │ ▼ ▼ │ │ ┌──────────────┐ ┌──────────────┐ │ │ │ │ │ │ │ │ │ MySQL │ │ NFS │ │ │ │ │ │ │ │ │ └──────────────┘ └──────────────┘ │ │ ▲ │ │ │ │ │ templates/ISOs │ │ │ ┌──────────────┐ │ │ │ │ Mgmt Server │ ─────────────────────────────────────┘ │ │ └──────────────┘ │ │ │ └──────────────────────────────────────────────────────────────────────────────────┘
CloudStack VM Deployment - Complete Flow Understanding the sync and async phases of VM deployment. SYNC PHASE (~250ms) Client blocks here. Must complete before job ID is returned. ┌─────────────────────────────────────────────────────────────────────────┐ │ SYNC PHASE (37.044 - 37.296) ~250ms │ ├─────────────────────────────────────────────────────────────────────────┤ │ │ │ HTTP POST /deployVirtualMachine │ │ │ │ │ ▼ │ │ ┌─────────────────┐ │ │ │ Authentication │ 2FA check, CIDR validation │ │ │ Authorization │ Role check, resource permissions │ │ └────────┬────────┘ │ │ ▼ │ │ ┌─────────────────┐ │ │ │ DB Allocation │ vm_instance (Stopped), nics, volumes (Allocated) │ │ │ │ resource_count incremented │ │ └────────┬────────┘ │ │ ▼ │ │ ┌─────────────────┐ │ │ │ Submit Job │ AsyncJobManager creates job-43 │ │ └────────┬────────┘ │ │ ▼ │ │ Return: { jobid: "5dc96a21-....