ClusterLabs / ClusterLabs/resource-agents

Exlusively clvm resources in cluster.

Open
#673 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
519
Forks
608
Avg merge
6d 1h
Merged PRs (30d)
7

Description

Hello.

I am use CLVM resource in cluster and work with exclusively activated volumes (thin pool) on nodes.
When resource clvm stoped errors occur with clvm:
ERROR: Cannot deactivate remotely exclusive device locally. 0 logical volume(s) in volume group "shared_vg-ex" now active 0 logical volume(s) in volume group "shared_vg" now active
Solution: deactivate logical volume only if is activated on current node.

My sample code:

LVM_LVCHANGE=${vgtoolsdir}/lvchange
LVM_LVS=${vgtoolsdir}/lvs

clvmd_stop()
{
...........................................

```
LVM_VGS="$(clustered_vgs)"

if [ -n "$LVM_VGS" ]; then
${LVM_LVS} -o lv_name,lv_active $LVM_VGS 2>/dev/null | awk ' {if (match($2,"local")) print $1;}' | while read LVM_LV_NAME
do
ocf_log info "Deactivating clustered LV: ${LVM_VGS}/${LVM_LV_NAME}"
ocf_run ${LVM_LVCHANGE} -anl ${LVM_VGS}/${LVM_LV_NAME}
if [ $? -ne 0 ]; then
ocf_exit_reason "Failed to deactivate volume groups, cluster vglist = $LVM_VGS, lvname = $LVM_LV_NAME"
return $OCF_ERR_GENERIC
fi
done
fi
```

..................................................
}

Thanks for your work.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.