mirror of
https://github.com/GoodOlClint/PSProxmoxVE.git
synced 2026-08-13 07:36:52 +00:00
feat: add -Detailed switch to Get-PveVm for accurate pause detection
PVE list endpoint reports Status=running for paused VMs. The new -Detailed switch queries status/current per VM to populate QmpStatus. - PveVm.EffectiveStatus computed property: returns QmpStatus ?? Status - PveVm.Status doc comment explains the limitation - VmService.EnrichVmStatus() queries status/current endpoint - Get-PveVm -Detailed enriches each VM with qmpstatus, pid, uptime - format.ps1xml table view uses EffectiveStatus for the Status column - Integration test asserts EffectiveStatus after suspend/resume Verified locally: Get-PveVm -Detailed correctly shows 'paused' for suspended VMs where Get-PveVm (without -Detailed) shows 'running'. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1153,14 +1153,19 @@ Describe 'Integration Tests' -Tag 'Integration' {
|
||||
if (Skip-IfNoLinuxVm) { return }
|
||||
|
||||
# Suspend — -Wait -Timeout polls qmpstatus until 'paused'
|
||||
# Note: PVE list endpoint reports Status=running for paused VMs;
|
||||
# the -Wait polling uses the status/current endpoint which has qmpstatus.
|
||||
$suspendTask = Suspend-PveVm -Node $script:Node -VmId $script:LinuxVmId -Wait -Timeout 30
|
||||
$suspendTask | Should -Not -BeNullOrEmpty
|
||||
|
||||
# Verify with -Detailed (fetches qmpstatus from status/current endpoint)
|
||||
$vm = Get-PveVm -Node $script:Node -VmId $script:LinuxVmId -Detailed
|
||||
$vm.EffectiveStatus | Should -Be 'paused'
|
||||
|
||||
# Resume — -Wait -Timeout polls qmpstatus until 'running'
|
||||
$resumeTask = Resume-PveVm -Node $script:Node -VmId $script:LinuxVmId -Wait -Timeout 30
|
||||
$resumeTask | Should -Not -BeNullOrEmpty
|
||||
|
||||
$vm = Get-PveVm -Node $script:Node -VmId $script:LinuxVmId -Detailed
|
||||
$vm.EffectiveStatus | Should -Be 'running'
|
||||
}
|
||||
|
||||
It 'Should gracefully restart a VM via ACPI (Restart-PveVm)' {
|
||||
|
||||
Reference in New Issue
Block a user