Closed agrare closed 7 months ago
spec/models/manageiq/providers/vmware/infra_manager/vm_spec.rb
Backported to quinteros
in commit 7d1f834b214278433a6d16dd129eb6a23d8863c9.
commit 7d1f834b214278433a6d16dd129eb6a23d8863c9
Author: Jason Frey <fryguy9@gmail.com>
Date: Wed Jan 24 14:14:51 2024 -0500
Merge pull request #897 from agrare/fix_vm_destroy_allowed_when_running
Fix VM terminate showing supported when running
(cherry picked from commit 74fc1b0e586549d33f9fa524b278cc020f0286b6)
VMware does not allow Destroy_Task to be called on a VM while it is running or suspended. Also we were not allowing terminate on Templates because we were using
supports?(:control)
which has an explicit!template?
condition. Also also the spec tests for VMs were using "poweredOff" for the "suspended" cases so I've added explicit suspended contexts and changed the power state to "poweredOff" for any of the existing "off" tests.