[ClusterLabs] Antw: Re: to change resource id - how?
Ulrich.Windl at rz.uni-regensburg.de
Tue Apr 4 02:07:38 EDT 2017
>>> Ken Gaillot <kgaillot at redhat.com> schrieb am 03.04.2017 um 16:26 in Nachricht
<c7f4290c-ef8b-a4cb-bada-e93a8a86d134 at redhat.com>:
> On 04/03/2017 06:35 AM, lejeczek wrote:
>> I'm sroogling and reading but cannot find any info - how to
>> (programmatically) change resources ids? In other words: how to rename
>> these entities?
>> many thanks
> As far as I know, higher-level tools don't support this directly -- you
> have to edit the XML. The basic process is:
> 1. Save a copy of the live CIB to a file.
> 2. Edit that file, and do a search-and-replace on the desired name (so
> you change it in constraints, etc., as well as the resource definition).
> 3. Push the configuration section of that file to the live CIB.
> The higher-level tools have commands to do that, but at the low level,
> it would be something like:
> 1. cibadmin -Q --scope configuration > tmp.cib
> 2. vim tmp.cib
> 3. cibadmin -x tmp.cib --replace --scope configuration
> The cluster will treat it as a completely new resource, so it will stop
> the old one and start the new one.
In my experience it's very much advisable to stop any resource that is to be renamed _before_ doing so. Maybe the software became smarter since I suffered from problems, but it seems wise anyway...
> Users mailing list: Users at clusterlabs.org
> Project Home: http://www.clusterlabs.org
> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
> Bugs: http://bugs.clusterlabs.org
More information about the Users