Bug 1254821

Summary: fence_virsh does not work when host machine is el5xen
Product: Red Hat Enterprise Linux 7 Reporter: Trevor Hemsley <trevor.hemsley>
Component: fence-agentsAssignee: Marek Grac <mgrac>
Status: CLOSED ERRATA QA Contact: cluster-qe <cluster-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0CC: cluster-maint, mjuricek, oalbrigt, rjones
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: fence-agents-4.0.11-34.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-04 04:47:12 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch to fence_virsh to treat unknown VM names as off
none
Proposed patch none

Description Trevor Hemsley 2015-08-19 00:09:50 UTC
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:
Always

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`
2.
3.

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.com -i /root/.ssh/id_rsa -p 22 -t '/bin/bash -c "PS1=\[EXPECT\]#\  /bin/bash --noprofile --norc"'
Received: [EXPECT]# 
Sent: virsh domstate vmname
Sent: 

Received: virsh domstate vmname
error: failed to get domain 'vmname'
error: Domain not found: xenUnifiedDomainLookupByName

[EXPECT]# 
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 07:58:55 UTC
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 13:33:08 UTC
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 13:56:59 UTC
@Trevor:

thanks, patch is in upstream now.

Comment 7 Mike McCune 2016-03-28 23:04:30 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions

Comment 11 errata-xmlrpc 2016-11-04 04:47:12 UTC
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.

https://rhn.redhat.com/errata/RHBA-2016-2373.html