Bug 1254821 - fence_virsh does not work when host machine is el5xen
fence_virsh does not work when host machine is el5xen
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: fence-agents (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Marek Grac
Depends On:
  Show dependency treegraph
Reported: 2015-08-18 20:09 EDT by Trevor Hemsley
Modified: 2016-11-04 00:47 EDT (History)
4 users (show)

See Also:
Fixed In Version: fence-agents-4.0.11-34.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-11-04 00:47:12 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Patch to fence_virsh to treat unknown VM names as off (461 bytes, patch)
2015-08-18 20:09 EDT, Trevor Hemsley
no flags Details | Diff
Proposed patch (2.10 KB, patch)
2015-08-19 03:58 EDT, Marek Grac
no flags Details | Diff

  None (edit)
Description Trevor Hemsley 2015-08-18 20:09:50 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):

How reproducible:

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`

Actual results:
[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  root@xenhost.company.com -i /root/.ssh/id_rsa -p 22 -t '/bin/bash -c "PS1=\[EXPECT\]#\  /bin/bash --noprofile --norc"'
Received: [EXPECT]# 
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

Expected results:
fence_virsh should return valid results

Additional info:
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.
Comment 2 Marek Grac 2015-08-19 03:58:55 EDT
Created attachment 1064649 [details]
Proposed patch

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.
Comment 3 Trevor Hemsley 2015-08-19 09:33:08 EDT
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.
Comment 4 Marek Grac 2015-08-19 09:56:59 EDT

thanks, patch is in upstream now.
Comment 7 Mike McCune 2016-03-28 19:04:30 EDT
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune@redhat.com with any questions
Comment 11 errata-xmlrpc 2016-11-04 00:47:12 EDT
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.


Note You need to log in before you can comment on or make changes to this bug.