FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Cluster Development

 
 
LinkBack Thread Tools
 
Old 03-19-2008, 01:45 PM
 
Default conga ./conga.spec.in.in ricci/modules/cluster ...

CVSROOT: /cvs/cluster
Module name: conga
Branch: RHEL5
Changes by: rmccabe@sourceware.org 2008-03-19 14:45:34

Modified files:
. : conga.spec.in.in
ricci/modules/cluster: ClusterModule.cpp Makefile Virt.cpp
Virt.h
Added files:
ricci/test_suite/cluster: vm_list.xml

Log message:
Fix bz206570: vm list from ricci

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/conga.spec.in.in.diff?cvsroot=cluster&only_with_ta g=RHEL5&r1=1.45.2.71&r2=1.45.2.72
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/ClusterModule.cpp.diff?cvsroot=cluster&only_with_t ag=RHEL5&r1=1.5.2.4&r2=1.5.2.5
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/Makefile.diff?cvsroot=cluster&only_with_tag=RHEL5& r1=1.14.2.4&r2=1.14.2.5
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/Virt.cpp.diff?cvsroot=cluster&only_with_tag=RHEL5& r1=1.1.2.3&r2=1.1.2.4
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/Virt.h.diff?cvsroot=cluster&only_with_tag=RHEL5&r1 =1.1.2.3&r2=1.1.2.4
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/cluster/vm_list.xml.diff?cvsroot=cluster&only_with_tag=RHE L5&r1=NONE&r2=1.1.2.1

--- conga/conga.spec.in.in 2008/03/12 15:13:12 1.45.2.71
+++ conga/conga.spec.in.in 2008/03/19 14:45:33 1.45.2.72
@@ -295,6 +295,7 @@
* Wed Feb 27 2008 Ryan McCabe <rmccabe@redhat.com> 0.12.0-6
- Fix bz434586 (Resource tree does not display multiple children of a parent correctly)
- Fix bz304931 (Rich Sybase resource agent configuration support)
+- Fix bz206570 (RFE: vm list from ricci)

* Tue Feb 12 2008 Ryan McCabe <rmccabe@redhat.com> 0.12.0-5
- Fix bz432533 (Do not attempt to install the cmirror package when shared storage is requested)
--- conga/ricci/modules/cluster/ClusterModule.cpp 2008/01/17 17:38:37 1.5.2.4
+++ conga/ricci/modules/cluster/ClusterModule.cpp 2008/03/19 14:45:33 1.5.2.5
@@ -50,6 +50,7 @@
static VarMap set_xvm_key(const VarMap& args);
static VarMap get_xvm_key(const VarMap& args);
static VarMap generate_xvm_key(const VarMap& args);
+static VarMap list_vm(const VarMap& args);

static ApiFcnMap build_fcn_map();

@@ -87,6 +88,7 @@
api_1_0["get_xvm_key"] = get_xvm_key;
api_1_0["generate_xvm_key"] = generate_xvm_key;
api_1_0["virt_guest"] = virt_guest;
+ api_1_0["list_vm"] = list_vm;


ApiFcnMap api_fcn_map;
@@ -233,6 +235,42 @@
}

