August 14, 2008 · CentoOS Cluster Linux-HA

Configure Resource on LVS cluster

To add an ip resource who’s a member of group “ip_group” create an xml file :

<group id="group_vips">
 <primitive class="ocf" id="vip_1" provider="heartbeat" type="IPaddr2">
  <instance_attributes id="vip_170_instance_attrs">  
    <nvpair id="vip_1_ip" name="ip" value=""></nvpair>  
    <nvpair id="vip_1_nic" name="nic" value="eth0"></nvpair>  
    <nvpair id="vip_1_netmask" name="netmask" value=""></nvpair>  
    <meta_attributes id="vip_1_meta_attrs">  
      <nvpair id="vip_1_metaattr_resource_stickiness" name="resource_stickiness" value="INFINITY">
     <nvpair id="vip_1_metaattr_target_role" name="target_role" value="started">   

import the resource using :

cibadmin -V -M -o resources -x file.xml

( note you are using -M to modify the existing group … )
delete the resource :

cibadmin -V -D -o resources -X’ <primitive id="vip_1"></primitive>‘