Refactor VM resource specs resolution and enhance order payment success email with addon summary; add UpdateVmConfigJob for CPU/RAM updates

This commit is contained in:
baodev0
2026-07-17 14:00:42 +07:00
parent d9da3b5bb3
commit ad20cd5bdc
12 changed files with 458 additions and 33 deletions
@@ -31,7 +31,7 @@ use Illuminate\Support\Facades\Log;
*
* Assigns a real static IP to the VM guest OS and verifies it is active.
* Only persists the IP to DB (module_vmware + virtual_machines) after
* successful guest-side verification, then dispatches ChangePasswordViaVsphereJob.
* successful guest-side verification, then dispatches UpdateVmConfigJob → ChangePasswordViaVsphereJob.
*
* Flow:
* [1] Resolve network config from order item → product → ipAddress template
@@ -41,7 +41,7 @@ use Illuminate\Support\Facades\Log;
* [5] On FAIL → release IP, try next
* [6] Call verifyIPLinux.ps1 / verifyIPWindows.ps1 via SSH
* [7] On FAIL → release IP, try next
* [8] SUCCESS → persistIp() → dispatch ChangePasswordViaVsphereJob
* [8] SUCCESS → persistIp() → dispatch UpdateVmConfigJob → ChangePasswordViaVsphereJob
* [9] All attempts exhausted → mark VM inactive (status=0)
*/
class AssignIpToGuestJob implements ShouldQueue
@@ -184,7 +184,7 @@ class AssignIpToGuestJob implements ShouldQueue
'attempt' => $attempt,
]);
ChangePasswordViaVsphereJob::dispatch(
UpdateVmConfigJob::dispatch(
$this->moduleVmwareId,
$this->vmId,
$this->osFamily,
@@ -226,8 +226,8 @@ class AssignIpToGuestJob implements ShouldQueue
'attempt' => $attempt,
]);
// Dispatch password change now that IP is confirmed
ChangePasswordViaVsphereJob::dispatch(
// Dispatch addon config update → then password change
UpdateVmConfigJob::dispatch(
$this->moduleVmwareId,
$this->vmId,
$this->osFamily,