feat(vm): hoàn tiền khi cấp VM lỗi, theo dõi job queue, uuid dịch vụ cho ticket, chuẩn hoá RAM addon

- VmProvisionException/VmProvisionRefund xử lý lỗi cấp phát VM
- QueueJobInspector + QueueMonitorController xem chi tiết job
- Thêm service uuid cho ticket, thời lượng cho activity_logs
- Migration chuẩn hoá RAM addon sang MB, trạng thái deleting cho snapshot

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
baodev0
2026-10-30 11:54:05 +07:00
co-authored by Claude Sonnet 5.5
parent 7136bec265
commit 62596d9063
32 changed files with 514 additions and 107 deletions
@@ -33,6 +33,7 @@ trait ManagesVmPower
return $this->vmLocked();
}
$startedAt = now();
try {
$result = $action->execute($vm);
} finally {
@@ -44,6 +45,8 @@ trait ManagesVmPower
logName: 'VM',
description: "Customer {$request->user()->email} bật VM: {$vm->name} (ID: {$vm->vmware_id})",
subject: $vm,
startedAt: $startedAt,
finishedAt: now(),
);
return $this->vmResponse($result, 'Đã gửi lệnh bật VM.');
@@ -71,6 +74,7 @@ trait ManagesVmPower
return $this->vmLocked();
}
$startedAt = now();
try {
$result = $action->execute($vm);
} finally {
@@ -82,6 +86,8 @@ trait ManagesVmPower
logName: 'VM',
description: "Customer {$request->user()->email} tắt VM: {$vm->name} (ID: {$vm->vmware_id})",
subject: $vm,
startedAt: $startedAt,
finishedAt: now(),
);
return $this->vmResponse($result, 'Đã gửi lệnh tắt VM.');
@@ -104,6 +110,7 @@ trait ManagesVmPower
return $this->vmLocked();
}
$startedAt = now();
try {
$result = $serviceVCenter->restartVM($vm, $vm->vmware_id);
} finally {
@@ -122,6 +129,8 @@ trait ManagesVmPower
logName: 'VM',
description: "Customer {$request->user()->email} restart VM: {$vm->name} (ID: {$vm->vmware_id})",
subject: $vm,
startedAt: $startedAt,
finishedAt: now(),
);
return response()->json([