cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Marek Grac <mgrac@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] fencing citrix XenServer VM's
Date: Thu, 24 Feb 2011 14:50:58 +0100	[thread overview]
Message-ID: <4D666242.2000603@redhat.com> (raw)
In-Reply-To: <COL108-W3F4BF7FFB8D79C08837D6DDDA0@phx.gbl>

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>

  reply	other threads:[~2011-02-24 13:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-24  8:29 [Cluster-devel] fencing citrix XenServer VM's Matt Clark
2011-02-24 13:50 ` Marek Grac [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-02-21  8:51 Matt Clark

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D666242.2000603@redhat.com \
    --to=mgrac@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).