unable to destroy libvirt vm
[W] Failed to destroy a compute h01.sat.lab (Libvirt) instance fdev19.sat.lab.tlv.redhat.com: wrong number of arguments (0 for 1) | ArgumentError: wrong number of arguments (0 for 1) | /home/foreman/gems/gems/fog-libvirt-0.0.2/lib/fog/libvirt/requests/compute/volume_action.rb:6:in `delete' | /home/foreman/gems/gems/fog-libvirt-0.0.2/lib/fog/libvirt/requests/compute/volume_action.rb:6:in `volume_action' | /home/foreman/gems/gems/fog-libvirt-0.0.2/lib/fog/libvirt/models/compute/volume.rb:45:in `destroy' | /home/foreman/gems/gems/fog-libvirt-0.0.2/lib/fog/libvirt/models/compute/server.rb:89:in `block in destroy' | /home/foreman/gems/gems/fog-libvirt-0.0.2/lib/fog/libvirt/models/compute/server.rb:89:in `each' | /home/foreman/gems/gems/fog-libvirt-0.0.2/lib/fog/libvirt/models/compute/server.rb:89:in `destroy' | /home/foreman/git/foreman/app/models/compute_resources/foreman/model/libvirt.rb:41:in `destroy_vm'
#4 Updated by Maximilian Gaß almost 3 years ago
I think this is a problem with virtual machines not created from Foreman. Fog-Libvirt fails to understand volume tags as written by virt-install.
For example, my XML might say:
The volume metadata is then incomplete:
volumes=[ <Fog::Compute::Libvirt::Volume id=nil, pool_name="vg1", key=nil, name="fog-764556483518616", path=nil, capacity="10G", allocation="1G", format_type="raw", backing_volume=nil >],
Volumes are deleted by key, but as you can see, "key" is nil
#5 Updated by Oliver Freyermuth about 2 years ago
- Triaged set to No
I observe exactly the same.
I had to patch fog as follows:
to be able to create VMs with Ceph-RBD backed volumes.
However, now I am unable to delete them.
#6 Updated by Oliver Freyermuth 10 months ago
The code snippet in this PR comment against fog-libvirt:
fixes my issues, and I plan to upstream it after response on how to proceed.
It also lets RBD volumes show up correctly in foreman with their provisioned and allocated size.