* [Cluster-devel] conga/ricci docs/storage_api.html modules/stor ...
@ 2006-07-12 16:52 kupcevic
0 siblings, 0 replies; 2+ messages in thread
From: kupcevic @ 2006-07-12 16:52 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: conga
Changes by: kupcevic at sourceware.org 2006-07-12 16:52:56
Modified files:
ricci/docs : storage_api.html
ricci/modules/storage: LVM.cpp
Added files:
ricci/modules/storage: ClusterNotQuorateError.h
Log message:
storage module: prevent lvm tools to hang due to lack of cluster quorum
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/docs/storage_api.html.diff?cvsroot=cluster&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/ClusterNotQuorateError.h.diff?cvsroot=cluster&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/LVM.cpp.diff?cvsroot=cluster&r1=1.3&r2=1.4
--- conga/ricci/docs/storage_api.html 2006/06/28 20:09:08 1.3
+++ conga/ricci/docs/storage_api.html 2006/07/12 16:52:56 1.4
@@ -5,7 +5,7 @@
<TITLE>Storage Module</TITLE>
<META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.2 (Linux)">
<META NAME="CREATED" CONTENT="20060410;13011800">
- <META NAME="CHANGED" CONTENT="20060626;19014000">
+ <META NAME="CHANGED" CONTENT="20060712;12410300">
</HEAD>
<BODY LANG="en-US" DIR="LTR">
<P>Storage module manages all aspects of storage. Supports partition
@@ -73,6 +73,11 @@
start clvmd: <BR>1. lvm2-cluster needs to be installed<BR>2. cluster
infrastructure needs to be started<BR>3. clvmd should be started
(service clvmd start)</P>
+ <LI><P>5 ??? cluster not quorate<BR>LVM is configured to use cluster
+ locking mechanism, but cluster is not quorate. That would cause LVM
+ operations to hang until quorum is regained. User should make
+ cluster quorate before continuing.
+ </P>
</UL>
<P><BR><BR>
</P>
/cvs/cluster/conga/ricci/modules/storage/ClusterNotQuorateError.h,v --> standard output
revision 1.1
--- conga/ricci/modules/storage/ClusterNotQuorateError.h
+++ - 2006-07-12 16:52:56.900818000 +0000
@@ -0,0 +1,41 @@
+/*
+ Copyright Red Hat, Inc. 2006
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation; either version 2, or (at your option) any
+ later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
+ MA 02139, USA.
+*/
+/*
+ * Author: Stanko Kupcevic <kupcevic@redhat.com>
+ */
+
+
+#ifndef ClusterNotQuorateError_h
+#define ClusterNotQuorateError_h
+
+#include "Except.h"
+
+
+class ClusterNotQuorateError : public Except
+{
+ public:
+ ClusterNotQuorateError()
+ : Except(5, std::string("Quorum required, but cluster not quorate")) {}
+ virtual ~ClusterNotQuorateError()
+ {}
+
+};
+
+
+#endif // ClusterNotQuorateError_h
--- conga/ricci/modules/storage/LVM.cpp 2006/06/28 20:09:08 1.3
+++ conga/ricci/modules/storage/LVM.cpp 2006/07/12 16:52:56 1.4
@@ -28,6 +28,7 @@
#include "LV.h"
#include "defines.h"
#include "ClvmdError.h"
+#include "ClusterNotQuorateError.h"
#include <vector>
@@ -690,10 +691,20 @@
LVM::check_locking()
{
if (get_locking_type() == "2") {
- // try to start clvmd, if not running
+ // check if quorate
string out, err;
int status;
vector<string> args;
+ args.push_back("quorum");
+ if (utils::execute("/sbin/magma_tool", args, out, err, status))
+ throw string("execute failed");
+ if (status)
+ throw string("cluster tools: magma_tool errored");
+ if (out.find("Quorate") == out.npos)
+ throw ClusterNotQuorateError();
+
+ // try to start clvmd, if not running
+ args.clear();
args.push_back("clvmd");
args.push_back("start");
if (utils::execute("/sbin/service", args, out, err, status))
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Cluster-devel] conga/ricci docs/storage_api.html modules/stor ...
@ 2006-10-16 20:26 kupcevic
0 siblings, 0 replies; 2+ messages in thread
From: kupcevic @ 2006-10-16 20:26 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: conga
Changes by: kupcevic at sourceware.org 2006-10-16 20:26:48
Modified files:
ricci/docs : storage_api.html
ricci/modules/storage: StorageModule.cpp
Log message:
storage module: remove_mapper_source() - unimplemented function, here to satisfy API
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/docs/storage_api.html.diff?cvsroot=cluster&r1=1.4&r2=1.5
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/StorageModule.cpp.diff?cvsroot=cluster&r1=1.4&r2=1.5
--- conga/ricci/docs/storage_api.html 2006/07/12 16:52:56 1.4
+++ conga/ricci/docs/storage_api.html 2006/10/16 20:26:48 1.5
@@ -245,6 +245,32 @@
<P ALIGN=LEFT>On failure: <BR>- Any of errors specified above</P>
</UL>
<LI><P ALIGN=LEFT>remove_mapper_source</P>
+</UL>
+<UL>
+ <UL>
+ <P ALIGN=LEFT>Remove source from mapper. <BR>Source removal
+ procedure: <BR>1 ??? retrieve mapper<BR>2 ??? extract block
+ device, which has alternative content, from <sources/> tag
+ <BR>3 ??? submit block
+ device, from 2, and mapper attributes, using this function</P>
+ <P ALIGN=LEFT>Input variables: <BR>- ???bd??? (xml) ???
+ <A HREF="storage-bds.html"><block_device/></A>, from
+ mapper's <sources/> tag, to be removed<BR>-
+ ???mapper_type??? (string) ??? type of mapper from which source
+ is to be removed<BR>- ???mapper_id??? (string) ??? ID of mapper from
+ which source is to be removed<BR>- ???mapper_state_ind???
+ (string) ??? state indicator of mapper from which source is to
+ be removed</P>
+ </UL>
+</UL>
+<UL>
+ <UL>
+ <P ALIGN=LEFT>Output variables: <BR>- ???mapper??? (xml) ???
+ <A HREF="storage-mappers.html"><mapper/></A> with source
+ removed
+ </P>
+ <P ALIGN=LEFT>On failure: <BR>- Any of errors specified above</P>
+ </UL>
<LI><P ALIGN=LEFT>remove_mapper</P>
</UL>
<UL>
@@ -351,4 +377,4 @@
<P ALIGN=LEFT><BR><BR>
</P>
</BODY>
-</HTML>
\ No newline at end of file
+</HTML>
--- conga/ricci/modules/storage/StorageModule.cpp 2006/08/10 22:53:09 1.4
+++ conga/ricci/modules/storage/StorageModule.cpp 2006/10/16 20:26:48 1.5
@@ -40,6 +40,7 @@
static VarMap create_mapper(const VarMap& args);
static VarMap remove_mapper(const VarMap& args);
static VarMap add_sources(const VarMap& args);
+static VarMap remove_source(const VarMap& args);
static VarMap modify_mapper(const VarMap& args);
static VarMap create_bd(const VarMap& args);
static VarMap get_bd(const VarMap& args);
@@ -69,9 +70,10 @@
api_1_0["get_mapper_templates"] = get_mapper_templates;
api_1_0["create_mapper"] = create_mapper;
+ api_1_0["modify_mapper"] = modify_mapper;
api_1_0["remove_mapper"] = remove_mapper;
api_1_0["add_mapper_sources"] = add_sources;
- api_1_0["modify_mapper"] = modify_mapper;
+ api_1_0["remove_mapper_source"] = remove_source;
api_1_0["create_bd"] = create_bd;
api_1_0["get_bd"] = get_bd;
@@ -267,6 +269,51 @@
return ret;
}
+VarMap
+remove_source(const VarMap& args)
+{
+ String mapper_type, mapper_id, mapper_state_ind;
+ XMLObject bd;
+ try {
+ VarMap::const_iterator iter = args.find("mapper_type");
+ if (iter == args.end())
+ throw APIerror("missing mapper_type variable");
+ mapper_type = iter->second.get_string();
+
+ iter = args.find("mapper_id");
+ if (iter == args.end())
+ throw APIerror("missing mapper_id variable");
+ mapper_id = iter->second.get_string();
+
+ iter = args.find("mapper_state_ind");
+ if (iter == args.end())
+ throw APIerror("missing mapper_state_ind variable");
+ mapper_state_ind = iter->second.get_string();
+
+ iter = args.find("bd");
+ if (iter == args.end())
+ throw APIerror("missing bd variable");
+ bd = iter->second.get_XML();
+ } catch ( String e ) {
+ throw APIerror(e);
+ }
+
+ throw String("remove_mapper_source() function not implemented");
+
+ /*
+ BDParsed parsed_bd(bd);
+ counting_auto_ptr<Mapper> mapper = MapperFactory::remove_source(mapper_type,
+ mapper_id,
+ mapper_state_ind,
+ parsed_bd);
+
+ Variable var("mapper", mapper->xml());
+ VarMap ret;
+ ret.insert(pair<String, Variable>(var.name(), var));
+ return ret;
+ */
+}
+
VarMap
create_bd(const VarMap& args)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-10-16 20:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-12 16:52 [Cluster-devel] conga/ricci docs/storage_api.html modules/stor kupcevic
-- strict thread matches above, loose matches on Subject: below --
2006-10-16 20:26 kupcevic
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).