Nir Soffer has posted comments on this change.
Change subject: blockSD: Ensure active volumes are refreshed before use. ......................................................................
Patch Set 7: -Code-Review
(2 comments)
I see one problem - the active check and handling is now at the correct layer - but all calls to prepareImage invoke prepareVolumePath which invokes activateVolume. So we may invoke activateVolumes multiple times on same already activated volume, leading to multiple unneeded and expensive refreshes.
This patch must ensure that we refresh active lvs only on the first time we found the lv active, and never touch it after that.
.................................................... Commit Message Line 8: Line 9: At present we trust that active LVs represent the current state of a Line 10: given LV. This may not be the case if the LV has been modified Line 11: (extended, recreated etc) by another host while the LV is active on Line 12: the current host. See https://bugzilla.redhat.com/show_bug.cgi?id=1009812#c19 for context. Line 13: Line 14: This change forces active LVs that are part of a guest image to be Line 15: refreshed before use. Line 16:
.................................................... File vdsm/storage/blockSD.py Line 1073: Line 1074: if toRefresh: Line 1075: log.warning("The following volumes are already active and will be" Line 1076: " refreshed before use : %s", toRefresh) Line 1077: lvm.refreshLVs(self.sdUUID, toRefresh) Can you be more specific? Line 1078: Line 1079: vgDir = os.path.join("/dev", self.sdUUID) Line 1080: return self.createImageLinks(vgDir, imgUUID, volUUIDs) Line 1081: