* [Cluster-devel] fencing citrix XenServer VM's
@ 2011-02-21 8:51 Matt Clark
0 siblings, 0 replies; 3+ messages in thread
From: Matt Clark @ 2011-02-21 8:51 UTC (permalink / raw)
To: cluster-devel.redhat.com
Hi,
I am currently writing a fencing agent to handle the fencing of virtual machines that are running on top of XenServer hosts and I had a couple of questions related to making a Red Hat friendly version. Let me know if this is not the right place to be asking.
I have written a first version located herehttp://code.google.com/p/fence-xenserver/
Now this works fine via command line options, however I have found the following link which says that the input will be taken as name/value pairs from standard in. The link I found to this doc is around 3 years old and I was wondering if it is still valid before making any changes? Looking at fenced this does still seem to be the case.http://sources.redhat.com/cluster/wiki/FenceAgentAPI
I was also wondering if there is any benefit to using the fencing.py library over creating a stand-alone script? Is this the suggested method of implementing a new fencing agent for Red Hat? I have actually started on a version that uses this library, is there someone on this list I can talk to about making changes to it (to take a URL instead of a ip address, and to include a UUID parameter in the options assoc array). So far I've only made a couple of changes to it, but I think a few more are coming as it isn't quite happening for me just yet.
Lastly, I am using XenAPI.py (which is released by Citrix under the LGPL). This is more of a licensing general question, but am I ok to just include this file in my release? Reading the LGPL seems to suggest this is ok as long as the copyright notice stays, but I thought I'd ask the question just in case... I'd hate to go to the trouble of finishing this only to find out that it can't be released...
Thanks for your time :)
Matt.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/cluster-devel/attachments/20110221/94ac9603/attachment.htm>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Cluster-devel] fencing citrix XenServer VM's
@ 2011-02-24 8:29 Matt Clark
2011-02-24 13:50 ` Marek Grac
0 siblings, 1 reply; 3+ messages in thread
From: Matt Clark @ 2011-02-24 8:29 UTC (permalink / raw)
To: cluster-devel.redhat.com
Well I seem to have a working script using the fencing.py library, however I did have to make a few minor changes.
To the all_opt array I added two options as follows:- "session_url" : { "getopt" : "s:", "longopt" : "session-url", "help" : "-s, --session-url URL to connect to XenServer on.", "required" : "1", "shortdesc" : "The URL of the XenServer host.", "order" : 1}, "uuid" : { "getopt" : "u:", "longopt" : "uuid", "help" : "-u, --uuid UUID of the VM to fence.", "required" : "1", "shortdesc" : "The UUID of the VM to fence.", "order" : 1}
Is this ok to be added to fencing.py, or should I be customising/appending this in my script?
Also the following line is preventing my "list" function from working:-
if (options["-o"] == "list") and (0 == options["device_opt"].count("port")) and (0 == options["device_opt"].count("partition"))
Not knowing the library well enough, I don't know what the above if statement is trying to catch. The result is my list action prints out "N/A". I have temporarily short circuited this statement (and'ing with 0 at the end) and it all works for me, so I just need to know what this is safeguarding to know what my version of the check should be. I would expect a count of zero "ports" and "partitions" in the options array when trying the "list" action... So I must be missing the point here.
I just realised that no-one is going to be able to use the Red Hat version of my script on the google code site as I haven't included a fencing.py library with the above changes.... Lol, serves my right for late night coding.
Some direction would be appreciated :)
Thanks,
Matt.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/cluster-devel/attachments/20110224/a3eec580/attachment.htm>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Cluster-devel] fencing citrix XenServer VM's
2011-02-24 8:29 [Cluster-devel] fencing citrix XenServer VM's Matt Clark
@ 2011-02-24 13:50 ` Marek Grac
0 siblings, 0 replies; 3+ messages in thread
From: Marek Grac @ 2011-02-24 13:50 UTC (permalink / raw)
To: cluster-devel.redhat.com
Hi,
On 02/24/2011 09:29 AM, Matt Clark wrote:
> Well I seem to have a working script using the fencing.py library,
> however I did have to make a few minor changes.
>
> To the all_opt array I added two options as follows:-
> "session_url" : {
> "getopt" : "s:",
> "longopt" : "session-url",
> "help" : "-s, --session-url URL to
> connect to XenServer on.",
> "required" : "1",
> "shortdesc" : "The URL of the XenServer host.",
> "order" : 1},
> "uuid" : {
> "getopt" : "u:",
> "longopt" : "uuid",
> "help" : "-u, --uuid UUID of the VM
> to fence.",
> "required" : "1",
> "shortdesc" : "The UUID of the VM to fence.",
> "order" : 1}
>
> Is this ok to be added to fencing.py, or should I be
> customising/appending this in my script?
>
Adding this option to fencing.py is preferable way how to do it
(including your fence agent to upstream version surely too). I would
just like to change existing short options (eg -u is used for port number).
Adding option for URL is surely something what can be reused in
different agent. I understand the need for UUID but if it is the only
way how to access virtual machine then I will prefer to reuse existing
port option (already used for virtual machines).
> Also the following line is preventing my "list" function from working:-
>
> if (options["-o"] == "list") and (0 ==
> options["device_opt"].count("port")) and (0 ==
> options["device_opt"].count("partition"))
>
> Not knowing the library well enough, I don't know what the above if
> statement is trying to catch. The result is my list action prints out
> "N/A". I have temporarily short circuited this statement (and'ing with
> 0 at the end) and it all works for me, so I just need to know what
> this is safeguarding to know what my version of the check should be. I
> would expect a count of zero "ports" and "partitions" in the options
> array when trying the "list" action... So I must be missing the point
> here.
>
You will have to add your uuid option here. This test is here to
distinguish difference between:
* list of plugged devices is available
* list of plugged devices is not available yet
* N/A - fence device can be used to fence just one device (eg iLO, DRAC)
Feel free to contact me directly, if you will have any questions about
writing fence agents.
m,
m,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/cluster-devel/attachments/20110224/1428f3cd/attachment.htm>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-02-24 13:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-24 8:29 [Cluster-devel] fencing citrix XenServer VM's Matt Clark
2011-02-24 13:50 ` Marek Grac
-- strict thread matches above, loose matches on Subject: below --
2011-02-21 8:51 Matt Clark
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).