Bug #22874
openforeman-libvirt - needs managed_saved API option added
Description
Foreman fails to remove VM's in libvirt in case those have a managed state file. About manged state - https://libvirt.org/sources/virshcmdref/html/sect-managedsave.html about new API to destrou managed-save https://bugzilla.redhat.com/show_bug.cgi?id=697742.
Foreman needs to add fallback mechanism to remove managedsave VM's. I am encountering this in Foreman 1.16.
Error in Logs when this problem is observed
2018-03-13 05:23:29 3d27eb37 [app] [W] Failed to destroy a compute SERVER-1220-kvm (Libvirt) instance test2.myorg.org: Call to virDomainUndefineFlags failed: Requested operation is not valid: Refusing to undefine while domain managed save image exists
| Libvirt::Error: Call to virDomainUndefineFlags failed: Requested operation is not valid: Refusing to undefine while domain managed save image exists
2018-03-13 05:23:29 3d27eb37 [app] [W] Rolling back due to a problem: [#<Orchestration::Task:0x007f798e638530 @name="Removing compute instance test2.myorg.org", @status="failed", @priority=100, @action=[#<Host::Managed id: 5, name: "test2.myorg.org", last_compile: nil, last_report: nil, updated_at: "2018-03-12 19:45:10", created_at: "2018-03-12 17:12:43", root_pass: "$5$D3gCQ2ij$6zdjXOsdr4uwG8g38GpwhQqEXhv/Ux5V/IucDH...", architecture_id: 1, operatingsystem_id: 1, environment_id: 1, ptable_id: 88, medium_id: 1, build: false, comment: "", disk: "", installed_at: "2018-03-12 19:45:10", model_id: nil, hostgroup_id: 1, owner_id: 4, owner_type: "User", enabled: true, puppet_ca_proxy_id: 1, managed: true, use_image: nil, image_file: nil, uuid: "3bf5fea8-a267-4aa5-9e67-3f77d41ac848", compute_resource_id: 1, puppet_proxy_id: 1, certname: nil, image_id: nil, organization_id: nil, location_id: nil, type: "Host::Managed", otp: nil, realm_id: nil, compute_profile_id: 3, provision_method: "build", grub_pass: "$5$D3gCQ2ij$6zdjXOsdr4uwG8g38GpwhQqEXhv/Ux5V/IucDH...", global_status: 0, lookup_value_matcher: "fqdn=test2.myorg.org", pxe_loader: "PXELinux BIOS">, :delCompute], @timestamp=2018-03-13 05:23:29 UTC>]
2018-03-13 05:23:29 3d27eb37 [app] [I] Processed 3 tasks from queue 'Host::Managed Main', completed 0/9
P.S. Initially i was planning to report this against foreman-libvirt plugin github project or some project location. However i have failed to google it up, and it's not on https://projects.theforeman.org/projects/foreman/wiki/List_of_Plugins either. I think https://projects.theforeman.org/projects/foreman/wiki/List_of_Plugins might need an update.
Updated by Anonymous over 6 years ago
- Category changed from Plugin integration to Compute resources - libvirt
libvirt support is developed in with Foreman core, code-wise, but is packaged separately for RPM and DEB.