VarMap
+list_vm(const VarMap& args)
+{
+ String hypervisor_uri = "";
+
+ try {
+ VarMap::const_iterator iter = args.find("hypervisor_uri");
+
+ if (iter != args.end())
+ hypervisor_uri = iter->second.get_string();
+ } catch ( String e ) {
+ throw APIerror(e);
+ }
+
+ if (!hypervisor_uri.size())
+ hypervisor_uri = String(DEFAULT_HV_URI);
+
+ std::map<String, String> vm_list = Virt::get_vm_list(hypervisor_uri);
+
+ list<XMLObject> ids_list;
+ for ( map<String,String>::iterator iter = vm_list.begin() ;
+ iter != vm_list.end();
+ iter++)
+ {
+ XMLObject id_xml("vm");
+ id_xml.set_attr("domain", String(iter->first));
+ id_xml.set_attr("status", String(iter->second));
+ ids_list.push_back(id_xml);
+ }
+
+ Variable var("vm_list", ids_list);
+ VarMap ret;
+ ret.insert(pair<String, Variable>(var.name(), var));
+ return ret;
+}
+
+VarMap
delete_xvm_key(const VarMap& args) {
Virt::delete_xvm_key();
VarMap ret;
--- conga/ricci/modules/cluster/Makefile 2008/01/17 17:38:37 1.14.2.4
+++ conga/ricci/modules/cluster/Makefile 2008/03/19 14:45:33 1.14.2.5
@@ -27,6 +27,7 @@
PARANOID=0
INCLUDE += -I${top_srcdir}/common/
CXXFLAGS += -DPARANOIA=$(PARANOID)
+LDFLAGS += -lvirt

ifeq ($(PARANOID), 1)
LDFLAGS += ${top_srcdir}/common/paranoid/*.o
--- conga/ricci/modules/cluster/Virt.cpp 2008/01/17 17:38:37 1.1.2.3
+++ conga/ricci/modules/cluster/Virt.cpp 2008/03/19 14:45:33 1.1.2.4
@@ -17,15 +17,16 @@
*/

extern "C" {
-#include <unistd.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <string.h>
-#include <errno.h>
+ #include <unistd.h>
+ #include <stdlib.h>
+ #include <fcntl.h>
+ #include <sys/stat.h>
+ #include <string.h>
+ #include <errno.h>
+ #include <libvirt/libvirt.h>

-#include "sys_util.h"
-#include "base64.h"
+ #include "sys_util.h"
+ #include "base64.h"
}

#include "Virt.h"
@@ -176,3 +177,81 @@
throw String("error retrieving key");
return (key_out);
}
+
+map<String, String> Virt::get_vm_list(const String &hvURI) {
+ std::map<String, String> vm_list;
+ int i;
+ int ret;
+ int num_doms;
+ virConnectPtr con = NULL;
+
+ con = virConnectOpenReadOnly(hvURI.c_str());
+ if (con == NULL)
+ throw String("unable to connect to virtual machine manager");
+
+
+ num_doms = virConnectNumOfDefinedDomains(con);
+ if (num_doms < 1) {
+ virConnectClose(con);
+ throw String("Unable to get the number of defined domains");
+ }
+
+ if (num_doms > 0) {
+ char **dom = (char **) calloc(num_doms, sizeof(char *));
+ if (!dom) {
+ virConnectClose(con);
+ throw String("Out of memory");
+ }
+
+ ret = virConnectListDefinedDomains(con, dom, num_doms);
+ if (ret < 0) {
+ free(dom);
+ virConnectClose(con);
+ throw String("Unable to list defined domains");
+ }
+
+ for (i = 0 ; i < ret ; i++) {
+ if (dom[i] != NULL) {
+ vm_list.insert(
+ pair<String,String>(String(dom[i]), String("inactive")));
+ free(dom[i]);
+ }
+ }
+
+ free(dom);
+ }
+
+ num_doms = virConnectNumOfDomains(con);
+ if (num_doms < 0) {
+ virConnectClose(con);
+ throw String("Unable to get the number of defined domains");
+ }
+
+ if (num_doms > 0) {
+ int *active_doms = (int *) calloc(sizeof(int), num_doms);
+ ret = virConnectListDomains(con, active_doms, num_doms);
+ if (ret > 0) {
+ for (i = 0 ; i < ret ; i++) {
+ const char *name;
+ if (active_doms[i] == 0) {
+ /* Skip dom0 */
+ continue;
+ }
+
+ virDomainPtr vdp = virDomainLookupByID(con, active_doms[i]);
+ if (vdp == NULL)
+ continue;
+
+ name = virDomainGetName(vdp);
+ if (name != NULL) {
+ vm_list.insert(
+ pair<String,String>(String(name), String("active")));
+ }
+ }
+ }
+ free(active_doms);
+ }
+
+ virConnectClose(con);
+ return vm_list;
+}
--- conga/ricci/modules/cluster/Virt.h 2008/01/17 17:38:37 1.1.2.3
+++ conga/ricci/modules/cluster/Virt.h 2008/03/19 14:45:33 1.1.2.4
@@ -20,6 +20,7 @@
#define __CONGA_MODCLUSTER_VIRT_H

#include "String.h"
+#include <map>

#define XVM_KEY_PATH "/etc/cluster/fence_xvm.key"
#define XVM_KEY_MAX_SIZE 4096
@@ -27,9 +28,11 @@
#define XVM_KEY_DEFAULT_SIZE 4096

#define DMIDECODE_PATH "/usr/sbin/dmidecode"
+#define DEFAULT_HV_URI "xen:///"

