Bug 595383 - Provide fence-rhev agent that uses the RHEV REST API
Provide fence-rhev agent that uses the RHEV REST API
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: fence-agents (Show other bugs)
6.0
All Linux
urgent Severity medium
: rc
: ---
Assigned To: Marek Grac
Brandon Perkins
: ZStream
: 548595 (view as bug list)
Depends On: 618705 681669 681674 688267 731161 731166
Blocks: 595385 595456 607640 642695 681652 688396 688400
  Show dependency treegraph
 
Reported: 2010-05-24 09:59 EDT by Perry Myers
Modified: 2012-06-19 04:47 EDT (History)
14 users (show)

See Also:
Fixed In Version: fence-agents-3.0.12-9.el6
Doc Type: Bug Fix
Doc Text:
The package has been updated to provide a fencing agent that is able to communicate with Red Hat Enterprise Virtualization Manager, allowing virtual machines to be fenced.
Story Points: ---
Clone Of:
: 595385 (view as bug list)
Environment:
Last Closed: 2011-05-19 10:21:16 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Perry Myers 2010-05-24 09:59:05 EDT
Description of problem:
fence_dcloud implementation might be a longer term target since it involves getting dcloud support formally into RHEL.  In addition, dcloud packages won't be in RHEL5.  So we need a fence_rhev agent that uses the RHEV REST API instead of relying on the generic dcloud support.  Eventually in RHEL6 fence_rhev can be replaced by fence_dcloud.  But we need a shorter term solution and a REST based fence agent should be simple to develop and test.

This bug is dependent on full support for the RHEV REST API.  Once a bug has been filed on that the dependency should be set.
Comment 1 Mark McLoughlin 2010-07-02 04:22:43 EDT
Simple example of using the REST API to stop a VM:

---
#!/bin/bash

VM_STOP_URI="vms/9/stop"

HOST="localhost"
PORT="8099"
BASE="/rhevm-api-mock/"
USER="Aladdin"
PASSWD="open sesame"

b64()
{
    u="$1"; shift
    p="$1"; shift
    t=$(mktemp)
    echo -n "$u:$p" > $t
    base64 $t
    rm -f $t
}

AUTH=$(b64 "$USER" "$PASSWD")

nc $HOST $PORT <<EOF
POST $BASE$VM_STOP_URI HTTP/1.1
Host: $HOST
Authorization: Basic $AUTH
Content-type: application/xml
Content-length: 9

<action/>
EOF
---

or if you use wget:

---
wget --header=Accept:application/xml --header=Content-Type:application/xml --http-user=$USER --http-password=$PASSWD --post-data="<action/>" http://$HOST:$PORT/$BASE$VM_STOP_URI
---
Comment 2 Alan Pevec 2010-07-02 04:59:03 EDT
(In reply to comment #1)
> Simple example of using the REST API to stop a VM:

Fence agent needs to ensure machine is really down, would successful execution (200 response code I assume?) of this service guarantee that VM is really killed?
Comment 3 Perry Myers 2010-07-02 07:16:51 EDT
Fence agents are only as reliable/good as the devices they connect to.  We have the same issue for example with power fence devices.  i.e. you connect to a power fence device and tell it to shut down the host.  You have to trust that when the hardware device returns success that it told the truth.

Now that being said, we usually do a combination of 'device off' and then 'status' to verify that the device did turn off.  So we'll do the same for fence_rhev, calling 'power off vm' and waiting for status 200.  And then calling 'status vm' to double check that the vm turned off.

If the API lies to us... well, let's just make sure the API is functionally correct :)
Comment 5 Brandon Perkins 2010-07-14 12:14:20 EDT
qa_ack+
Comment 12 Jaromir Hradilek 2010-10-20 08:23:18 EDT
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
The package has been updated to provide a fencing agent that is able to communicate with Red Hat Enterprise Virtualization Manager, allowing virtual machines to be fenced.
Comment 13 Perry Myers 2010-11-27 08:33:40 EST
*** Bug 548595 has been marked as a duplicate of this bug. ***
Comment 18 errata-xmlrpc 2011-05-19 10:21:16 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0745.html

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