Nir Soffer has posted comments on this change.
Change subject: tests: Add loopback module
......................................................................
Patch Set 7: Verified+1
This version address the issue I mention in the previous version.
--
To view, visit https://gerrit.ovirt.org/64329
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I37184887930ad9ec1234036fdcdeb6cee8ccac42
Gerrit-PatchSet: 7
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Ala Hino <ahino(a)redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Freddy Rolland <frolland(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: No
Nir Soffer has uploaded a new change for review.
Change subject: guest-lvs: Deactivate guest lvs during bootstrap
......................................................................
guest-lvs: Deactivate guest lvs during bootstrap
Add a new pass during deactivation, detecting open lvs used by other
lvs, and deactivate the guest lvs using them. After deactivating the
guest lvs the host lvs are invalidated.
If the lvs are still open in the next pass, they are likely used by a
vm. We don't have enough information at this point so we skip them. If
the lvs are closed, they will be deactivated.
Change-Id: I0b0eed7a61ff11593700c2c5ef0e7d5d4f8be784
Bug-Url: https://bugzilla.redhat.com/1374545
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M lib/vdsm/storage/devicemapper.py
M vdsm/storage/lvm.py
2 files changed, 33 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/68/64368/1
diff --git a/lib/vdsm/storage/devicemapper.py b/lib/vdsm/storage/devicemapper.py
index 90ba81a..c5d061c 100644
--- a/lib/vdsm/storage/devicemapper.py
+++ b/lib/vdsm/storage/devicemapper.py
@@ -117,7 +117,10 @@
def removeMapping(deviceName):
- return getProxy().removeDeviceMapping(deviceName)
+ if os.geteuid() == 0:
+ return _removeMapping(deviceName)
+ else:
+ return getProxy().removeDeviceMapping(deviceName)
def _removeMapping(deviceName):
diff --git a/vdsm/storage/lvm.py b/vdsm/storage/lvm.py
index 68d3d98..c501105 100644
--- a/vdsm/storage/lvm.py
+++ b/vdsm/storage/lvm.py
@@ -654,12 +654,17 @@
refresh = []
for lv in _lvminfo.getLv(vg.name):
+ if lv.opened and lv.name not in refreshlvs:
+ _remove_lv_holders(vg.name, lv.name)
+
+ for lv in _lvminfo.getLv(vg.name):
if lv.active:
if lv.name in refreshlvs:
refresh.append(lv.name)
elif lv.opened:
- log.debug("Skipping open lv: vg=%s lv=%s", vg.name,
- lv.name)
+ # This LV may be used by a vm, we don't have enough
+ # information about that at this point.
+ log.debug("Skipping open lv %s/%s", vg.name, lv.name)
else:
deactivate.append(lv.name)
@@ -680,6 +685,27 @@
except se.LogicalVolumeRefreshError:
log.error("Error refreshing lvs: vg=%s lvs=%s", vg.name,
refresh)
+
+
+def _remove_lv_holders(vg_name, lv_name):
+ """
+ This may be needed when a raw volume is used as a pv in the guest without
+ creating partition table. LVM scans active lvs and activate guest lvs on
+ the host. Active guest lvs allow unwanted access to guest data on the
+ host, and prevent deactivation of the host lvs.
+
+ See https://bugzilla.redhat.com/1374545
+ """
+ dm_name = getLvDmName(vg_name, lv_name)
+ holders = devicemapper.getHolders(dm_name)
+ if holders:
+ devices = [devicemapper.getDevName(dev) for dev in holders]
+ log.info("LV %s/%s is used by %s, removing mappings",
+ vg_name, lv_name, devices)
+ for dev in devices:
+ devicemapper.removeMapping(dev)
+ # This invalidates lv.attr, force reload on next access.
+ _lvminfo._invalidatelvs(vg_name, [lv_name])
def invalidateCache():
@@ -742,7 +768,7 @@
def getLvDmName(vgName, lvName):
- return "%s-%s" % (vgName.replace("-", "--"), lvName)
+ return "%s-%s" % (vgName.replace("-", "--"), lvName.replace("-", "--"))
def removeVgMapping(vgName):
--
To view, visit https://gerrit.ovirt.org/64368
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0b0eed7a61ff11593700c2c5ef0e7d5d4f8be784
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
gerrit-hooks has posted comments on this change.
Change subject: guest-lvs: Add failing test for guest lvs
......................................................................
Patch Set 11:
* #1374545::Update tracker: OK
* Check Bug-Url::OK
* Check Public Bug::#1374545::OK, public bug
* Check Product::#1374545::OK, Correct product Red Hat Enterprise Virtualization Manager
* Check TM::SKIP, not in a monitored branch (ovirt-3.6 ovirt-4.0)
* Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
--
To view, visit https://gerrit.ovirt.org/64330
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I80d37278225262bc5692e00aed15654e84119590
Gerrit-PatchSet: 11
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Ala Hino <ahino(a)redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini(a)redhat.com>
Gerrit-Reviewer: Freddy Rolland <frolland(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: No
gerrit-hooks has posted comments on this change.
Change subject: tests: Add loopback module
......................................................................
Patch Set 7:
* #1374545::Update tracker: OK
* Check Bug-Url::OK
* Check Public Bug::#1374545::OK, public bug
* Check Product::#1374545::OK, Correct product Red Hat Enterprise Virtualization Manager
* Check TM::SKIP, not in a monitored branch (ovirt-3.6 ovirt-4.0)
* Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
--
To view, visit https://gerrit.ovirt.org/64329
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I37184887930ad9ec1234036fdcdeb6cee8ccac42
Gerrit-PatchSet: 7
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Ala Hino <ahino(a)redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Freddy Rolland <frolland(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: No
gerrit-hooks has posted comments on this change.
Change subject: guest-lvs: Add failing test for guest lvs
......................................................................
Patch Set 10:
* #1374545::Update tracker: OK
* Check Bug-Url::OK
* Check Public Bug::#1374545::OK, public bug
* Check Product::#1374545::OK, Correct product Red Hat Enterprise Virtualization Manager
* Check TM::SKIP, not in a monitored branch (ovirt-3.6 ovirt-4.0)
* Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
--
To view, visit https://gerrit.ovirt.org/64330
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I80d37278225262bc5692e00aed15654e84119590
Gerrit-PatchSet: 10
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Ala Hino <ahino(a)redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini(a)redhat.com>
Gerrit-Reviewer: Freddy Rolland <frolland(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: No
gerrit-hooks has posted comments on this change.
Change subject: tests: Add loopback module
......................................................................
Patch Set 6:
* #1374545::Update tracker: OK
* Check Bug-Url::OK
* Check Public Bug::#1374545::OK, public bug
* Check Product::#1374545::OK, Correct product Red Hat Enterprise Virtualization Manager
* Check TM::SKIP, not in a monitored branch (ovirt-3.6 ovirt-4.0)
* Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
--
To view, visit https://gerrit.ovirt.org/64329
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I37184887930ad9ec1234036fdcdeb6cee8ccac42
Gerrit-PatchSet: 6
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Ala Hino <ahino(a)redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Freddy Rolland <frolland(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: No