class Virt {
public:
+ static std::map<String, String> get_vm_list(const String& hvURI);
static bool virt_guest(void);
static bool delete_xvm_key(void);
static bool set_xvm_key(const char *key_base64);
/cvs/cluster/conga/ricci/test_suite/cluster/vm_list.xml,v --> standard output
revision 1.1.2.1
--- conga/ricci/test_suite/cluster/vm_list.xml
+++ - 2008-03-19 14:45:35.123844000 +0000
@@ -0,0 +1,13 @@
+<?xml version="1.0" ?>
+<ricci version="1.0" function="process_batch" async="false">
+<batch>
+
+<module name="cluster">
+<request sequence="1254" API_version="1.0">
+<function_call name="list_vm" />
+</request>
+</module>
+
+</batch>
+</ricci>
+
 
Old 04-14-2008, 03:55 PM
 
Default conga ./conga.spec.in.in ricci/modules/cluster ...

CVSROOT: /cvs/cluster
Module name: conga
Branch: RHEL4
Changes by: rmccabe@sourceware.org 2008-04-14 15:55:09

Modified files:
. : conga.spec.in.in
ricci/modules/cluster: ClusterStatus.cpp
ricci/modules/rpm: PackageHandler.cpp
ricci/modules/service: ServiceManager.cpp

Log message:
Fix bz442369: conga should install 'sg3_utils' and start service 'scsi_reserve' when scsi fencing is used

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/conga.spec.in.in.diff?cvsroot=cluster&only_with_ta g=RHEL4&r1=1.67.2.23&r2=1.67.2.24
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/ClusterStatus.cpp.diff?cvsroot=cluster&only_with_t ag=RHEL4&r1=1.16.2.4&r2=1.16.2.5
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/rpm/PackageHandler.cpp.diff?cvsroot=cluster&only_with_ tag=RHEL4&r1=1.11.2.4&r2=1.11.2.5
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/service/ServiceManager.cpp.diff?cvsroot=cluster&only_with_ tag=RHEL4&r1=1.7.2.4&r2=1.7.2.5

--- conga/conga.spec.in.in 2008/04/11 06:48:10 1.67.2.23
+++ conga/conga.spec.in.in 2008/04/14 15:55:08 1.67.2.24
@@ -301,6 +301,7 @@

%changelog
* Tue Mar 25 2008 Ryan McCabe <rmccabe@redhat.com> 0.11.1-2
+- Fix bz442369 (conga should install 'sg3_utils' and start service 'scsi_reserve' when scsi fencing is used)
- Fix bz441574 (nodename" field for fence_scsi disabled when adding a new fence device/instance)
- Fix bz349561 (Add Conga support for Oracle Resource Agent)
- Fix bz369131 (RFE: should only have to enter a system's password once)
--- conga/ricci/modules/cluster/ClusterStatus.cpp 2008/03/25 01:27:15 1.16.2.4
+++ conga/ricci/modules/cluster/ClusterStatus.cpp 2008/04/14 15:55:08 1.16.2.5
@@ -218,6 +218,7 @@
run_initd("clvmd", true, false);
run_initd("gfs", true, false);
run_initd("rgmanager", true, true);
+ run_initd("scsi_reserve", true, false);

if (enable_services) {
// enable them on boot
@@ -239,6 +240,7 @@
run_chkconfig("clvmd", true);
run_chkconfig("gfs", true);
run_chkconfig("rgmanager", true);
+ run_chkconfig("scsi_reserve", true);
}
} else if (stat.get_attr("cluster_version") == "5") {
try {
@@ -266,6 +268,7 @@
run_initd("clvmd", true, false);
run_initd("gfs", true, false);
run_initd("gfs2", true, false);
+ run_initd("scsi_reserve", true, false);
run_initd("rgmanager", true, true);

if (enable_services) {
@@ -278,6 +281,7 @@
run_chkconfig("clvmd", true);
run_chkconfig("gfs", true);
run_chkconfig("gfs2", true);
+ run_chkconfig("scsi_reserve", true);
run_chkconfig("rgmanager", true);
}
} else {
--- conga/ricci/modules/rpm/PackageHandler.cpp 2008/03/25 01:27:18 1.11.2.4
+++ conga/ricci/modules/rpm/PackageHandler.cpp 2008/04/14 15:55:08 1.11.2.5
@@ -493,6 +493,7 @@

PackageSet set("Clustered Storage");
set.packages.push_back("lvm2-cluster");
+ set.packages.push_back("sg3_utils");

if (RHEL4 || FC5) {
set.packages.push_back("GFS");
--- conga/ricci/modules/service/ServiceManager.cpp 2008/03/25 01:27:19 1.7.2.4
+++ conga/ricci/modules/service/ServiceManager.cpp 2008/04/14 15:55:08 1.7.2.5
@@ -519,11 +519,13 @@
descr = "Shared Storage: clvmd, gfs";
servs.push_back("clvmd");
servs.push_back("gfs");
+ servs.push_back("scsi_reserve");
} else if (RHEL5 || FC6) {
descr = "Shared Storage: clvmd, gfs, gfs2";
servs.push_back("clvmd");
servs.push_back("gfs");
servs.push_back("gfs2");
+ servs.push_back("scsi_reserve");
}
s = ServiceSet(name, descr);
if (populate_set(s, servs))
 

Thread Tools




All times are GMT. The time now is 09:38 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org