Change in vdsm[master]: factor out parts of setupNetworks for better readability
by ibarkan@redhat.com
Ido Barkan has uploaded a new change for review.
Change subject: factor out parts of setupNetworks for better readability
......................................................................
factor out parts of setupNetworks for better readability
Change-Id: Icb26c288b8f466e5f1009d889dacf3e17d45891c
Signed-off-by: ibarkan <ibarkan(a)redhat.com>
---
M vdsm/network/api.py
1 file changed, 53 insertions(+), 37 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/91/35691/1
diff --git a/vdsm/network/api.py b/vdsm/network/api.py
index 6843789..1fa4445 100755
--- a/vdsm/network/api.py
+++ b/vdsm/network/api.py
@@ -600,6 +600,55 @@
topNetDev.remove()
+def _add_missing_networks(configurator, networks_to_add, bondings, force,
+ logger, _netinfo=None):
+ # We need to use the newest host info
+ if _netinfo is None:
+ _netinfo = netinfo.NetInfo()
+ else:
+ _netinfo.updateDevices()
+
+ for network, attrs in networks_to_add.iteritems():
+ d = dict(attrs)
+ if 'bonding' in d:
+ d.update(_buildBondOptions(d['bonding'], bondings, _netinfo))
+ else:
+ d['nics'] = [d.pop('nic')] if 'nic' in d else []
+ d['force'] = force
+
+ logger.debug("Adding network %r", network)
+ try:
+ addNetwork(network, configurator=configurator,
+ implicitBonding=True, _netinfo=_netinfo, **d)
+ except ConfigNetworkError as cne:
+ if cne.errCode == ne.ERR_FAILED_IFUP:
+ logger.debug("Adding network %r failed. Running "
+ "orphan-devices cleanup", network)
+ _emergencyNetworkCleanup(network, attrs,
+ configurator)
+ raise
+
+ _netinfo.updateDevices() # Things like a bond mtu can change
+
+
+def _check_connectivity(connectivity_check_networks, networks, bondings,
+ options, logger):
+ if utils.tobool(options.get('connectivityCheck', True)):
+ logger.debug('Checking connectivity...')
+ if not clientSeen(int(options.get('connectivityTimeout',
+ CONNECTIVITY_TIMEOUT_DEFAULT))):
+ logger.info('Connectivity check failed, rolling back')
+ for network in connectivity_check_networks:
+ # If the new added network was created on top of
+ # existing bond, we need to keep the bond on rollback
+ # flow, else we will break the new created bond.
+ delNetwork(network, force=True,
+ implicitBonding=networks[network].
+ get('bonding') in bondings)
+ raise ConfigNetworkError(ne.ERR_LOST_CONNECTION,
+ 'connectivity check failed')
+
+
def setupNetworks(networks, bondings, **options):
"""Add/Edit/Remove configuration for networks and bondings.
@@ -701,44 +750,11 @@
_handleBondings(bondings, configurator)
- # We need to use the newest host info
- _netinfo.updateDevices()
- for network, attrs in networks_to_add.iteritems():
- d = dict(attrs)
- if 'bonding' in d:
- d.update(_buildBondOptions(d['bonding'], bondings, _netinfo))
- else:
- d['nics'] = [d.pop('nic')] if 'nic' in d else []
- d['force'] = force
+ _add_missing_networks(configurator, networks_to_add, bondings, force,
+ logger, _netinfo)
- logger.debug("Adding network %r", network)
- try:
- addNetwork(network, configurator=configurator,
- implicitBonding=True, _netinfo=_netinfo, **d)
- except ConfigNetworkError as cne:
- if cne.errCode == ne.ERR_FAILED_IFUP:
- logger.debug("Adding network %r failed. Running "
- "orphan-devices cleanup", network)
- _emergencyNetworkCleanup(network, attrs,
- configurator)
- raise
-
- _netinfo.updateDevices() # Things like a bond mtu can change
-
- if utils.tobool(options.get('connectivityCheck', True)):
- logger.debug('Checking connectivity...')
- if not clientSeen(int(options.get('connectivityTimeout',
- CONNECTIVITY_TIMEOUT_DEFAULT))):
- logger.info('Connectivity check failed, rolling back')
- for network in connectivity_check_networks:
- # If the new added network was created on top of
- # existing bond, we need to keep the bond on rollback
- # flow, else we will break the new created bond.
- delNetwork(network, force=True,
- implicitBonding=networks[network].
- get('bonding') in bondings)
- raise ConfigNetworkError(ne.ERR_LOST_CONNECTION,
- 'connectivity check failed')
+ _check_connectivity(connectivity_check_networks, networks, bondings,
+ options, logger)
hooks.after_network_setup(_buildSetupHookDict(networks, bondings, options))
--
To view, visit http://gerrit.ovirt.org/35691
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Icb26c288b8f466e5f1009d889dacf3e17d45891c
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ido Barkan <ibarkan(a)redhat.com>
9 years, 5 months
Change in vdsm[master]: do not delete networks from parameters
by ibarkan@redhat.com
Ido Barkan has uploaded a new change for review.
Change subject: do not delete networks from parameters
......................................................................
do not delete networks from parameters
Change-Id: I546c7f196f4b6bdace528a0cbbe6cfe5a212bfe1
Signed-off-by: ibarkan <ibarkan(a)redhat.com>
---
M vdsm/network/api.py
1 file changed, 5 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/90/35690/1
diff --git a/vdsm/network/api.py b/vdsm/network/api.py
index 434ce3d..6843789 100755
--- a/vdsm/network/api.py
+++ b/vdsm/network/api.py
@@ -668,6 +668,10 @@
logger.debug("Applying...")
with ConfiguratorClass(options.get('_inRollback', False)) as configurator:
+ networks_to_add = dict(
+ (net, attributes)
+ for net, attributes in networks.iteritems()
+ if 'remove' not in attributes)
# Remove edited networks and networks with 'remove' attribute
for network, attrs in networks.items():
if network in _netinfo.networks:
@@ -675,7 +679,6 @@
delNetwork(network, configurator=configurator, force=force,
implicitBonding=False, _netinfo=_netinfo)
if 'remove' in attrs:
- del networks[network]
del libvirt_nets[network]
_netinfo.updateDevices()
del _netinfo.networks[network]
@@ -687,7 +690,6 @@
_delBrokenNetwork(network, libvirt_nets[network],
configurator=configurator)
if 'remove' in attrs:
- del networks[network]
del libvirt_nets[network]
_netinfo.updateDevices()
elif 'remove' in attrs:
@@ -701,7 +703,7 @@
# We need to use the newest host info
_netinfo.updateDevices()
- for network, attrs in networks.iteritems():
+ for network, attrs in networks_to_add.iteritems():
d = dict(attrs)
if 'bonding' in d:
d.update(_buildBondOptions(d['bonding'], bondings, _netinfo))
--
To view, visit http://gerrit.ovirt.org/35690
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I546c7f196f4b6bdace528a0cbbe6cfe5a212bfe1
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ido Barkan <ibarkan(a)redhat.com>
9 years, 5 months
Change in vdsm[master]: Revert Ib7808f4f217ba3d6d30a60fab6233e36a29f0098 and add set...
by ybronhei@redhat.com
Yaniv Bronhaim has uploaded a new change for review.
Change subject: Revert Ib7808f4f217ba3d6d30a60fab6233e36a29f0098 and add set-sasl to spec
......................................................................
Revert Ib7808f4f217ba3d6d30a60fab6233e36a29f0098 and add set-sasl to
spec
To avoid upgrade issue and set the sasl password during installation,
this workaround change the use in vdsm-tool to direct call.
Bug-Url : https://bugzilla.redhat.com/show_bug.cgi?id=1168689
Signed-off-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
Signed-off-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
Change-Id: Ibfc751aaa79f8d6374efec8d6c594ba7a1ad5607
---
M init/vdsmd_init_common.sh.in
M vdsm.spec.in
2 files changed, 5 insertions(+), 5 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/63/35763/1
diff --git a/init/vdsmd_init_common.sh.in b/init/vdsmd_init_common.sh.in
index 9389e28..e637b59 100644
--- a/init/vdsmd_init_common.sh.in
+++ b/init/vdsmd_init_common.sh.in
@@ -216,10 +216,6 @@
[ "${ret}" -eq 0 ] && rm -f "${upgraded_ver_file}"
fi
}
-
-task_set_sasl_password() {
- "$VDSM_TOOL" set-saslpasswd
-}
#### pre-start tasks end ####
@@ -256,7 +252,6 @@
# after load_needed_modules (modprobe bonding).
# NetworkManager must not crash on nmcli conn delete.
run_tasks " \
- set_sasl_password \
mkdirs \
configure_coredump \
configure_vdsm_logs \
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 7dfaece..7f878c2 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -787,6 +787,11 @@
%post
%{_bindir}/vdsm-tool configure --module sanlock --force >/dev/null
+# update the vdsm "secret" password for libvirt
+if [ -f /etc/pki/vdsm/keys/libvirt_password ]; then
+ @SASLPASSWD2_PATH@ -p -a libvirt vdsm@ovirt < \
+ /etc/pki/vdsm/keys/libvirt_password
+fi
# After vdsm install we should create the logs files.
# In the install session we create it but since we use
--
To view, visit http://gerrit.ovirt.org/35763
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibfc751aaa79f8d6374efec8d6c594ba7a1ad5607
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>
9 years, 5 months
Change in vdsm[master]: Fixed %post script error during upgrade
by ybronhei@redhat.com
Yaniv Bronhaim has uploaded a new change for review.
Change subject: Fixed %post script error during upgrade
......................................................................
Fixed %post script error during upgrade
During post script we initiates vdsm-tool set-saslpasswd call. On
upgrade we have mixed code that may lead to an error while calling
vdsm-tool script, as in the related bug.
In this patch we move the call to set-saslpasswd to init scripts. In
pre-script phase we can be sure that the newer code is running.
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1168689
Change-Id: Ib7808f4f217ba3d6d30a60fab6233e36a29f0098
Signed-off-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
---
M init/vdsmd_init_common.sh.in
M vdsm.spec.in
2 files changed, 5 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/39/35739/1
diff --git a/init/vdsmd_init_common.sh.in b/init/vdsmd_init_common.sh.in
index e637b59..9389e28 100644
--- a/init/vdsmd_init_common.sh.in
+++ b/init/vdsmd_init_common.sh.in
@@ -216,6 +216,10 @@
[ "${ret}" -eq 0 ] && rm -f "${upgraded_ver_file}"
fi
}
+
+task_set_sasl_password() {
+ "$VDSM_TOOL" set-saslpasswd
+}
#### pre-start tasks end ####
@@ -252,6 +256,7 @@
# after load_needed_modules (modprobe bonding).
# NetworkManager must not crash on nmcli conn delete.
run_tasks " \
+ set_sasl_password \
mkdirs \
configure_coredump \
configure_vdsm_logs \
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 86a43c7..7dfaece 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -787,8 +787,6 @@
%post
%{_bindir}/vdsm-tool configure --module sanlock --force >/dev/null
-# set the vdsm "secret" password for libvirt
-%{_bindir}/vdsm-tool set-saslpasswd
# After vdsm install we should create the logs files.
# In the install session we create it but since we use
--
To view, visit http://gerrit.ovirt.org/35739
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib7808f4f217ba3d6d30a60fab6233e36a29f0098
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>
9 years, 5 months
Change in vdsm[ovirt-3.5]: Changing persisted value to libvirt logrotate configure
by ybronhei@redhat.com
Yaniv Bronhaim has uploaded a new change for review.
Change subject: Changing persisted value to libvirt logrotate configure
......................................................................
Changing persisted value to libvirt logrotate configure
Setting persisted to false means that is-configured won't check the
status of this file. This to avoid differences between ovirt-3.4
configuration to ovirt-3.5 in /etc/logrotate.d/libvirtd
In ovirt-3.4 we set the prefix of the configuration without the conf
version, therefore in 3.5 we alerted that libvirt is not configured
and asked to run vdsm-tool configure all-over again without having any
differences between the versions.
Change-Id: I3f1c4d5d513e8699543727fff9f30a8213c66bfd
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1168695
Signed-off-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
---
M lib/vdsm/tool/configurators/libvirt.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/61/35761/1
diff --git a/lib/vdsm/tool/configurators/libvirt.py b/lib/vdsm/tool/configurators/libvirt.py
index 1b7556b..d492eab 100644
--- a/lib/vdsm/tool/configurators/libvirt.py
+++ b/lib/vdsm/tool/configurators/libvirt.py
@@ -481,7 +481,7 @@
'configure': _prefixAndPrepend,
'prependFile': 'LRCONF_EXAMPLE',
'removeConf': _unprefixAndRemoveSection,
- 'persisted': True,
+ 'persisted': False,
},
'LRCONF_EXAMPLE': {
--
To view, visit http://gerrit.ovirt.org/35761
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3f1c4d5d513e8699543727fff9f30a8213c66bfd
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>
9 years, 5 months
Change in vdsm[ovirt-3.5]: Revert Ib7808f4f217ba3d6d30a60fab6233e36a29f0098 and add set...
by ybronhei@redhat.com
Hello Dan Kenigsberg,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/35765
to review the following change.
Change subject: Revert Ib7808f4f217ba3d6d30a60fab6233e36a29f0098 and add set-sasl to spec
......................................................................
Revert Ib7808f4f217ba3d6d30a60fab6233e36a29f0098 and add set-sasl to
spec
To avoid upgrade issue and set the sasl password during installation,
this workaround change the use in vdsm-tool to direct call.
Bug-Url : https://bugzilla.redhat.com/show_bug.cgi?id=1168689
Signed-off-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
Signed-off-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
Change-Id: Ibfc751aaa79f8d6374efec8d6c594ba7a1ad5607
Reviewed-on: http://gerrit.ovirt.org/35763
Reviewed-by: Dan Kenigsberg <danken(a)redhat.com>
Tested-by: Dan Kenigsberg <danken(a)redhat.com>
---
M init/vdsmd_init_common.sh.in
M vdsm.spec.in
2 files changed, 5 insertions(+), 5 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/65/35765/1
diff --git a/init/vdsmd_init_common.sh.in b/init/vdsmd_init_common.sh.in
index 9389e28..e637b59 100644
--- a/init/vdsmd_init_common.sh.in
+++ b/init/vdsmd_init_common.sh.in
@@ -216,10 +216,6 @@
[ "${ret}" -eq 0 ] && rm -f "${upgraded_ver_file}"
fi
}
-
-task_set_sasl_password() {
- "$VDSM_TOOL" set-saslpasswd
-}
#### pre-start tasks end ####
@@ -256,7 +252,6 @@
# after load_needed_modules (modprobe bonding).
# NetworkManager must not crash on nmcli conn delete.
run_tasks " \
- set_sasl_password \
mkdirs \
configure_coredump \
configure_vdsm_logs \
diff --git a/vdsm.spec.in b/vdsm.spec.in
index c1b1e1c..5becd4a 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -759,6 +759,11 @@
%post
%{_bindir}/vdsm-tool configure --module sanlock --force >/dev/null
+# update the vdsm "secret" password for libvirt
+if [ -f /etc/pki/vdsm/keys/libvirt_password ]; then
+ @SASLPASSWD2_PATH@ -p -a libvirt vdsm@ovirt < \
+ /etc/pki/vdsm/keys/libvirt_password
+fi
# After vdsm install we should create the logs files.
# In the install session we create it but since we use
--
To view, visit http://gerrit.ovirt.org/35765
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibfc751aaa79f8d6374efec8d6c594ba7a1ad5607
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
9 years, 5 months
Change in vdsm[master]: Changing persisted value to libvirt logrotate configure
by ybronhei@redhat.com
Yaniv Bronhaim has uploaded a new change for review.
Change subject: Changing persisted value to libvirt logrotate configure
......................................................................
Changing persisted value to libvirt logrotate configure
Setting persisted to false means that is-configured won't check the
status of this file. This to avoid differences between ovirt-3.4
configuration to ovirt-3.5 in /etc/logrotate.d/libvirtd
In ovirt-3.4 we set the prefix of the configuration without the conf
version, therefore in 3.5 we alerted that libvirt is not configured
and asked to run vdsm-tool configure all-over again without having any
differences between the versions.
Change-Id: I3f1c4d5d513e8699543727fff9f30a8213c66bfd
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1168695
Signed-off-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
---
M lib/vdsm/tool/configurators/libvirt.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/58/35758/1
diff --git a/lib/vdsm/tool/configurators/libvirt.py b/lib/vdsm/tool/configurators/libvirt.py
index 796bc9e..35ae5d4 100644
--- a/lib/vdsm/tool/configurators/libvirt.py
+++ b/lib/vdsm/tool/configurators/libvirt.py
@@ -482,7 +482,7 @@
'configure': _prefixAndPrepend,
'prependFile': 'LRCONF_EXAMPLE',
'removeConf': _unprefixAndRemoveSection,
- 'persisted': True,
+ 'persisted': False,
},
'LRCONF_EXAMPLE': {
--
To view, visit http://gerrit.ovirt.org/35758
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3f1c4d5d513e8699543727fff9f30a8213c66bfd
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>
9 years, 5 months
Change in vdsm[master]: sosreport: Don't try to collect info from sockets
by ykaplan@redhat.com
Yeela Kaplan has uploaded a new change for review.
Change subject: sosreport: Don't try to collect info from sockets
......................................................................
sosreport: Don't try to collect info from sockets
sosreport gets an IOError trying to collect data
from svdsm.sock:
'caught IO error copying /var/run/vdsm/svdsm.sock'
Change-Id: I2aa8df2a8d16c7a3468cd7cad21fe598b33b8500
Signed-off-by: Yeela Kaplan <ykaplan(a)redhat.com>
---
M vdsm/sos/vdsm.py.in
1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/13/35513/1
diff --git a/vdsm/sos/vdsm.py.in b/vdsm/sos/vdsm.py.in
index 535cb7a..a5294f8 100644
--- a/vdsm/sos/vdsm.py.in
+++ b/vdsm/sos/vdsm.py.in
@@ -139,11 +139,11 @@
def _addVdsmRunDir(self):
"""Add everything under /var/run/vdsm except possibly confidential
- sysprep vfds """
+ sysprep vfds and except for sockets"""
import glob
for f in glob.glob("@VDSMRUNDIR@/*"):
if not f.endswith('.vfd') and not f.endswith('/isoUploader') \
- and not f.endswith('/storage'):
+ and not f.endswith('/storage') and not f.endswith('.sock'):
self.addCopySpec(f)
--
To view, visit http://gerrit.ovirt.org/35513
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2aa8df2a8d16c7a3468cd7cad21fe598b33b8500
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <ykaplan(a)redhat.com>
9 years, 5 months
Change in vdsm[ovirt-3.5]: Live Merge: Proactively extend merge target volume
by alitke@redhat.com
Adam Litke has uploaded a new change for review.
Change subject: Live Merge: Proactively extend merge target volume
......................................................................
Live Merge: Proactively extend merge target volume
Since libvirt is not yet providing the write watermark information for
all volumes, we need to employ a workaround to support live merge on
block-based storage. When starting a merge, we can request the base
volume (merge target) to be extended to the size of the top volume
(merge source) plus one chunk to accomodate active writing. This may
cause some over-extension of the merge target volume but the upside is
that the merge should complete without active monitoring. Future
versions of oVirt will take advantage of an upcoming libvirt enhancement
to report write watermarks for all volumes which will allow on-demand
volume extension.
Change-Id: I3d483f9dfe6e19a9f9fec84950bf2ea0c7ed7946
Signed-off-by: Adam Litke <alitke(a)redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 29 insertions(+), 73 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/73/35573/1
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 15d4620..82cb0f1 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -1356,8 +1356,9 @@
to be extended. For the leaf volume curSize == self.apparentsize.
For internal volumes it is discovered by calling irs.getVolumeSize().
"""
- return (self.volExtensionChunk +
- ((curSize + constants.MEGAB - 1) / constants.MEGAB))
+ nextSize = (self.volExtensionChunk +
+ ((curSize + constants.MEGAB - 1) / constants.MEGAB))
+ return min(nextSize, self.truesize)
@property
def networkDev(self):
@@ -2468,69 +2469,12 @@
with self._confLock:
self.conf['timeOffset'] = newTimeOffset
- def _getMergeWriteWatermarks(self):
- drives = [drive for drive in self.getDiskDevices()
- if isVdsmImage(drive) and drive.blockDev]
- allChains = self._driveGetActualVolumeChain(drives).values()
- return dict((entry.uuid, entry.allocation)
- for chain in allChains
- for entry in chain)
-
- def _getLiveMergeExtendCandidates(self):
- ret = {}
-
- # The common case is that there are no active jobs.
- if not self.conf['_blockJobs'].values():
- return ret
-
- try:
- watermarks = self._getMergeWriteWatermarks()
- except LookupError:
- self.log.warning("Failed to look up watermark information")
- return ret
-
- for job in self.conf['_blockJobs'].values():
- try:
- drive = self._findDriveByUUIDs(job['disk'])
- except LookupError:
- # After an active layer merge completes the vdsm metadata will
- # be out of sync for a brief period. If we cannot find the old
- # disk then it's safe to skip it.
- continue
- if not drive.blockDev or drive.format != 'cow':
- continue
-
- if job['strategy'] == 'commit':
- volumeID = job['baseVolume']
- else:
- self.log.debug("Unrecognized merge strategy '%s'",
- job['strategy'])
- continue
- volSize = self.cif.irs.getVolumeSize(drive.domainID, drive.poolID,
- drive.imageID, volumeID)
- if volSize['status']['code'] != 0:
- self.log.error("Unable to get the size of volume %s (domain: "
- "%s image: %s)", volumeID, drive.domainID,
- drive.imageID)
- continue
-
- if volumeID in watermarks:
- self.log.debug("Adding live merge extension candidate: "
- "volume=%s", volumeID)
- ret[drive.imageID] = {
- 'alloc': watermarks[volumeID],
- 'physical': int(volSize['truesize']),
- 'capacity': drive.apparentsize,
- 'volumeID': volumeID}
- else:
- self.log.warning("No watermark info available for %s",
- volumeID)
- return ret
-
def _getExtendCandidates(self):
ret = []
- mergeCandidates = self._getLiveMergeExtendCandidates()
+ # FIXME: mergeCandidates should be a dictionary of candidate volumes
+ # once libvirt starts reporting watermark information for all volumes.
+ mergeCandidates = {}
for drive in self._devices[DISK_DEVICES]:
if not drive.blockDev or drive.format != 'cow':
continue
@@ -5870,7 +5814,6 @@
if res['info']['voltype'] == 'SHARED':
self.log.error("merge: Refusing to merge into a shared volume")
return errCode['mergeErr']
- baseSize = int(res['info']['apparentsize'])
# Indicate that we expect libvirt to maintain the relative paths of
# backing files. This is necessary to ensure that a volume chain is
@@ -5884,6 +5827,19 @@
# transitioned to the second phase. We must then tell libvirt to
# pivot to the new active layer (baseVolUUID).
flags |= libvirt.VIR_DOMAIN_BLOCK_COMMIT_ACTIVE
+
+ # If top is the active layer, it's allocated size is stored in
+ # drive.apparantsize.
+ topSize = drive.apparentsize
+ else:
+ # If top is an internal volume, we must call getVolumeInfo
+ res = self.cif.irs.getVolumeInfo(drive.domainID, drive.poolID,
+ drive.imageID, topVolUUID)
+ if res['status']['code'] != 0:
+ self.log.error("Unable to get volume info for '%s'",
+ topVolUUID)
+ return errCode['mergeErr']
+ topSize = int(res['info']['apparentsize'])
# Take the jobs lock here to protect the new job we are tracking from
# being cleaned up by queryBlockJobs() since it won't exist right away
@@ -5908,9 +5864,13 @@
# blockCommit will cause data to be written into the base volume.
# Perform an initial extension to ensure there is enough space to
- # start copying. The normal monitoring code will take care of any
- # future internal volume extensions that may be necessary
- self.extendDriveVolume(drive, baseVolUUID, baseSize)
+ # copy all the required data. Normally we'd use monitoring to extend
+ # the volume on-demand but internal watermark information is not being
+ # reported by libvirt so we must do the full extension up front. In
+ # the worst case, we'll need to extend 'base' to the same size as 'top'
+ # plus a bit more to accomodate additional writes to 'top' during the
+ # live merge operation.
+ self.extendDriveVolume(drive, baseVolUUID, topSize)
# Trigger the collection of stats before returning so that callers
# of getVmStats after this returns will see the new job
@@ -5938,14 +5898,10 @@
break
sourceAttr = ('file', 'dev')[drive.blockDev]
path = sourceXML.getAttribute(sourceAttr)
+
+ # TODO: Allocation information is not available in the XML. Switch
+ # to the new interface once it becomes available in libvirt.
alloc = None
- if drive.blockDev:
- allocXML = find_element_by_name(diskXML, 'allocation')
- if not allocXML:
- self.log.debug("<allocation/> missing from backing "
- "chain for block device %s", drive.name)
- break
- alloc = int(allocXML.firstChild.nodeValue)
bsXML = find_element_by_name(diskXML, 'backingStore')
if not bsXML:
self.log.warning("<backingStore/> missing from backing "
--
To view, visit http://gerrit.ovirt.org/35573
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3d483f9dfe6e19a9f9fec84950bf2ea0c7ed7946
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Adam Litke <alitke(a)redhat.com>
9 years, 5 months
Change in vdsm[master]: storage: Search only the current image for children
by alitke@redhat.com
Adam Litke has uploaded a new change for review.
Change subject: storage: Search only the current image for children
......................................................................
storage: Search only the current image for children
The getChildren method of FileVolume is currently searching all images
in the storage domain for children. A glob of all metadata files in the
SD is cached and then passed to grep to look for the child volumes. The
problem is that deleteVolumes takes an exclusive lock on the image
namespace only. If deletes are active on other images at the same time
we'll get errors with missing files.
The code mistakenly claims that children can be in any image on the
storage domain. It appears that they are in fact limited to the same
image. Therefore, the simplest resolution is to limit the search for
children to the current image.
Change-Id: I2ef9012cee3a8cb891926510c10ecc47b7cddaa1
Signed-off-by: Adam Litke <alitke(a)redhat.com>
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1069610
---
M vdsm/storage/fileVolume.py
1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/96/35096/1
diff --git a/vdsm/storage/fileVolume.py b/vdsm/storage/fileVolume.py
index a8e9835..8737e39 100644
--- a/vdsm/storage/fileVolume.py
+++ b/vdsm/storage/fileVolume.py
@@ -361,10 +361,10 @@
def getChildren(self):
""" Return children volume UUIDs.
- Children can be found in any image of the volume SD.
+ Children will always belong to the same image as this volume.
"""
domPath = self.imagePath.split('images')[0]
- metaPattern = os.path.join(domPath, 'images', '*', '*.meta')
+ metaPattern = os.path.join(domPath, 'images', self.imgUUID, '*.meta')
metaPaths = oop.getProcessPool(self.sdUUID).glob.glob(metaPattern)
pattern = "%s.*%s" % (volume.PUUID, self.volUUID)
matches = grepCmd(pattern, metaPaths)
--
To view, visit http://gerrit.ovirt.org/35096
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2ef9012cee3a8cb891926510c10ecc47b7cddaa1
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <alitke(a)redhat.com>
9 years, 5 months