Change in vdsm[ovirt-3.3]: lvm: Deactivate lvs during bootstrap

fsimonce at redhat.com fsimonce at redhat.com
Thu Nov 21 16:19:12 UTC 2013


Federico Simoncelli has submitted this change and it was merged.

Change subject: lvm: Deactivate lvs during bootstrap
......................................................................


lvm: Deactivate lvs during bootstrap

When using FC storage, physical volumes are connected during boot, and vdsm
logical volumes are auto-activated by both /etc/rc.sysinit and
/etc/init.d/netfs startup scripts. These logical volumes do not pick changes
done by the SPM on the storage, which may lead to data corruption sooner or
later, when a vm is trying to write to logical volume with stale meta data.

This patch check all vdsm logical volumes during lvm bootstrap and
deactivate them if possible. Special logical volumes are refreshed,
since they are accessed early when connecting to storage pool, possibly
before lvm bootstrap is done. Open logical volumes are skipped because
we assume that they use correct meta data when opened.

To fix the auto-activation during boot, we could perform this only on
the first start of the service and limit the operation to FC storage.
However, we decided to use this on all block storage types, and on every
start of the service, as additional layer of protection from logical
volumes left active after unclean shutdown of the service, or other
failures to deactivate logical volumes.

Deactivation adds up to two lvchange calls for each volume group with
active logical volumes. After the first service start, logical volumes
are typically inactive and this change adds minimal additional cost,
refreshing active special logical volumes.

Depends on http://gerrit.ovirt.org/#/c/21500/ for refreshing multiple
logical volumes in one call.

Change-Id: I5f142ebca7a00d45f2500ad2631fab2366f2f7db
Bug-Url: https://bugzilla.redhat.com/1009812
Signed-off-by: Nir Soffer <nsoffer at redhat.com>
Reviewed-on: http://gerrit.ovirt.org/21291
Reviewed-by: Federico Simoncelli <fsimonce at redhat.com>
Reviewed-on: http://gerrit.ovirt.org/21501
Reviewed-by: Allon Mureinik <amureini at redhat.com>
---
M vdsm/storage/hsm.py
M vdsm/storage/lvm.py
2 files changed, 45 insertions(+), 1 deletion(-)

Approvals:
  Nir Soffer: Verified
  Federico Simoncelli: Looks good to me, approved
  Allon Mureinik: Looks good to me, but someone else must approve



-- 
To view, visit http://gerrit.ovirt.org/21501
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I5f142ebca7a00d45f2500ad2631fab2366f2f7db
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.3
Gerrit-Owner: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Ayal Baron <abaron at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: automation at ovirt.org


More information about the vdsm-patches mailing list