Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=c404f3305d156…
Commit: c404f3305d156a89232c1f8294aadd23fdd2a15f
Parent: befffad0d0ad2554071c02f877033a49d47629b4
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Thu Sep 27 15:28:25 2012 +0200
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Thu Sep 27 15:28:25 2012 +0200
fence_vmware_soap: Faster fencing, fix crash on VM without valid UUID
Improve speed of fencing by removing requests for attributes that are not needed. This change is significant
when there are hundrens of VM on vSphere server. On the systems with <10 VM improvement is still about 20%.
This patch also fixes situation when there are VM which do not have valid UUID. This can happend when P2V (physical
to virtual machine process) failed.
Patch was proposed by: Rodrigo A B Freire
Resolves: rhbz#836654
---
fence/agents/vmware_soap/fence_vmware_soap.py | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/fence/agents/vmware_soap/fence_vmware_soap.py b/fence/agents/vmware_soap/fence_vmware_soap.py
index 9bebd08..0da7f0d 100644
--- a/fence/agents/vmware_soap/fence_vmware_soap.py
+++ b/fence/agents/vmware_soap/fence_vmware_soap.py
@@ -44,9 +44,12 @@ def process_results(results, machines, uuid, mappingToUUID):
info = {}
for i in m.propSet:
info[i.name] = i.val
- machines[info["name"]] = (info["config.uuid"], info["summary.runtime.powerState"])
- uuid[info["config.uuid"]] = info["summary.runtime.powerState"]
- mappingToUUID[m.obj.value] = info["config.uuid"]
+ # Prevent error KeyError: 'config.uuid' when reaching systems which P2V failed,
+ # since these systems don't have a valid UUID
+ if info.has_key("config.uuid"):
+ machines[info["name"]] = (info["config.uuid"], info["summary.runtime.powerState"])
+ uuid[info["config.uuid"]] = info["summary.runtime.powerState"]
+ mappingToUUID[m.obj.value] = info["config.uuid"]
return (machines, uuid, mappingToUUID)
@@ -77,7 +80,7 @@ def get_power_status(conn, options):
propSpec = conn.factory.create('ns0:PropertySpec')
propSpec.all = False
- propSpec.pathSet = ["name", "summary.runtime.powerState", "config.uuid", "summary", "config", "capability", "network"]
+ propSpec.pathSet = ["name", "summary.runtime.powerState", "config.uuid"]
propSpec.type = "VirtualMachine"
propFilterSpec = conn.factory.create('ns0:PropertyFilterSpec')
@@ -101,6 +104,9 @@ def get_power_status(conn, options):
machines.update(more_machines)
uuid.update(more_uuid)
mappingToUUID.update(more_mappingToUUID)
+ # Do not run unnecessary SOAP requests
+ if options.has_key("-U") and options["-U"] in uuid:
+ break
if ["list", "monitor"].count(options["-o"]) == 1:
return machines
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=582aa5f7…
Commit: 582aa5f7f285e225928765fff50979154eafa138
Parent: 37bf2c9eb75b3ed98edfec6991110af82a1c5efa
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Thu Sep 27 13:00:37 2012 +0200
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Thu Sep 27 13:00:37 2012 +0200
fence_vmware_soap: Faster fencing, fix crash on VM without valid UUID
Improve speed of fencing by removing requests for attributes that are not needed. This change is significant
when there are hundrens of VM on vSphere server. On the systems with <10 VM improvement is still about 20%.
This patch also fixes situation when there are VM which do not have valid UUID. This can happend when P2V (physical
to virtual machine process) failed.
Patch was proposed by: Rodrigo A B Freire
Resolves: rhbz#836654
---
fence/agents/vmware_soap/fence_vmware_soap.py | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/fence/agents/vmware_soap/fence_vmware_soap.py b/fence/agents/vmware_soap/fence_vmware_soap.py
index 9bebd08..0da7f0d 100644
--- a/fence/agents/vmware_soap/fence_vmware_soap.py
+++ b/fence/agents/vmware_soap/fence_vmware_soap.py
@@ -44,9 +44,12 @@ def process_results(results, machines, uuid, mappingToUUID):
info = {}
for i in m.propSet:
info[i.name] = i.val
- machines[info["name"]] = (info["config.uuid"], info["summary.runtime.powerState"])
- uuid[info["config.uuid"]] = info["summary.runtime.powerState"]
- mappingToUUID[m.obj.value] = info["config.uuid"]
+ # Prevent error KeyError: 'config.uuid' when reaching systems which P2V failed,
+ # since these systems don't have a valid UUID
+ if info.has_key("config.uuid"):
+ machines[info["name"]] = (info["config.uuid"], info["summary.runtime.powerState"])
+ uuid[info["config.uuid"]] = info["summary.runtime.powerState"]
+ mappingToUUID[m.obj.value] = info["config.uuid"]
return (machines, uuid, mappingToUUID)
@@ -77,7 +80,7 @@ def get_power_status(conn, options):
propSpec = conn.factory.create('ns0:PropertySpec')
propSpec.all = False
- propSpec.pathSet = ["name", "summary.runtime.powerState", "config.uuid", "summary", "config", "capability", "network"]
+ propSpec.pathSet = ["name", "summary.runtime.powerState", "config.uuid"]
propSpec.type = "VirtualMachine"
propFilterSpec = conn.factory.create('ns0:PropertyFilterSpec')
@@ -101,6 +104,9 @@ def get_power_status(conn, options):
machines.update(more_machines)
uuid.update(more_uuid)
mappingToUUID.update(more_mappingToUUID)
+ # Do not run unnecessary SOAP requests
+ if options.has_key("-U") and options["-U"] in uuid:
+ break
if ["list", "monitor"].count(options["-o"]) == 1:
return machines
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=fdb96874…
Commit: fdb96874c75600864048a752c08aa1e45d2cc534
Parent: 693fdc9f79b3e3961fe1c562950c4ce76d274870
Author: Ryan O'Hara <rohara(a)redhat.com>
AuthorDate: Mon Sep 17 19:02:49 2012 -0500
Committer: Ryan O'Hara <rohara(a)redhat.com>
CommitterDate: Mon Sep 17 19:04:40 2012 -0500
Add metadata to list of accepted actions.
Resolves: rhbz#825667
Signed-off-by: Ryan O'Hara <rohara(a)redhat.com>
---
fence/agents/scsi/fence_scsi.8 | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/fence/agents/scsi/fence_scsi.8 b/fence/agents/scsi/fence_scsi.8
index f1a29ea..0d70930 100644
--- a/fence/agents/scsi/fence_scsi.8
+++ b/fence/agents/scsi/fence_scsi.8
@@ -41,13 +41,15 @@ and created registrations for each path.
.SH OPTIONS
.TP
\fB-o\fP \fIaction\fR
-Fencing action. This value can be "on", "off", or "status". All
-actions require either a key (see -k option) or node name (see -n
-option). For "on", the agent will attempt to register with the
-device(s) and create a reservation if none exists. The "off" action
-will attempt to remove a node's key from the device(s). The "status"
-action will report whether or not a node's key is currently register
-with one or more of the devices. The default action if "off".
+Fencing action. This value can be "on", "off", "status", or
+"metadata". The "on", "off", and "status" actions require either a key
+(see -k option) or node name (see -n option). For "on", the agent will
+attempt to register with the device(s) and create a reservation if
+none exists. The "off" action will attempt to remove a node's key from
+the device(s). The "status" action will report whether or not a node's
+key is currently register with one or more of the devices. The
+"metadata" action will display the XML metadata. The default action if
+"off".
.TP
\fB-d\fP \fIdevices\fR
List of devices to use for current operation. Devices can be
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=37bf2c9e…
Commit: 37bf2c9eb75b3ed98edfec6991110af82a1c5efa
Parent: 36559eaf7102932df1e3250f018a587c12c5ce67
Author: Ryan O'Hara <rohara(a)redhat.com>
AuthorDate: Mon Sep 17 19:02:49 2012 -0500
Committer: Ryan O'Hara <rohara(a)redhat.com>
CommitterDate: Mon Sep 17 19:03:35 2012 -0500
Add metadata to list of accepted actions.
Resolves: rhbz#825667
Signed-off-by: Ryan O'Hara <rohara(a)redhat.com>
---
fence/agents/scsi/fence_scsi.8 | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/fence/agents/scsi/fence_scsi.8 b/fence/agents/scsi/fence_scsi.8
index f1a29ea..0d70930 100644
--- a/fence/agents/scsi/fence_scsi.8
+++ b/fence/agents/scsi/fence_scsi.8
@@ -41,13 +41,15 @@ and created registrations for each path.
.SH OPTIONS
.TP
\fB-o\fP \fIaction\fR
-Fencing action. This value can be "on", "off", or "status". All
-actions require either a key (see -k option) or node name (see -n
-option). For "on", the agent will attempt to register with the
-device(s) and create a reservation if none exists. The "off" action
-will attempt to remove a node's key from the device(s). The "status"
-action will report whether or not a node's key is currently register
-with one or more of the devices. The default action if "off".
+Fencing action. This value can be "on", "off", "status", or
+"metadata". The "on", "off", and "status" actions require either a key
+(see -k option) or node name (see -n option). For "on", the agent will
+attempt to register with the device(s) and create a reservation if
+none exists. The "off" action will attempt to remove a node's key from
+the device(s). The "status" action will report whether or not a node's
+key is currently register with one or more of the devices. The
+"metadata" action will display the XML metadata. The default action if
+"off".
.TP
\fB-d\fP \fIdevices\fR
List of devices to use for current operation. Devices can be