ManageIQ / manageiq-providers-vmware

ManageIQ plugin for the VMware vSphere and vCloud providers.
Apache License 2.0
22 stars 70 forks source link

Fix VM terminate showing supported when running #897

Closed agrare closed 7 months ago

agrare commented 7 months ago

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.

image

miq-bot commented 7 months ago

Checked commit https://github.com/agrare/manageiq-providers-vmware/commit/612523765871539f996f862fa758b6dc53f34d77 with ruby 2.7.8, rubocop 1.56.3, haml-lint 0.51.0, and yamllint 4 files checked, 2 offenses detected

spec/models/manageiq/providers/vmware/infra_manager/vm_spec.rb

Fryguy commented 7 months ago

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)