ManageIQ / manageiq-providers-ovirt

ManageIQ plugin for the oVirt provider.
https://www.ovirt.org/
Apache License 2.0
6 stars 62 forks source link

Fix VM Reconfigure for stopped VMs #637

Closed agrare closed 1 year ago

agrare commented 1 year ago

Ovirt VMs have no host assigned when they are not running. This causes an exception to be raised when trying to reconfigure a VM that isn't running because we are using the host for the list of available lans.

agrare commented 1 year ago

Keeping this WIP because I think we can still return a list of Lans without a host we just need to looks for dvswitches in the vm's parent_datacenter.

agrare commented 1 year ago

We can use the parent_cluster.lans to get all lans available to the VM in the cluster. This mirrors what the RHV UI does where even if a VM is powered off you can still see a list of available lans to select from.

miq-bot commented 1 year ago

Checked commit https://github.com/agrare/manageiq-providers-ovirt/commit/b5122886d5e42fe4f717d29bfe01cdfdcc0002bd with ruby 2.6.10, rubocop 1.28.2, haml-lint 0.35.0, and yamllint 2 files checked, 0 offenses detected Everything looks fine. :trophy:

Fryguy commented 1 year ago

Backported to petrosian in commit 312320ba13573d374731b6fedb6bc434b64e5f68.

commit 312320ba13573d374731b6fedb6bc434b64e5f68
Author: Jason Frey <fryguy9@gmail.com>
Date:   Tue Mar 21 16:39:24 2023 -0400

    Merge pull request #637 from agrare/fix_vm_reconfig_nil_host

    Fix VM Reconfigure for stopped VMs

    (cherry picked from commit adbe19ce083dbd24c3d05b507dbf33d8c32f7d95)