> 
> Rodrigo Pereira wrote:
> > Hi,
> > 
> > I have a running cluster, with a couple of Xen VM's on top of DRBD.
> > 
> > I have colocation constraints for each Xen VM resource so they only 
> > start where the DRBD fs is mounted. Something like:
> > 
> > <rsc_colocation id="vm1_on_fs0" from="vm1" to="fs0" 
> score="INFINITY"/>
> > 
> > I created another Xen VM, and tried to add it to the 
> cluster. I have 
> > all resources on one xml file and all constraints on 
> another. I then 
> > use cib_admin to update each (i update constraints before 
> resources).
> > 
> > I thought it would respect the colocation constraint, but what i've 
> > found is that this resulted on this new VM trying to start on the 
> > second (DRBD
> > secondary) node, not the one where fs0 is mounted. So it 
> fails startup 
> > and stays unmanaged.
> > 
> > Why would this happen, any hints?
> > 
> > thank you,
> > rodrigo
> 
> can you please provide
> 
> 1) your two xml files
> 2) the _exact_ command(s) you use to update the running cib.xml
> 
> moreover, why do you keep the resources and constraints seperately?
> 

The files follow below.

I used:

# cibadmin -o constraints -R -x constraints.xml
# cibadmin -o resources -R -x resources.xml

I've then removed the resource and constraint (either on the GUI or using
cibadmin -D), created a file with only the new resource and add it with
cibadmin -C. I create with target_role "stopped", but it will always start
anyway on the secondary node.

I have no great reason to keep them separate, it just seemed tidy when i
started this setup.

The new resource is "vm-smb1". The rest of the cluster is up and running.


#### CONSTRAINTS #####

<constraints>

  <!-- LOCATIONS -->

  <rsc_location id="mail0-prefnode" rsc="mail0">
    <rule id="r1-mail0-prefnode" score="100">
      <expression attribute="#uname" id="e1-r1-mail0-prefnode"
operation="eq" value="node1"/>
    </rule>
  </rsc_location>

  <rsc_location id="ms-drbd0-prefnode" rsc="ms-drbd0">
    <rule id="r1-drbd0-prefnode" score="100" boolean_op="and" role="master">
      <expression attribute="#uname" id="e1-ms-drbd0-prefnode"
operation="eq" value="node1"/>
    </rule>
  </rsc_location>


  <!-- COLOCATIONS -->

  <rsc_colocation id="fs0_on_drbd0" from="fs0" to="ms-drbd0"
to_role="master" score="INFINITY"/>
  <rsc_colocation id="vm-svc1_on_fs0" from="vm-svc1" to="fs0"
score="INFINITY"/>
  <rsc_colocation id="vm-ebx1_on_fs0" from="vm-ebx1" to="fs0"
score="INFINITY"/>
  <rsc_colocation id="vm-smb1_on_fs0" from="vm-smb1" to="fs0"
score="INFINITY"/>


  <!-- ORDERING -->

  <rsc_order id="fs0_after_drbd0" from="fs0" to="ms-drbd0"
to_action="promote" action="start"/>
  <rsc_order id="vm-svc1_after_fs0" from="vm-svc1" action="start"
type="after" to="fs0"/>
  <rsc_order id="vm-ebx1_after_fs0" from="vm-ebx1" action="start"
type="after" to="fs0"/>
  <rsc_order id="vm-smb1_after_fs0" from="vm-smb1" action="start"
type="after" to="fs0"/>

</constraints> 


#### RESOURCES #####


