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">  
   <attributes>  
    <nvpair id="vip_1_ip" name="ip" value="192.168.1.1"></nvpair>  
    <nvpair id="vip_1_nic" name="nic" value="eth0"></nvpair>  
    <nvpair id="vip_1_netmask" name="netmask" value="255.244.255.0"></nvpair>  
   </attributes>  
  </instance_attributes>  
    <meta_attributes id="vip_1_meta_attrs">  
     <attributes>  
      <nvpair id="vip_1_metaattr_resource_stickiness" name="resource_stickiness" value="INFINITY">
     </nvpair>  
     <nvpair id="vip_1_metaattr_target_role" name="target_role" value="started">   
     </nvpair>
  </attributes>  
 </meta_attributes></primitive></group>

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>‘