<div dir="ltr">Thanks Mats, this was the reason for me to give up on drbd 9 when I was testing about 2-3 months ago.<br><div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 30, 2016 at 9:50 PM, Mats Ramnefors <span dir="ltr">&lt;<a href="mailto:mats@ramnefors.com" target="_blank">mats@ramnefors.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Patch below.<div><br></div><div>For me it did not work to apply the patch â€as is”. I had to manually edit in the changes. </div><div><br></div><div>Do not understand why, but I am no expert on patching so it may work for you.</div><div><br></div><div>With the changes applied, the RA seems to work OK.</div><div><br></div><div>/Mats<br><div><br></div><div><div>++++++ support-drbd9-ra.patch ++++++</div><div>diff --git a/scripts/drbd.ocf b/scripts/drbd.ocf</div><div>index 632e16e..91990fc 100755</div><div>--- a/scripts/drbd.ocf</div><div>+++ b/scripts/drbd.ocf</div><div>@@ -328,6 +328,23 @@ remove_master_score() {</div><div>  Â  Â  Â  do_cmd ${HA_SBIN_DIR}/crm_master -l reboot -D</div><div> }</div><div> </div><div>+_peer_node_process() {</div><div>+ Â  Â  Â  # _since drbd9 support multiple connections</div><div>+ Â  Â  Â  : ${_peer_node_id:=0}</div><div>+ Â  Â  Â  DRBD_PER_NAME[$_peer_node_id]=$_conn_name</div><div>+ Â  Â  Â  DRBD_PER_ID[$_peer_node_id]=$_peer_node_id</div><div>+ Â  Â  Â  DRBD_PER_CSTATE[$_peer_node_id]=$_cstate</div><div>+ Â  Â  Â  DRBD_PER_ROLE_REMOTE[$_peer_node_id]=${_peer:-Unknown}</div><div>+ Â  Â  Â  DRBD_PER_DSTATE_REMOTE[$_peer_node_id]=${_pdsk:-DUnknown}</div><div>+</div><div>+ Â  Â  Â  : == DEBUG == _peer_node_id Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  == ${_peer_node_id} ==</div><div>+ Â  Â  Â  : == DEBUG == DRBD_PER_NAME[_peer_node_id] Â  Â  Â  Â  Â == ${DRBD_PER_NAME[${_peer_node_id}]} ==</div><div>+ Â  Â  Â  : == DEBUG == DRBD_PER_ID[_peer_node_id] Â  Â  Â  Â  Â  Â == ${DRBD_PER_ID[${_peer_node_id}]} ==</div><div>+ Â  Â  Â  : == DEBUG == DRBD_PER_CSTATE[_peer_node_id] Â  Â  Â  Â == ${DRBD_PER_CSTATE[${_peer_node_id}]} ==</div><div>+ Â  Â  Â  : == DEBUG == DRBD_PER_ROLE_REMOTE[_peer_node_id] Â  == ${DRBD_PER_ROLE_REMOTE[${_peer_node_id}]} ==</div><div>+ Â  Â  Â  : == DEBUG == DRBD_PER_DSTATE_REMOTE[_peer_node_id] == ${DRBD_PER_DSTATE_REMOTE[${_peer_node_id}]} ==</div><div>+}</div><div>+</div><div> _sh_status_process() {</div><div>  Â  Â  Â  # _volume not present should not happen,</div><div>  Â  Â  Â  # but may help make this agent work even if it talks to drbd 8.3.</div><div>@@ -335,11 +352,36 @@ _sh_status_process() {</div><div>  Â  Â  Â  # not-yet-created volumes are reported as -1</div><div>  Â  Â  Â  (( _volume &gt;= 0 )) || _volume=$[1 &lt;&lt; 16]</div><div>  Â  Â  Â  DRBD_ROLE_LOCAL[$_volume]=${_role:-Unconfigured}</div><div>- Â  Â  Â  DRBD_ROLE_REMOTE[$_volume]=${_peer:-Unknown}</div><div>- Â  Â  Â  DRBD_CSTATE[$_volume]=$_cstate</div><div>  Â  Â  Â  DRBD_DSTATE_LOCAL[$_volume]=${_disk:-Unconfigured}</div><div>- Â  Â  Â  DRBD_DSTATE_REMOTE[$_volume]=${_pdsk:-DUnknown}</div><div>+</div><div>+ Â  Â  Â  if $DRBD_VERSION_9 ; then</div><div>+ Â  Â  Â  Â  Â  Â  Â  #Get from _peer_node_process</div><div>+ Â  Â  Â  Â  Â  Â  Â  DRBD_NAME[$_volume]=${DRBD_PER_NAME[@]}</div><div>+ Â  Â  Â  Â  Â  Â  Â  DRBD_ID[$_volume]=${DRBD_PER_ID[@]}</div><div>+ Â  Â  Â  Â  Â  Â  Â  DRBD_VOLUME[$_volume]=${_volume}</div><div>+ Â  Â  Â  Â  Â  Â  Â  DRBD_CSTATE[$_volume]=${DRBD_PER_CSTATE[@]}</div><div>+ Â  Â  Â  Â  Â  Â  Â  DRBD_ROLE_REMOTE[$_volume]=${DRBD_PER_ROLE_REMOTE[@]}</div><div>+ Â  Â  Â  Â  Â  Â  Â  DRBD_DSTATE_REMOTE[$_volume]=${DRBD_PER_DSTATE_REMOTE[@]}</div><div>+</div><div>+ Â  Â  Â  Â  Â  Â  Â  DRBD_PER_NAME=()</div><div>+ Â  Â  Â  Â  Â  Â  Â  DRBD_PER_ID=()</div><div>+ Â  Â  Â  Â  Â  Â  Â  DRBD_PER_CSTATE=()</div><div>+ Â  Â  Â  Â  Â  Â  Â  DRBD_PER_ROLE_REMOTE=()</div><div>+ Â  Â  Â  Â  Â  Â  Â  DRBD_PER_DSTATE_REMOTE=()</div><div>+</div><div>+ Â  Â  Â  Â  Â  Â  Â  : == DEBUG == _volume Â  Â  Â  Â  Â  Â == ${_volume} ==</div><div>+ Â  Â  Â  Â  Â  Â  Â  : == DEBUG == DRBD_ROLE_LOCAL Â  Â == ${DRBD_ROLE_LOCAL[${_volume}]} ==</div><div>+ Â  Â  Â  Â  Â  Â  Â  : == DEBUG == DRBD_DSTATE_LOCAL Â == ${DRBD_DSTATE_LOCAL[${_volume}]} ==</div><div>+ Â  Â  Â  Â  Â  Â  Â  : == DEBUG == DRBD_CSTATE Â  Â  Â  Â == ${DRBD_CSTATE[${_volume}]} ==</div><div>+ Â  Â  Â  Â  Â  Â  Â  : == DEBUG == DRBD_ROLE_REMOTE Â  == ${DRBD_ROLE_REMOTE[${_volume}]} ==</div><div>+ Â  Â  Â  Â  Â  Â  Â  : == DEBUG == DRBD_DSTATE_REMOTE == ${DRBD_DSTATE_REMOTE[${_volume}]} ==</div><div>+ Â  Â  Â  else</div><div>+ Â  Â  Â  Â  Â  Â  Â  DRBD_CSTATE[$_volume]=$_cstate</div><div>+ Â  Â  Â  Â  Â  Â  Â  DRBD_ROLE_REMOTE[$_volume]=${_peer:-Unknown}</div><div>+ Â  Â  Â  Â  Â  Â  Â  DRBD_DSTATE_REMOTE[$_volume]=${_pdsk:-DUnknown}</div><div>+ Â  Â  Â  fi</div><div>}</div><div>+</div><div> drbd_set_status_variables() {</div><div>  Â  Â  Â  # drbdsetup sh-status prints these values to stdout,</div><div>  Â  Â  Â  # and then prints _sh_status_process.</div><div>@@ -352,6 +394,15 @@ drbd_set_status_variables() {</div><div>  Â  Â  Â  local _resynced_percent</div><div>  Â  Â  Â  local out</div><div> </div><div>+ Â  Â  Â  if $DRBD_VERSION_9 ; then</div><div>+ Â  Â  Â  Â  Â  Â  Â  local _peer_node_id _conn_name</div><div>+ Â  Â  Â  Â  Â  Â  Â  DRBD_PER_NAME=()</div><div>+ Â  Â  Â  Â  Â  Â  Â  DRBD_PER_ID=()</div><div>+ Â  Â  Â  Â  Â  Â  Â  DRBD_PER_CSTATE=()</div><div>+ Â  Â  Â  Â  Â  Â  Â  DRBD_PER_ROLE_REMOTE=()</div><div>+ Â  Â  Â  Â  Â  Â  Â  DRBD_PER_DSTATE_REMOTE=()</div><div>+ Â  Â  Â  fi</div><div>+</div><div>  Â  Â  Â  DRBD_ROLE_LOCAL=()</div><div>  Â  Â  Â  DRBD_ROLE_REMOTE=()</div><div>  Â  Â  Â  DRBD_CSTATE=()</div><div>@@ -369,16 +420,20 @@ drbd_set_status_variables() {</div><div>  Â  Â  Â  # if there was no output at all, or a weird output</div><div>  Â  Â  Â  # make sure the status arrays won&#39;t be empty.</div><div>  Â  Â  Â  [[ ${#DRBD_ROLE_LOCAL[@]} Â  Â != 0 ]] || DRBD_ROLE_LOCAL=(Unconfigured)</div><div>- Â  Â  Â  [[ ${#DRBD_ROLE_REMOTE[@]} Â  != 0 ]] || DRBD_ROLE_REMOTE=(Unknown)</div><div>- Â  Â  Â  [[ ${#DRBD_CSTATE[@]} Â  Â  Â  Â != 0 ]] || DRBD_CSTATE=(Unconfigured)</div><div>  Â  Â  Â  [[ ${#DRBD_DSTATE_LOCAL[@]} Â != 0 ]] || DRBD_DSTATE_LOCAL=(Unconfigured)</div><div>+ Â  Â  Â  [[ ${#DRBD_CSTATE[@]} Â  Â  Â  Â != 0 ]] || DRBD_CSTATE=(Unconfigured)</div><div>+ Â  Â  Â  [[ ${#DRBD_ROLE_REMOTE[@]} Â  != 0 ]] || DRBD_ROLE_REMOTE=(Unknown)</div><div>  Â  Â  Â  [[ ${#DRBD_DSTATE_REMOTE[@]} != 0 ]] || DRBD_DSTATE_REMOTE=(DUnknown)</div><div> </div><div>-</div><div>+ Â  Â  Â  if $DRBD_VERSION_9 ; then</div><div>+ Â  Â  Â  Â  Â  Â  Â  : == DEBUG == DRBD_NAME Â  Â == ${DRBD_NAME[@]} ==</div><div>+ Â  Â  Â  Â  Â  Â  Â  : == DEBUG == DRBD_ID Â  Â == ${DRBD_ID[@]} ==</div><div>+ Â  Â  Â  Â  Â  Â  Â  : == DEBUG == DRBD_VOLUME Â  Â == ${DRBD_VOLUME[@]} ==</div><div>+ Â  Â  Â  fi</div><div>  Â  Â  Â  : == DEBUG == DRBD_ROLE_LOCAL Â  Â == ${DRBD_ROLE_LOCAL[@]} ==</div><div>- Â  Â  Â  : == DEBUG == DRBD_ROLE_REMOTE Â  == ${DRBD_ROLE_REMOTE[@]} ==</div><div>- Â  Â  Â  : == DEBUG == DRBD_CSTATE Â  Â  Â  Â == ${DRBD_CSTATE[@]} ==</div><div>  Â  Â  Â  : == DEBUG == DRBD_DSTATE_LOCAL Â == ${DRBD_DSTATE_LOCAL[@]} ==</div><div>+ Â  Â  Â  : == DEBUG == DRBD_CSTATE Â  Â  Â  Â == ${DRBD_CSTATE[@]} ==</div><div>+ Â  Â  Â  : == DEBUG == DRBD_ROLE_REMOTE Â  == ${DRBD_ROLE_REMOTE[@]} ==</div><div>  Â  Â  Â  : == DEBUG == DRBD_DSTATE_REMOTE == ${DRBD_DSTATE_REMOTE[@]} ==</div><div> }</div><div> </div><div>@@ -414,6 +469,9 @@ maybe_outdate_self()</div><div>  Â  Â  Â  ocf_is_true $OCF_RESKEY_stop_outdates_secondary || return 1</div><div> </div><div>  Â  Â  Â  local host stop_uname</div><div>+ Â  Â  Â  if $DRBD_VERSION_9 ; then</div><div>+ Â  Â  Â  Â  Â  Â  Â  local master temp_nmber outdate_self</div><div>+ Â  Â  Â  fi</div><div>  Â  Â  Â  # We ignore $OCF_RESKEY_CRM_meta_notify_promote_uname here</div><div>  Â  Â  Â  # because: if demote and promote for a _stacked_ resource</div><div>  Â  Â  Â  # (or a &quot;floating&quot; one, where DRBD sits on top of some SAN)</div><div>@@ -437,6 +495,29 @@ maybe_outdate_self()</div><div>  Â  Â  Â  Â  Â  Â  Â  return 1</div><div>  Â  Â  Â  done</div><div> </div><div>+ Â  Â  Â  if $DRBD_VERSION_9 ; then</div><div>+ Â  Â  Â  Â  Â  Â  Â  temp_name=($DRBD_NAME[@])</div><div>+ Â  Â  Â  Â  Â  Â  Â  temp_dstate=($DRBD_DSTATE_REMOTE[@])</div><div>+ Â  Â  Â  Â  Â  Â  Â  temp_number=${#temp_name[@]}</div><div>+ Â  Â  Â  Â  Â  Â  Â  outdate_self=false</div><div>+</div><div>+ Â  Â  Â  Â  Â  Â  Â  for master in $OCF_RESKEY_CRM_meta_notify_master_uname; do</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  for i in `seq 0 $((temp_number-1))`; do</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  if [[ ${temp_name[$i]} == &quot;$master&quot; ]] &amp;&amp;</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  [[ ${temp_dstate[$i]} == &quot;DUnknown&quot; ]]; then</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  outdate_self=true</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  break</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  fi</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  done</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  temp_number=${#temp_name[@]}</div><div>+ Â  Â  Â  Â  Â  Â  Â  done</div><div>+</div><div>+ Â  Â  Â  Â  Â  Â  Â  if ! $outdate_self; then</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  #The disconnecting node is not in Primary</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  return 1</div><div>+ Â  Â  Â  Â  Â  Â  Â  fi</div><div>+ Â  Â fi</div><div>+</div><div>  Â  Â  Â  # e.g. post/promote of some other peer.</div><div>  Â  Â  Â  # Should not happen, fencing constraints should take care of that.</div><div>  Â  Â  Â  # But in case it does, scream out loud.</div><div>@@ -993,6 +1074,7 @@ drbd_validate_all () {</div><div>  Â  Â  Â  DRBDADM=&quot;drbdadm&quot;</div><div>  Â  Â  Â  DRBDSETUP=&quot;drbdsetup&quot;</div><div>  Â  Â  Â  DRBD_HAS_MULTI_VOLUME=false</div><div>+ Â  Â  Â  DRBD_VERSION_9=false</div><div> </div><div>  Â  Â  Â  # these will _exit_ if they don&#39;t find the binaries</div><div>  Â  Â  Â  check_binary $DRBDADM</div><div>@@ -1015,18 +1097,23 @@ drbd_validate_all () {</div><div>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  modinfo -F version drbd |</div><div>  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  sed -ne &#39;s/^\([0-9]\+\)\.\([0-9]\+\)\.\([0-9]\+\).*$/\1 \2 \3/p&#39;))</div><div>  Â  Â  Â  fi</div><div>- Â  Â  Â  if (( $DRBD_KERNEL_VERSION_CODE &gt;= 0x080400 )); then</div><div>+ Â  Â  Â  if (( $DRBD_KERNEL_VERSION_CODE &gt;= 0x090000 )); then</div><div>+ Â  Â  Â  Â  Â  Â  Â  DRBD_HAS_MULTI_VOLUME=true</div><div>+ Â  Â  Â  Â  Â  Â  Â  DRBD_VERSION_9=true</div><div>+ Â  Â  Â  Â  Â  Â  Â  ocf_log warn &quot;RA for DRBD version 9 is in experiment, do not using multiple primaries in DRBD9.0&quot;</div><div>+ Â  Â  Â  elif (( $DRBD_KERNEL_VERSION_CODE &gt;= 0x080400 )); then</div><div>  Â  Â  Â  Â  Â  Â  Â  DRBD_HAS_MULTI_VOLUME=true</div><div>- Â  Â  Â  elif (( $DRBD_KERNEL_VERSION_CODE &gt;= 0x090000 )) ; then</div><div>- Â  Â  Â  Â  Â  Â  Â  ocf_log err &quot;This resource agent does (still) only support DRBD version 8.x&quot;</div><div>- Â  Â  Â  Â  Â  Â  Â  exit $OCF_ERR_INSTALLED</div><div>  Â  Â  Â  fi</div><div>  Â  Â  Â  check_crm_feature_set</div><div> </div><div>  Â  Â  Â  # Check clone and M/S options.</div><div>- Â  Â  Â  meta_expect clone-max -le 2</div><div>+ Â  Â  Â  # Drbd9 support more than two nodes</div><div>+ Â  Â  Â  if ! $DRBD_VERSION_9 ; then</div><div>+ Â  Â  Â  Â  Â  Â  Â  meta_expect clone-max -le 2</div><div>+ Â  Â  Â  fi</div><div>  Â  Â  Â  meta_expect clone-node-max = 1</div><div>  Â  Â  Â  meta_expect master-node-max = 1</div><div>+ Â  Â  Â  # With current DRBD-9.0 version more than two primaries at the same time is not support.</div><div>  Â  Â  Â  meta_expect master-max -le 2</div><div> </div><div>  Â  Â  Â  # Rather than returning $OCF_ERR_CONFIGURED, we sometimes return</div><div>@@ -1080,7 +1167,8 @@ drbd_validate_all () {</div><div>  Â  Â  Â  # DRBD_DEVICES will be a shell array!</div><div>  Â  Â  Â  # FIXME we should double check that we explicitly restrict the set of</div><div>  Â  Â  Â  # valid characters in device names...</div><div>- Â  Â  Â  if DRBD_DEVICES=($($DRBDADM --stacked sh-dev $DRBD_RESOURCE 2&gt;/dev/null)); then</div><div>+ Â  Â  Â  # In DRBD9, no matter stacked or not &quot;$DRBDADM --stacked sh-dev $DRBD_RESOURCE&quot; will return true</div><div>+ Â  Â  Â  if ! $DRBD_VERSION_9 &amp;&amp; DRBD_DEVICES=($($DRBDADM --stacked sh-dev $DRBD_RESOURCE 2&gt;/dev/null)); then</div><div>  Â  Â  Â  Â  Â  Â  Â  # apparently a &quot;stacked&quot; resource. Remember for future DRBDADM calls.</div><div>  Â  Â  Â  Â  Â  Â  Â  DRBDADM=&quot;$DRBDADM -S&quot;</div><div>  Â  Â  Â  elif DRBD_DEVICES=($($DRBDADM sh-dev $DRBD_RESOURCE 2&gt;/dev/null)); then</div><div>diff --git a/user/v9/drbdsetup.c b/user/v9/drbdsetup.c</div><div>index 053b9d3..fba72e1 100644</div><div>--- a/user/v9/drbdsetup.c</div><div>+++ b/user/v9/drbdsetup.c</div><div>@@ -251,6 +251,7 @@ static int del_resource_cmd(struct drbd_cmd *cm, int argc, char **argv);</div><div> static int show_cmd(struct drbd_cmd *cm, int argc, char **argv);</div><div> static int status_cmd(struct drbd_cmd *cm, int argc, char **argv);</div><div> static int role_cmd(struct drbd_cmd *cm, int argc, char **argv);</div><div>+static int sh_status_9compat_cmd(struct drbd_cmd *cm, int argc, char **argv);</div><div> static int cstate_cmd(struct drbd_cmd *cm, int argc, char **argv);</div><div> static int dstate_cmd(struct drbd_cmd *cm, int argc, char **argv);</div><div> static int check_resize_cmd(struct drbd_cmd *cm, int argc, char **argv);</div><div>@@ -478,6 +479,9 @@ struct drbd_cmd commands[] = {</div><div>  Â  Â  Â  {&quot;role&quot;, CTX_RESOURCE, 0, NO_PAYLOAD, role_cmd,</div><div>  Â  Â  Â  Â .lockless = true,</div><div>  Â  Â  Â  Â .summary = &quot;Show the current role of a resource.&quot; },</div><div>+ Â  Â  Â  {&quot;sh-status&quot;, CTX_RESOURCE | CTX_ALL, 0, 0, sh_status_9compat_cmd,</div><div>+ Â  Â  Â  Â .lockless = true,</div><div>+ Â  Â  Â  Â .summary = &quot;Show all status of resource.&quot; },</div><div>  Â  Â  Â  {&quot;cstate&quot;, CTX_PEER_NODE, 0, NO_PAYLOAD, cstate_cmd,</div><div>  Â  Â  Â  Â .lockless = true,</div><div>  Â  Â  Â  Â .summary = &quot;Show the current state of a connection.&quot; },</div><div>@@ -2576,6 +2580,87 @@ static int role_cmd(struct drbd_cmd *cm, int argc, char **argv)</div><div>  Â  Â  Â  return 0;</div><div> }</div><div> </div><div>+</div><div>+static int sh_status_9compat_cmd(struct drbd_cmd *cm, int argc, char **argv)</div><div>+{</div><div>+</div><div>+ Â  Â  Â  struct resources_list *resources_list, *resource;</div><div>+ Â  Â  Â  char *old_objname = objname;</div><div>+</div><div>+ Â  Â  Â  resources_list = sort_resources(list_resources());</div><div>+</div><div>+ Â  Â  Â  for (resource = resources_list; resource; resource = resource-&gt;next) {</div><div>+ Â  Â  Â  Â  Â  Â  Â  struct devices_list *devices, *device;</div><div>+ Â  Â  Â  Â  Â  Â  Â  struct connections_list *connections, *connection;</div><div>+ Â  Â  Â  Â  Â  Â  Â  struct peer_devices_list *peer_devices = NULL, *peer_device;</div><div>+ Â  Â  Â  Â  Â  Â  Â  struct nlattr *nla;</div><div>+</div><div>+ Â  Â  Â  Â  Â  Â  Â  if (strcmp(old_objname, &quot;all&quot;) &amp;&amp; strcmp(old_objname, resource-&gt;name))</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  continue;</div><div>+</div><div>+ Â  Â  Â  Â  Â  Â  Â  objname = resource-&gt;name;</div><div>+ Â  Â  Â  Â  Â  Â  Â  printI(&quot;_res_name=%s\n&quot;, objname);</div><div>+</div><div>+ Â  Â  Â  Â  Â  Â  Â  nla = nla_find_nested(resource-&gt;res_opts, __nla_type(T_node_id));</div><div>+ Â  Â  Â  Â  Â  Â  Â  if (nla)</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  printI(&quot;_node_id=%d\n\n&quot;, *(uint32_t *)nla_data(nla));</div><div>+ Â  Â  Â  Â  Â  Â  Â  else</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  printI(&quot;_node_id=\n\n&quot;);</div><div>+</div><div>+ Â  Â  Â  Â  Â  Â  Â  devices = list_devices(resource-&gt;name);</div><div>+ Â  Â  Â  Â  Â  Â  Â  connections = sort_connections(list_connections(resource-&gt;name));</div><div>+ Â  Â  Â  Â  Â  Â  Â  if (devices &amp;&amp; connections)</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  peer_devices = list_peer_devices(resource-&gt;name);</div><div>+</div><div>+ Â  Â  Â  Â  Â  Â  Â  link_peer_devices_to_devices(peer_devices, devices);</div><div>+</div><div>+ Â  Â  Â  Â  Â  Â  Â  for (device = devices; device; device = device-&gt;next) {</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  ++indent;</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  printI(&quot;_minor=%d\n&quot;, device-&gt;minor);</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  printI(&quot;_volume=%d\n&quot;, device-&gt;ctx.ctx_volume);</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  //refer to v84</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  //printI(&quot;_known=%s\n&quot;, xxx);</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  printI(&quot;_role=%s\n&quot;, drbd_role_str(resource-&gt;info.res_role));</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  printI(&quot;_disk=%s\n\n&quot;, drbd_disk_str(device-&gt;info.dev_disk_state));</div><div>+</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  for (connection = connections; connection; connection = connection-&gt;next) {</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  ++indent;</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  for (peer_device = peer_devices; peer_device; peer_device = peer_device-&gt;next) {</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  if (connection-&gt;ctx.ctx_peer_node_id != peer_device-&gt;ctx.ctx_peer_node_id</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  || device-&gt;ctx.ctx_volume != peer_device-&gt;ctx.ctx_volume)</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  continue;</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  printI(&quot;_conn_name=%s\n&quot;, connection-&gt;ctx.ctx_conn_name);</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  printI(&quot;_peer_node_id=%d\n&quot;, connection-&gt;ctx.ctx_peer_node_id);</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  printI(&quot;_cstate=%s\n&quot;, drbd_conn_str(connection-&gt;info.conn_connection_state));</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  if (connection-&gt;info.conn_connection_state == C_CONNECTED) {</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  printI(&quot;_peer=%s\n&quot;, drbd_role_str(connection-&gt;info.conn_role));</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  printI(&quot;_pdsk=%s\n\n&quot;, drbd_disk_str(peer_device-&gt;info.peer_disk_state));</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  } else {</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  printI(&quot;_peer=\n&quot;);</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  printI(&quot;_pdsk=\n&quot;);</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  }</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  wrap_printf(0, &quot;_peer_node_process\n\n&quot;);</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  }</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  //Dummy</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  //printI(&quot;_flags_susp==%s\n&quot;, xxx);</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  //...</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  --indent;</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  }</div><div>+</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  wrap_printf(0, &quot;_sh_status_process\n\n&quot;);</div><div>+ Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  --indent;</div><div>+ Â  Â  Â  Â  Â  Â  Â  }</div><div>+</div><div>+ Â  Â  Â  Â  Â  Â  Â  free_connections(connections);</div><div>+ Â  Â  Â  Â  Â  Â  Â  free_devices(devices);</div><div>+ Â  Â  Â  Â  Â  Â  Â  free_peer_devices(peer_devices);</div><div>+ Â  Â  Â  }</div><div>+</div><div>+ Â  Â  Â  free(resources_list);</div><div>+ Â  Â  Â  objname = old_objname;</div><div>+ Â  Â  Â  return 0;</div><div>+}</div><div>+</div><div> static int cstate_cmd(struct drbd_cmd *cm, int argc, char **argv)</div><div> {</div><div>  Â  Â  Â  struct connections_list *connections, *connection;</div><div><div class="h5"><div><br></div><div><br></div><div><br></div><div><br></div><div><blockquote type="cite"><div>30 maj 2016 kl. 13:36 skrev Igor Cicimov &lt;<a href="mailto:icicimov@gmail.com" target="_blank">icicimov@gmail.com</a>&gt;:</div><br><div><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 17, 2016 at 8:21 AM, Mats Ramnefors <span dir="ltr">&lt;<a href="mailto:mats@ramnefors.com" target="_blank">mats@ramnefors.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I am testing a DRBD 9 and 8.4 in simple 2 node active - passive clusters with NFS.<br>
<br>
Copying files form a third server to the NFS share using dd, I typically see an average of 20% CPU load (with v9) on the primary during transfer of larger files, testing with 0,5 and 2 GB.<br>
<br>
At the very end of the transfer DRBD process briefly peaks at 70 - 100% CPU.<br>
<br>
This causes occasional problems with Corosync believing the node is down. Increasing the token time for Corosync to 2000 ms fixes the symptom but I am wondering about the root cause and any possible fixes?<br>
<br>
This is the DRBD configuration.<br>
<br>
resource san_data {<br>
  protocol C;<br>
  meta-disk internal;<br>
  device /dev/drbd1;<br>
  disk  Â /dev/nfs/share;<br>
  net {<br>
  Â  verify-alg sha1;<br>
  Â  cram-hmac-alg sha1;<br>
  Â  shared-secret â€****************&quot;;<br>
  Â  after-sb-0pri discard-zero-changes;<br>
  Â  after-sb-1pri discard-secondary;<br>
  Â  after-sb-2pri disconnect;<br>
  }<br>
  on san1 {<br>
  Â  address  <a href="http://192.168.1.86:7789/" rel="noreferrer" target="_blank">192.168.1.86:7789</a>;<br>
  }<br>
  on san2 {<br>
  Â  address  <a href="http://192.168.1.87:7789/" rel="noreferrer" target="_blank">192.168.1.87:7789</a>;<br>
  }<br>
}<br>
<br>
The nodes are two VM on different ESXi hosts (Dell T620). Hosts are very lightly loaded. Network is 1 Gb at the moment through a Catalyst switch. Network appears not saturated.<br>
<br>
BTW when can we expect a DRBD resource agent for v9? It took me a while to figure out why DRBD9 was not working with Pacemaker and then finding a patch to the agent :)<br>
<br>
Cheers Mats<br>
_______________________________________________<br>
drbd-user mailing list<br>
<a href="mailto:drbd-user@lists.linbit.com" target="_blank">drbd-user@lists.linbit.com</a><br>
<a href="http://lists.linbit.com/mailman/listinfo/drbd-user" rel="noreferrer" target="_blank">http://lists.linbit.com/mailman/listinfo/drbd-user</a></blockquote><div><br></div><div>Hi Mats,<br><br></div><div>Can you please share the patch if you don&#39;t mind?<br><br></div><div>Thanks,<br></div><div>Igor <br></div></div><br></div></div>
</div></blockquote></div><br></div></div></div></div></div></blockquote></div><br></div></div></div>