<resources>

  <!-- MAIL NOTIFICATIONS -->

  <primitive id="mail0" type="MailTo" class="ocf" provider="heartbeat">


    <instance_attributes id="ia-mail0">
      <attributes
        <nvpair id="ia-mail0-1" name="email" value="[EMAIL PROTECTED]"/>
        <nvpair id="ia-mail0-2" name="subject" value="MY_CLUSTER"/>
      </attributes>
    </instance_attributes>

  </primitive>


  <!-- DRBD MASTER-SLAVE DEFINITION -->

  <master_slave id="ms-drbd0">

    <meta_attributes id="ma-ms-drbd0">
      <attributes>
        <nvpair id="ma-ms-drbd0-1" name="clone_max" value="2"/>
        <nvpair id="ma-ms-drbd0-2" name="clone_node_max" value="1"/>
        <nvpair id="ma-ms-drbd0-3" name="master_max" value="1"/>
        <nvpair id="ma-ms-drbd0-4" name="master_node_max" value="1"/>
        <nvpair id="ma-ms-drbd0-5" name="notify" value="yes"/>
        <nvpair id="ma-ms-drbd0-6" name="globally_unique" value="false"/>
        <nvpair id="ma-ms-drbd0-7" name="target_role" value="started"/>
      </attributes>
    </meta_attributes>

    <primitive id="drbd0" class="ocf" provider="heartbeat" type="drbd">

      <instance_attributes id="ia-drbd0">
        <attributes>
          <nvpair id="ia-drbd0-1" name="drbd_resource" value="drbd0"/>
        </attributes>
      </instance_attributes>

    </primitive>

  </master_slave>


  <!-- EXT3 FILESYSTEM ON TOP OF DRBD DEVICE -->
  <!-- CONTAINS XEN IMAGES -->

  <primitive id="fs0" type="Filesystem" class="ocf" provider="heartbeat">

    <meta_attributes id="ma-fs0">
      <attributes>
        <!-- <nvpair id="ma-fs0-1" name="target_role" value="started"/> -->
      </attributes>
    </meta_attributes>

    <instance_attributes id="ia-fs0">
      <attributes>
        <nvpair id="ia-fs0-1" name="fstype" value="ext3"/>
        <nvpair id="ia-fs0-2" name="directory" value="/drbd0"/>
        <nvpair id="ia-fs0-3" name="device" value="/dev/drbd0"/>
        <nvpair id="ia-fs0-4" name="target_role" value="started"/>
      </attributes>
    </instance_attributes>

  </primitive>


  <!-- XEN VM SERVICES INSTANCE 1 -->
  <!-- STANDARD PARA-VIRTUAL -->

  <primitive id="vm-svc1" class="ocf" type="Xen" provider="heartbeat">

    <operations>
      <op id="op-vm-svc1-1" name="monitor" interval="10s" timeout="120s"
prereq="nothing"/>
      <op id="op-vm-svc1-2" name="start" timeout="60s" start_delay="0"/>
      <op id="op-vm-svc1-3" name="stop" timeout="300s"/>
    </operations>

    <instance_attributes id="ia-vm-svc1">
      <attributes>
        <nvpair id="ia-vm-svc1-1" name="xmfile"
value="/etc/xen/vm/vm-svc1"/>
        <nvpair id="ia-vm-svc1-2" name="target_role" value="started"/>
      </attributes>
    </instance_attributes>

    <meta_attributes id="ma-vm-svc1">
      <attributes>
        <nvpair id="ma-vm-svc1-1" name="allow_migrate" value="false"/>
      </attributes>
    </meta_attributes>

  </primitive>


  <!-- XEN HVM INSTANCE 1 -->

  <primitive id="vm-ebx1" class="ocf" type="Xen" provider="heartbeat">

    <operations>
      <op id="op-vm-ebx1-1" name="monitor" interval="10s" timeout="120s"
prereq="nothing"/>
      <op id="op-vm-ebx1-2" name="start" timeout="60s" start_delay="0"/>
      <op id="op-vm-ebx1-3" name="stop" timeout="300s"/>
    </operations>

    <instance_attributes id="ia-vm-ebx1">
      <attributes>
        <nvpair id="ia-vm-ebx1-1" name="xmfile"
value="/etc/xen/vm/vm-ebx1"/>
        <nvpair id="ia-vm-ebx1-2" name="target_role" value="started"/>
      </attributes>
    </instance_attributes>

    <meta_attributes id="ma-vm-ebx1">
      <attributes>
        <nvpair id="ma-vm-ebx1-1" name="allow_migrate" value="false"/>
      </attributes>
    </meta_attributes>

  </primitive>

  <!-- XEN VM SAMBA INSTANCE 1 -->
  <!-- STANDARD PARA-VIRTUAL -->

  <primitive id="vm-smb1" class="ocf" type="Xen" provider="heartbeat">

    <operations>
      <op id="op-vm-smb1-1" name="monitor" interval="10s" timeout="120s"
prereq="nothing"/>
      <op id="op-vm-smb1-2" name="start" timeout="60s" start_delay="0"/>
      <op id="op-vm-smb1-3" name="stop" timeout="300s"/>
    </operations>

    <instance_attributes id="ia-vm-smb1">
      <attributes>
        <nvpair id="ia-vm-smb1-1" name="xmfile"
value="/etc/xen/vm/vm-smb1"/>
        <nvpair id="ia-vm-smb1-2" name="target_role" value="stopped"/>
      </attributes>
    </instance_attributes>

    <meta_attributes id="ma-vm-smb1">
      <attributes>
        <nvpair id="ma-vm-smb1-1" name="allow_migrate" value="false"/>
      </attributes>
    </meta_attributes>

  </primitive>
</resources>

_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems

Reply via email to