Red Hat Bugzilla – Bug 1254821
fence_virsh does not work when host machine is el5xen
Last modified: 2016-11-04 00:47:12 EDT
Created attachment 1064575 [details]
Patch to fence_virsh to treat unknown VM names as off
Description of problem:
If you have a VM running on an el5 xen host then fence_virsh does not work correctly
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Install a guest on an el5 xen system and from the guest, attempt to fence using something like `fence_virsh -l root -k /root/.ssh/id_rsa -x -o status -4 -a xenhost.company.com -n vmname -v`
[root@vmname ~]# fence_virsh -l root -k /root/.ssh/id_rsa -x -o status -4 -a xenhost.company.com -n vmname -v
Running command: /usr/bin/ssh -4 firstname.lastname@example.org -i /root/.ssh/id_rsa -p 22 -t '/bin/bash -c "PS1=\[EXPECT\]#\ /bin/bash --noprofile --norc"'
Sent: virsh domstate vmname
Received: virsh domstate vmname
error: failed to get domain 'vmname'
error: Domain not found: xenUnifiedDomainLookupByName
Failed: You have to enter existing name/UUID of virtual machine!
Please use '-h' for usage
fence_virsh should return valid results
Xen does not return domstate info for VMs that are not currently running. Trivial fix is to return 'off' for unknown VM names as per attached patch.
Created attachment 1064649 [details]
Thanks for a patch, we already have option --missing-as-off that allows you (on selected agents) to work with VM/.. that looks like they do not exist. I have changed a patch to follow this standard. Can you please retest it on your deployment? fence_virsh is not supported on RHEL so our QE coverage of it is limited.
I patched and tested using your version but it did not want to work. I changed options.has_key("missing_as_off"): to options.has_key("--missing-as-off"): and then it seems to be OK.
thanks, patch is in upstream now.
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see email@example.com with any questions
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.