Red Hat Bugzilla – Bug 595383
Provide fence-rhev agent that uses the RHEV REST API
Last modified: 2012-06-19 04:47:31 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.
Simple example of using the REST API to stop a VM:
echo -n "$u:$p" > $t
rm -f $t
AUTH=$(b64 "$USER" "$PASSWD")
nc $HOST $PORT <<EOF
POST $BASE$VM_STOP_URI HTTP/1.1
Authorization: Basic $AUTH
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
(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?
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 :)
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.
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.
*** Bug 548595 has been marked as a duplicate of this bug. ***
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.