Change in vdsm[master]: Introduce lvm short filters.
by ewarszaw@redhat.com
Eduardo has uploaded a new change for review.
Change subject: Introduce lvm short filters.
......................................................................
Introduce lvm short filters.
lvm commands that operate in a known VG can use the known pvs for
filter.
Change-Id: I26f3a7c712b6d7009f5f4e945374b62f18483889
Signed-off-by: Eduardo <ewarszaw(a)redhat.com>
---
M vdsm/storage/lvm.py
1 file changed, 38 insertions(+), 24 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/68/17968/1
diff --git a/vdsm/storage/lvm.py b/vdsm/storage/lvm.py
index 8f957ec..90576c0 100644
--- a/vdsm/storage/lvm.py
+++ b/vdsm/storage/lvm.py
@@ -302,8 +302,8 @@
self._vgs = {}
self._lvs = {}
- def cmd(self, cmd):
- finalCmd = self._addExtraCfg(cmd)
+ def cmd(self, cmd, devices=tuple()):
+ finalCmd = self._addExtraCfg(cmd, devices)
rc, out, err = misc.execCmd(finalCmd, sudo=True)
if rc != 0:
# Filter might be stale
@@ -362,13 +362,27 @@
return updatedPVs
+ def _getVGDevs(self, vgNames):
+ devices = []
+ for name in vgNames:
+ try:
+ pvs = self._vgs[name].pv_name # pv_names tuple
+ except KeyError: # Yet unknown VG
+ devices = tuple()
+ log.warning("Known and unknown yet VG mix: %s", vgNames)
+ break # unknownVG = True
+ else:
+ devices.extend(pvs)
+ else: # All known VGs
+ devices = tuple(devices)
+
def _reloadvgs(self, vgName=None):
cmd = list(VGS_CMD)
vgNames = _normalizeargs(vgName)
cmd.extend(vgNames)
with self._oplock.acquireContext(LVM_OP_RELOAD):
- rc, out, err = self.cmd(cmd)
+ rc, out, err = self.cmd(cmd, self._getVGDevs(vgNames))
if rc != 0:
log.warning("lvm vgs failed: %s %s %s", str(rc), str(out),
@@ -422,7 +436,7 @@
cmd.append(vgName)
with self._oplock.acquireContext(LVM_OP_RELOAD):
- rc, out, err = self.cmd(cmd)
+ rc, out, err = self.cmd(cmd, self._getVGDevs((vgName, )))
if rc != 0:
log.warning("lvm lvs failed: %s %s %s", str(rc), str(out),
@@ -629,7 +643,6 @@
lvs = dict(self._lvs)
return lvs.values()
-
_lvminfo = LVMCache()
@@ -656,7 +669,7 @@
cmd.extend(("--metadatasize", metadatasize, "--metadatacopies", "2",
"--metadataignore", "y"))
cmd.extend(devices)
- rc, out, err = _lvminfo.cmd(cmd)
+ rc, out, err = _lvminfo.cmd(cmd, devices)
return rc, out, err
@@ -719,7 +732,7 @@
def _setVgAvailability(vgs, available):
vgs = _normalizeargs(vgs)
cmd = ["vgchange", "--available", available] + vgs
- rc, out, err = _lvminfo.cmd(cmd)
+ rc, out, err = _lvminfo.cmd(cmd, _lvminfo._getVGDevs(vgs))
for vg in vgs:
_lvminfo._invalidatelvs(vg)
if rc != 0:
@@ -761,7 +774,7 @@
for attr in attrs:
cmd.extend(attr)
cmd.extend(lvnames)
- rc, out, err = _lvminfo.cmd(tuple(cmd))
+ rc, out, err = _lvminfo.cmd(tuple(cmd), _lvminfo._getVGDevs((vg, )))
_lvminfo._invalidatelvs(vg, lvs)
if rc != 0 and len(out) < 1:
raise se.StorageException("%d %s %s\n%s/%s" % (rc, out, err, vg, lvs))
@@ -868,7 +881,7 @@
# Activate the 1st PV metadata areas
cmd = ["pvchange", "--metadataignore", "n"]
cmd.append(pvs[0])
- rc, out, err = _lvminfo.cmd(cmd)
+ rc, out, err = _lvminfo.cmd(cmd, tuple(pvs))
if rc != 0:
raise se.PhysDevInitializationError(pvs[0])
@@ -876,7 +889,7 @@
if initialTag:
options.extend(("--addtag", initialTag))
cmd = ["vgcreate"] + options + [vgName] + pvs
- rc, out, err = _lvminfo.cmd(cmd)
+ rc, out, err = _lvminfo.cmd(cmd, tuple(pvs))
if rc == 0:
_lvminfo._invalidatepvs(pvs)
_lvminfo._invalidatevgs(vgName)
@@ -887,7 +900,7 @@
def removeVG(vgName):
cmd = ["vgremove", "-f", vgName]
- rc, out, err = _lvminfo.cmd(cmd)
+ rc, out, err = _lvminfo.cmd(cmd, _lvminfo._getVGDevs((vgName, )))
pvs = tuple(pvName for pvName, pv in _lvminfo._pvs.iteritems()
if not isinstance(pv, Stub) and pv.vg_name == vgName)
# PVS needs to be reloaded anyhow: if vg is removed they are staled,
@@ -917,7 +930,8 @@
_initpvs(pvs, int(vg.vg_mda_size) / 2 ** 20, force)
cmd = ["vgextend", vgName] + pvs
- rc, out, err = _lvminfo.cmd(cmd)
+ devs = tuple(_lvminfo._getVGDevs((vgName, )) + tuple(pvs))
+ rc, out, err = _lvminfo.cmd(cmd, devs)
if rc == 0:
_lvminfo._invalidatepvs(pvs)
_lvminfo._invalidatevgs(vgName)
@@ -928,7 +942,7 @@
def chkVG(vgName):
cmd = ["vgck", vgName]
- rc, out, err = _lvminfo.cmd(cmd)
+ rc, out, err = _lvminfo.cmd(cmd, _lvminfo._getVGDevs((vgName, )))
if rc != 0:
_lvminfo._invalidatevgs(vgName)
_lvminfo._invalidatelvs(vgName)
@@ -1010,7 +1024,7 @@
if initialTag is not None:
cmd.extend(("--addtag", initialTag))
cmd.extend(("--name", lvName, vgName))
- rc, out, err = _lvminfo.cmd(cmd)
+ rc, out, err = _lvminfo.cmd(cmd, _lvminfo._getVGDevs((vgName, )))
if rc == 0:
_lvminfo._invalidatevgs(vgName)
@@ -1053,7 +1067,7 @@
cmd.extend(LVM_NOBACKUP)
for lvName in lvNames:
cmd.append("%s/%s" % (vgName, lvName))
- rc, out, err = _lvminfo.cmd(cmd)
+ rc, out, err = _lvminfo.cmd(cmd, _lvminfo._getVGDevs((vgName, )))
if rc == 0:
for lvName in lvNames:
# Remove the LV from the cache
@@ -1077,7 +1091,7 @@
# Capitalise to use multiples of 1000 (S.I.) instead of 1024.
cmd = (op,) + LVM_NOBACKUP
cmd += ("--size", "%sm" % (size,), "%s/%s" % (vgName, lvName))
- rc, out, err = _lvminfo.cmd(cmd)
+ rc, out, err = _lvminfo.cmd(cmd, _lvminfo._getVGDevs((vgName, )))
if rc == 0:
_lvminfo._invalidatevgs(vgName)
_lvminfo._invalidatelvs(vgName, lvName)
@@ -1124,7 +1138,7 @@
def renameLV(vg, oldlv, newlv):
cmd = ("lvrename",) + LVM_NOBACKUP + (vg, oldlv, newlv)
- rc, out, err = _lvminfo.cmd(cmd)
+ rc, out, err = _lvminfo.cmd(cmd, _lvminfo._getVGDevs((vg, )))
if rc != 0:
raise se.LogicalVolumeRenameError("%s %s %s" % (vg, oldlv, newlv))
@@ -1135,7 +1149,7 @@
def refreshLV(vgName, lvName):
# If the logical volume is active, reload its metadata.
cmd = ['lvchange', '--refresh', "%s/%s" % (vgName, lvName)]
- rc, out, err = _lvminfo.cmd(cmd)
+ rc, out, err = _lvminfo.cmd(cmd, _lvminfo._getVGDevs((vgName, )))
_lvminfo._invalidatelvs(vgName, lvName)
if rc != 0:
raise se.LogicalVolumeRefreshError("%s failed" % list2cmdline(cmd))
@@ -1146,7 +1160,7 @@
def addtag(vg, lv, tag):
lvname = "%s/%s" % (vg, lv)
cmd = ("lvchange",) + LVM_NOBACKUP + ("--addtag", tag) + (lvname,)
- rc, out, err = _lvminfo.cmd(cmd)
+ rc, out, err = _lvminfo.cmd(cmd, _lvminfo._getVGDevs((vg, )))
_lvminfo._invalidatelvs(vg, lv)
if rc != 0:
# Fix me: should be se.ChangeLogicalVolumeError but this not exists.
@@ -1173,7 +1187,7 @@
cmd.append(lvname)
- rc, out, err = _lvminfo.cmd(cmd)
+ rc, out, err = _lvminfo.cmd(cmd, _lvminfo._getVGDevs((vg, )))
_lvminfo._invalidatelvs(vg, lv)
if rc != 0:
raise se.LogicalVolumeReplaceTagError(
@@ -1227,7 +1241,7 @@
cmd.extend(("--addtag", tag))
cmd.append(vgName)
- rc, out, err = _lvminfo.cmd(cmd)
+ rc, out, err = _lvminfo.cmd(cmd, _lvminfo._getVGDevs((vgName, )))
_lvminfo._invalidatevgs(vgName)
if rc != 0:
raise se.VolumeGroupReplaceTagError(
@@ -1238,7 +1252,7 @@
def addVGTag(vgName, tag):
_lvminfo._invalidatevgs(vgName)
cmd = ["vgchange", "--addtag", tag, vgName]
- rc, out, err = _lvminfo.cmd(cmd)
+ rc, out, err = _lvminfo.cmd(cmd, _lvminfo._getVGDevs((vgName, )))
if rc != 0:
raise se.VolumeGroupAddTagError("Failed adding tag %s to VG %s." %
(tag, vgName))
@@ -1247,7 +1261,7 @@
def remVGTag(vgName, tag):
_lvminfo._invalidatevgs(vgName)
cmd = ["vgchange", "--deltag", tag, vgName]
- rc, out, err = _lvminfo.cmd(cmd)
+ rc, out, err = _lvminfo.cmd(cmd, _lvminfo._getVGDevs((vgName, )))
if rc != 0:
raise se.VolumeGroupRemoveTagError(vgName)
@@ -1303,7 +1317,7 @@
lvname = "%s/%s" % (vg, lv)
cmd = (("lvchange",) + LVM_NOBACKUP + ("--deltag", deltag) +
("--addtag", addtag) + (lvname,))
- rc, out, err = _lvminfo.cmd(cmd)
+ rc, out, err = _lvminfo.cmd(cmd, _lvminfo._getVGDevs((vg, )))
_lvminfo._invalidatelvs(vg, lv)
if rc != 0:
raise se.LogicalVolumeReplaceTagError("%s/%s" % (vg, lv),
--
To view, visit http://gerrit.ovirt.org/17968
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I26f3a7c712b6d7009f5f4e945374b62f18483889
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Eduardo <ewarszaw(a)redhat.com>
10 years, 8 months
Change in vdsm[master]: Packaging: VDSM v4.12.0 packaged on Ubuntu
by zhshzhou@linux.vnet.ibm.com
Zhou Zheng Sheng has uploaded a new change for review.
Change subject: Packaging: VDSM v4.12.0 packaged on Ubuntu
......................................................................
Packaging: VDSM v4.12.0 packaged on Ubuntu
Add files for building VDSM .deb package on Ubuntu. vdsm-reg is not
included. For simplicity, the whole VDSM is packaged in a single binary.
In future we can split sub-packages.
How does it work.
The deb packaging scripts are written according to Debian New
Maintainers' Guide [1]. We use dh_make, quilt and -buildpackage to do
the packaging. All files unde the sub-dir debian are related to
packaging. The most important ones are as follow.
debian/changelog
This file declares the deb package version.
debian/control
This file declares the dependency packages and other basic informations
debian/rules
This file is an executable Makefile. During the packaging process, it
calls dh_XXX helpers to do the things. We can override some of the stages to
provide custom actions.
debian/postinst
debian/postrm
debian/preinst
debian/prerm
These four files are maintainer scripts. They are like %pre %post %preun
and %postun in a RPM .spec file. They are run before VDSM package is
intalled, upgraded, and removed. The Debian upgrading process is not
like RPM.
Script execution order when updating a RPM [2]
%pre of new package
(package install)
%post of new package
%preun of old package
(removal of old package)
%postun of old package
Script execution order when updating DEB [3]
old->prerm upgrade new_ver
new->preinst upgrade old_ver
(new files are unpackad)
old->postrm upgrade new_ver
(old files are deleted)
new->postinst configure old_ver
So you will see the contents of these file is very different with
vdsm.spec.in. Another difference is Debian do not generate .pyc files
when packaging, instead, it just ship .py files and after install,
compile the .py to .pyc according to /etc/python/debian_config [4]. The
postinst and prerm scripts do this automatically if we include the
string "#DEBHELPER#". This means actions calling the .pyc files should
happen after the .pyc files are generated.
debian/patches/*
The directory contains Debian specific patches. The patches are too
specific so not go to upstream. Usually are very small patches. In this
gerrit patch set, I create a small patch to adapt to Ubuntu libvirt
configuration path. The patch file can be generated automatically by
quilt [5].
Other files are just boilerplates to fill.
There are some dependencies that are too old or not available on Ubuntu.
python-ethtool
Too old. The official maintainer does not work on it any longer. So we
have to download the source package and repackage it using the latest
upstream.
python-pthreading
Not available on Ubuntu, need to create .deb packages.
python-rtslib
Ubuntu provide the official version, but in xmlrpctests.py we use the
Fedora forked version. The two versions are not compatible. In future we
shoud split the tests package and provide forked version in deb package.
sanlock
Too old. The official maintainer does not work on it any longer, but he
helps me and provide new version of sanlock packages. These new packages
are not in Debian official repository unless they are well tested. For
now we can host these packages together with VDSM .deb package.
libvirt and libvirt-sanlock
libvirt is too old and libvirt-sanlock is not available on Ubuntu.
Fortunately new libvirt and libvirt-sanlock are available in Debian
development repository "sid", but they are conflicting with some Ubuntu
packages. After remove the conflicting ones automatically, libvirt and
libvirt-sanlock can be upraded to new version
I've gathered all VDSM dependencies, including the above ones. libvirt
and libvirt-sanlock are downloaded from Debian "sid", python-ethtool and
python-rtslib some are re-packaged to VDSM compatible version.
python-pthreading are packaged from sratch. sanlock pakcages are provided
by the original maintainer, but not well tested. I'll put these packages
to my github later, then I update the commit message.
[1] http://www.debian.org/doc/manuals/maint-guide/index.en.html
[2] http://fedoraproject.org/wiki/Packaging:ScriptletSnippets
[3] https://wiki.debian.org/MaintainerScripts
[4] http://www.debian.org/doc/packaging-manuals/python-policy/ch-module_packa...
[5] http://www.debian.org/doc/manuals/maint-guide/modify.en.html
Change-Id: Iab62aeadfa65baef3f0f4e6da2592fa0ff451c6f
Signed-off-by: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
---
A debian/README.Debian
A debian/TODO
A debian/changelog
A debian/compat
A debian/control
A debian/copyright
A debian/dependencyMap.txt
A debian/docs
A debian/patches/libvirt-conf-path.patch
A debian/patches/series
A debian/postinst
A debian/postrm
A debian/preinst
A debian/prerm
A debian/rules
A debian/source/format
A debian/watch
17 files changed, 491 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/43/18443/1
diff --git a/debian/README.Debian b/debian/README.Debian
new file mode 100644
index 0000000..6e55cf1
--- /dev/null
+++ b/debian/README.Debian
@@ -0,0 +1,6 @@
+vdsm for Ubuntu
+---------------
+
+VDSM 4.12.0 packaged for Ubuntu, with some Ubuntu specific patches.
+
+ -- Zheng Sheng, Zhou <zhshzhou(a)linux.vnet.ibm.com> Mon, 19 Aug 2013 11:29:59 +0800
diff --git a/debian/TODO b/debian/TODO
new file mode 100644
index 0000000..ca5c737
--- /dev/null
+++ b/debian/TODO
@@ -0,0 +1,13 @@
+1. Add script in postinst and postrm to add/delete vdsm related kernel modules
+from /etc/modules, as well as other cleanups.
+
+2. Split the big single binary into sub-packages.
+
+3. Fedora rtslib is actually rtslib-fb, it's incompatible with the official
+rtslib. Ubuntu provides official rtslib through python-rtslib package, but
+vdsm functional test need rtslib-fb. We have to split the tests to sub-package
+and provide our own python-rtslib package based on rtslib-fb. Then the
+developers can setup a dedicated environment to run functional tests. The users
+do not need python-rtslib.
+
+4. Setup a Jenkins slave for building VDSM deb package and run tests.
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..edbb11e
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+vdsm (4.12.0-1) unstable; urgency=low
+
+ * Initial release on Ubuntu 13.04 .
+
+ -- Zheng Sheng, Zhou <zhshzhou(a)linux.vnet.ibm.com> Mon, 19 Aug 2013 11:29:59 +0800
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..45a4fb7
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+8
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..982b8d9
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,19 @@
+Source: vdsm
+Section: admin
+Priority: extra
+Maintainer: Zheng Sheng, Zhou <zhshzhou(a)linux.vnet.ibm.com>
+Build-Depends: debhelper (>= 8.0.0), python (>=2.7.4), python-dev, python-nose, python-netaddr, python-ethtool (>=0.8-1), python-pthreading (>=0.1.2-1), python-selinux, python-libvirt (>= 1.1.1-1), genisoimage, openssl, python-dmidecode, autoconf, automake, libgettextpo-dev, libasprintf-dev, gettext, libtool, pyflakes, pep8
+Standards-Version: 3.9.4
+Homepage: http://www.ovirt.org/wiki/Vdsm
+Vcs-Git: git://gerrit.ovirt.org/vdsm
+Vcs-Browser: http://gerrit.ovirt.org/gitweb?p=vdsm.git
+
+Package: vdsm
+Architecture: amd64
+Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}, debianutils, sudo (>= 1.7.3), logrotate, rsyslog, xz-utils, ntp, iproute, python-netaddr, python-pyinotify, python-ethtool (>= 0.8-1), python-rpm, nfs-client, nfs-server, python-m2crypto, libguestfs-tools, python-dmidecode, dmidecode, libvirt-bin (>= 1.0.2-1), libvirt0 (>= 1.0.2-1), libvirt-sanlock, python-libvirt (>= 1.1.1-1), python-pthreading (>= 0.1.2), fence-agents, python (>= 2.7.4), qemu-kvm (>= 1.4.0), qemu-utils (>= 1.4.0), python-ethtool (>= 0.8-1), initscripts (>= 2.88), ifupdown, sysvinit-utils, sysv-rc, open-iscsi (>= 2.0.873), multipath-tools (>= 0.4.9-3), e2fsprogs (>= 1.41.14), linux-image-generic (>= 3.6), sanlock (>= 2.4-2), libsanlock-client1 (>= 2.4-2), libsanlock-dev (>= 2.4-2), sanlock-python (>= 2.4-2), policycoreutils (>=2.1.13-2), python-sepolgen, sed (>= 4.2.1-10), ed, selinux-policy-default (>= 2.20110726-12), lvm2 (>= 2.02.95), psmisc (>= 22.6-15), bridge-utils, sosreport, tree, dos!
fstools, genisoimage, python-selinux, python-parted, sasl2-bin, hostname, glusterfs-common (>= 3.4.0), glusterfs-client, glusterfs-server, python-magic, python-rtslib (>= 2.1.fb37.1), python-nose, gnutls-bin
+Conflicts: apparmor
+Description: VDSM: Virtual Desktop Server Manager
+ The VDSM service is required by a Virtualization Manager to manage the
+ Linux hosts. VDSM manages and monitors the host's storage, memory and
+ networks as well as virtual machine creation, other host administration
+ tasks, statistics gathering, and log collection.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..6438075
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,43 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: vdsm
+Source: http://gerrit.ovirt.org/gitweb?p=vdsm.git
+
+Files: *
+Copyright: 2012 Red Hat, Inc.
+ 2013 IBM, Inc.
+ 2013 Packaged by Zheng Sheng, Zhou <zhshzhou(a)linux.vnet.ibm.com>
+License: GPL-2+
+ This package is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+ .
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
+
+Files: debian/*
+Copyright: 2013 Zheng Sheng, Zhou <zhshzhou(a)linux.vnet.ibm.com>
+License: GPL-2+
+ This package is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+ .
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
diff --git a/debian/dependencyMap.txt b/debian/dependencyMap.txt
new file mode 100644
index 0000000..4fa9110
--- /dev/null
+++ b/debian/dependencyMap.txt
@@ -0,0 +1,84 @@
+Fedora/RHEL/CentOS Ubuntu
+/bin/hostname hostname
+/usr/sbin/saslpasswd2 sasl2-bin
+autoconf autoconf
+automake automake
+bridge-utils bridge-utils
+device-mapper-multipath >= 0.4.9-52 multipath-tools
+dmidecode dmidecode
+dosfstools dosfstools
+dracut initramfs-tools
+e2fsprogs >= 1.41.14 e2fsprogs
+fence-agents fence-agents
+genisoimage genisoimage
+gettext-devel libgettextpo-dev libasprintf-dev gettext
+glusterfs >= 3.4.0 glusterfs-common
+glusterfs-fuse glusterfs-client
+glusterfs-rdma glusterfs-common
+glusterfs-server glusterfs-server
+initscripts >= 9.42.2-1 initscripts ifupdown sysvinit-utils sysv-rc
+iproute iproute
+iscsi-initiator-utils >= 6.2.0.872-15 open-iscsi
+kernel >= 3.6 linux-image-generic
+libguestfs-tools libguestfs-tools
+libguestfs-tools-c ?
+libselinux-python python-selinux
+libtool libtool
+libvirt >= 1.0.2-1 libvirt-bin libvirt0
+libvirt-client libvirt-bin libvirt0
+libvirt-daemon >= 1.0.2-1 libvirt-bin libvirt0
+libvirt-daemon-config-nwfilter libvirt-bin
+libvirt-daemon-driver-network libvirt-bin
+libvirt-daemon-driver-nwfilter libvirt-bin
+libvirt-daemon-driver-qemu libvirt-bin
+libvirt-lock-sanlock sid:libvirt-sanlock
+libvirt-python python-libvirt
+logrotate logrotate
+lvm2 >= 2.02.95 lvm2
+m2crypto python-m2crypto
+mom >= 0.3.2-2 ?
+nfs-utils nfs-client nfs-server
+ntp ntp
+openssl openssl
+policycoreutils >= 2.1.13-55 policycoreutils
+policycoreutils-python >= 2.0.83-19.30 policycoreutils python-sepolgen missing:sepolicy
+psmisc >= 22.6-15 psmisc
+pyflakes pyflakes
+pyparted python-parted
+python >= 2.7.3 python
+python-devel python-dev
+python-dmidecode python-dmidecode
+python-ethtool >= 0.8-1 python-ethtool
+python-inotify python-pyinotify
+python-libguestfs python-libguestfs
+python-magic python-magic
+python-netaddr python-netaddr
+python-nose python-nose
+python-ordereddict pip:ordereddict (python 2.7 do not need this)
+python-pep8 pep8
+python-pthreading >= 0.1.2 pip:pthreading
+python2-devel python-dev
+qemu-img >= 2:0.15.0-4 qemu-utils
+qemu-kvm >= 2:0.15.0-4 qemu-kvm
+rpm-python python-rpm
+rsyslog rsyslog
+sanlock >= 2.4-2 TooOld:sanlock libsanlock-dev libsanlock-client1
+sanlock-python self packaged:sanlock-python
+sed >= 4.2.1-10 sed
+selinux-policy-targeted >= 3.11.1-71 selinux-policy-default
+sos sid:sosreport
+sudo >= 1.7.3 sudo
+systemd >= 197-1.fc18.2 ?
+systemd-units ?
+tree tree
+usbutils usbutils
+vhostmd ?
+which debianutils
+xz xz-utils
+
+extra
+build-essential
+python-pip
+pip:rtslib-fb (python-rtslib is not compatible)
+gnutls-bin
+augeas-tools
diff --git a/debian/docs b/debian/docs
new file mode 100644
index 0000000..5ad6b39
--- /dev/null
+++ b/debian/docs
@@ -0,0 +1,3 @@
+commit-template.txt
+NEWS
+README
diff --git a/debian/patches/libvirt-conf-path.patch b/debian/patches/libvirt-conf-path.patch
new file mode 100644
index 0000000..21d8153
--- /dev/null
+++ b/debian/patches/libvirt-conf-path.patch
@@ -0,0 +1,22 @@
+Adapt to Ubuntu libvirt configuration file path.
+--- a/lib/vdsm/tool/libvirt_configure.sh.in
++++ b/lib/vdsm/tool/libvirt_configure.sh.in
+@@ -25,7 +25,7 @@
+ QEMU_DUMP_PATH="/var/log/core"
+ LCONF="@sysconfdir(a)/libvirt/libvirtd.conf"
+ QCONF="@sysconfdir(a)/libvirt/qemu.conf"
+-LDCONF="@sysconfdir@/sysconfig/libvirtd"
++LDCONF="@sysconfdir@/default/libvirt-bin"
+ QLCONF="@sysconfdir(a)/libvirt/qemu-sanlock.conf"
+
+ # trigger for reconfiguration
+@@ -213,6 +213,9 @@
+ set_if_default "${ldconf}" LIBVIRTD_ARGS --listen
+ set_if_default "${ldconf}" DAEMON_COREFILE_LIMIT unlimited
+ set_if_default "${qconf}" save_image_format \"lzop\"
++ set_if_default "${qconf}" user \"@QEMUUSER@\"
++ set_if_default "${qconf}" group \"@QEMUGROUP@\"
++ echo unix_sock_group=\"@VDSMGROUP@\" >> "${lconf}"
+ # FIXME until we are confident with libvirt integration, let us have a verbose log
+ set_if_default "${lconf}" log_outputs \"1:file:/var/log/libvirt/libvirtd.log\"
+ set_if_default "${lconf}" log_filters "\"3:virobject 3:virfile 2:virnetlink \
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..b849980
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+libvirt-conf-path.patch
diff --git a/debian/postinst b/debian/postinst
new file mode 100644
index 0000000..1d7a28b
--- /dev/null
+++ b/debian/postinst
@@ -0,0 +1,107 @@
+#!/bin/sh
+# postinst script for vdsm
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * <postinst> `configure' <most-recently-configured-version>
+# * <old-postinst> `abort-upgrade' <new version>
+# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+# <new-version>
+# * <postinst> `abort-remove'
+# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+# <failed-install-package> <version> `removing'
+# <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+VDSM_USER=vdsm
+VDSM_GROUP=kvm
+QEMU_GROUP=kvm
+SNLK_GROUP=sanlock
+SNLK_USER=sanlock
+LIBVIRT_SOCK_GROUP=libvirt
+
+INSTALLDIR="install -dDm 0755 -o $VDSM_USER -g $VDSM_GROUP"
+
+case "$1" in
+ configure)
+ getent passwd "$VDSM_USER" >/dev/null || \
+ useradd -r -u 36 -g "$VDSM_GROUP" -d /var/lib/vdsm \
+ -s /usr/sbin/nologin -c "Node Virtualization Manager" "$VDSM_USER"
+ #getent passwd "$SNLK_USER" >/dev/null || useradd -r -g "$SNLK_GROUP" \
+ # -s /bin/false -c "sanlock service" "$SNLK_USER"
+ usermod -a -G "$QEMU_GROUP","$SNLK_GROUP","$LIBVIRT_SOCK_GROUP" "$VDSM_USER"
+ usermod -a -G "$QEMU_GROUP","$VDSM_GROUP" "$SNLK_USER"
+ usermod -a -G "$QEMU_GROUP","$VDSM_GROUP" "$SNLK_USER"
+
+ start_conf_section="## beginning of configuration section by vdsm"
+ end_conf_section="## end of configuration section by vdsm"
+ if ! grep "$start_conf_section" /etc/default/sanlock ; then
+ echo "$start_conf_section" >> /etc/default/sanlock
+ echo "sanlock_opts=\"\$sanlock_opts -U sanlock -G sanlock\"" >> /etc/default/sanlock
+ echo "$end_conf_section" >> /etc/default/sanlock
+ fi
+
+ $INSTALLDIR /rhev
+ $INSTALLDIR /rhev/data-center
+ $INSTALLDIR /rhev/data-center/hsm-tasks
+ $INSTALLDIR /rhev/data-center/mnt
+ $INSTALLDIR /var/lib/libvirt/qemu/channels
+ chmod 775 /var/lib/libvirt/qemu/channels
+ $INSTALLDIR /etc/pki/vdsm
+ $INSTALLDIR /etc/pki/vdsm/keys
+ $INSTALLDIR /etc/pki/vdsm/certs
+ $INSTALLDIR /var/lib/vdsm
+ $INSTALLDIR /var/lib/vdsm/connections
+ $INSTALLDIR /var/lib/vdsm/netconfback
+ $INSTALLDIR /var/run/vdsm
+ $INSTALLDIR /var/run/vdsm/payload
+ $INSTALLDIR /var/run/vdsm/pools
+ $INSTALLDIR /var/run/vdsm/sourceRoutes
+ $INSTALLDIR /var/run/vdsm/trackedInterfaces
+ $INSTALLDIR /var/log/vdsm
+ $INSTALLDIR /var/log/vdsm/backup
+ chmod g+x /var/lib/libvirt/qemu
+ chmod 644 /etc/iscsi/initiatorname.iscsi
+
+ vdsm-tool sebool-config || :
+ sysctl -q -p /etc/sysctl.d/vdsm
+ vdsm-tool load-needed-modules
+
+ echo /usr/lib/sanlock/ > /etc/ld.so.conf.d/sanlock.conf
+ ldconfig
+
+ udevadm control --reload-rules
+
+ initctl reload-configuration
+ ;;
+
+ *)
+ echo "postinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+# vdsm hooks are invoked as .pyc files, but the .pyc files are generated by
+# dh helpers. Restarting vdsmd should be run after dh helpers so that the
+# hooks are invoked correctly.
+if [ "$1" = "configure" ]; then
+ if initctl status supervdsmd | grep -q start/running ; then
+ initctl stop supervdsmd || :
+ initctl start supervdsmd || :
+ fi
+ if initctl status vdsmd | grep -q start/running ; then
+ initctl stop vdsmd || :
+ initctl start vdsmd || :
+ fi
+fi
+
+exit 0
diff --git a/debian/postrm b/debian/postrm
new file mode 100644
index 0000000..7d7015a
--- /dev/null
+++ b/debian/postrm
@@ -0,0 +1,44 @@
+#!/bin/sh
+# postrm script for vdsm
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * <postrm> `remove'
+# * <postrm> `purge'
+# * <old-postrm> `upgrade' <new-version>
+# * <new-postrm> `failed-upgrade' <old-version>
+# * <new-postrm> `abort-install'
+# * <new-postrm> `abort-install' <old-version>
+# * <new-postrm> `abort-upgrade' <old-version>
+# * <disappearer's-postrm> `disappear' <overwriter>
+# <overwriter-version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+ purge|remove|disappear)
+ initctl reload-configuration
+ if initctl status libvirt-bin | grep -q start/running ; then
+ initctl stop libvirt-bin && initctl start libvirt-bin
+ fi
+ ;;
+
+ upgrade)
+ ;;
+
+ *)
+ echo "postrm called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/preinst b/debian/preinst
new file mode 100644
index 0000000..f2d238d
--- /dev/null
+++ b/debian/preinst
@@ -0,0 +1,32 @@
+#!/bin/sh
+# preinst script for vdsm
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * <new-preinst> `install'
+# * <new-preinst> `install' <old-version>
+# * <new-preinst> `upgrade' <old-version>
+# * <old-preinst> `abort-upgrade' <new-version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+ install|upgrade)
+ ;;
+
+ *)
+ echo "preinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/prerm b/debian/prerm
new file mode 100644
index 0000000..eaacbbc
--- /dev/null
+++ b/debian/prerm
@@ -0,0 +1,62 @@
+#!/bin/sh
+# prerm script for vdsm
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * <prerm> `remove'
+# * <old-prerm> `upgrade' <new-version>
+# * <new-prerm> `failed-upgrade' <old-version>
+# * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
+# * <deconfigured's-prerm> `deconfigure' `in-favour'
+# <package-being-installed> <version> `removing'
+# <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+ remove)
+ initctl stop vdsmd || :
+ initctl stop supervdsmd || :
+
+ start_conf_section="## beginning of configuration section by vdsm"
+ end_conf_section="## end of configuration section by vdsm"
+ by_vdsm="by vdsm"
+
+ /bin/sed -i -e "/${start_conf_section}/,/${end_conf_section}/d" \
+ -e "/${by_vdsm}/d" \
+ /etc/default/libvirt-bin \
+ /etc/libvirt/libvirtd.conf \
+ /etc/libvirt/qemu.conf \
+ /etc/libvirt/qemu-sanlock.conf \
+ /etc/logrotate.d/libvirtd \
+ /etc/sysctl.conf \
+ /etc/default/sanlock
+
+ # Restoring backuped logrotate.d/libvirtd
+ /bin/sed -i -e 's/# VDSM backup//' /etc/logrotate.d/libvirtd
+ vdsm-tool sebool-unconfig || :
+ saslpasswd2 -p -a libvirt -d vdsm@ovirt
+ ;;
+
+ upgrade)
+ ;;
+
+ deconfigure)
+ ;;
+
+ *)
+ echo "prerm called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..6b7ffd7
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,45 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+override_dh_auto_configure:
+ autoreconf -if
+ dh_auto_configure -- --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=/usr/lib --libexecdir=/usr/libexec
+
+destdir = debian/vdsm
+
+override_dh_auto_install:
+ dh_auto_install
+ # Install the lvm rules
+ install -Dm 0644 vdsm/storage/12-vdsm-lvm.rules \
+ $(destdir)/lib/udev/rules.d/61-vdsm-lvm.rules
+ install -Dm 0644 vdsm/limits.conf \
+ $(destdir)/etc/security/limits.d/99-vdsm.conf
+ install -Dm 0644 init/upstart/vdsmd.upstart \
+ $(destdir)/etc/init/vdsmd.conf
+ install -Dm 0644 init/upstart/supervdsmd.upstart \
+ $(destdir)/etc/init/supervdsmd.conf
+ install -Dm 0644 init/upstart/vdsm-restore-net-config.upstart \
+ $(destdir)/etc/init/vdsm-restore-net-config.conf
+ install -Dm 0644 init/upstart/vdsm-tmpfiles.upstart \
+ $(destdir)/etc/init/vdsm-tmpfiles.conf
+ install -Dm 0644 init/systemd/vdsm-tmpfiles.d.conf $(destdir)/etc/vdsm/vdsm-tmpfiles.conf
+ # This is not commonplace, but we want /var/log/core to be a world-writable
+ # dropbox for core dumps
+ install -dDm 1777 $(destdir)/var/log/core
+ # Install the configuration sample
+ install -Dm 0644 lib/vdsm/vdsm.conf.sample \
+ $(destdir)/etc/vdsm/vdsm.conf
+ # Install the polkit for libvirt
+ install -Dm 0644 vdsm/vdsm-libvirt-access.pkla \
+ $(destdir)/var/lib/polkit-1/localauthority/10-vendor.d/10-vdsm-libvirt-access.pkla
+
+%:
+ dh $@ --with python2
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..28389ae
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,3 @@
+version=3
+
+http://pkgs.fedoraproject.org/repo/pkgs/vdsm/vdsm-(.*)\.tar\.gz
--
To view, visit http://gerrit.ovirt.org/18443
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iab62aeadfa65baef3f0f4e6da2592fa0ff451c6f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
10 years, 8 months
Change in vdsm[master]: Change of ConfigWriter._createConfFile parameters
by psebek@redhat.com
Petr Šebek has uploaded a new change for review.
Change subject: Change of ConfigWriter._createConfFile parameters
......................................................................
Change of ConfigWriter._createConfFile parameters
ifcfg.ConfigWriter._createConfFile now accepts IpConfig object instead
of number of arguments. It helps to reduce number of arguments passed
and make interface more flexible.
Change-Id: Iae5ec15048ed52170371dda1d0fa9b90d51838e3
Signed-off-by: Petr Sebek <psebek(a)redhat.com>
---
M vdsm/netconf/ifcfg.py
1 file changed, 30 insertions(+), 44 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/31/18331/1
diff --git a/vdsm/netconf/ifcfg.py b/vdsm/netconf/ifcfg.py
index 8fafbd0..7ba6361 100644
--- a/vdsm/netconf/ifcfg.py
+++ b/vdsm/netconf/ifcfg.py
@@ -445,30 +445,29 @@
return None
return 'yes' if defaultRoute else 'no'
- def _createConfFile(self, conf, name, ipaddr=None, netmask=None,
- gateway=None, bootproto=None, mtu=None,
- defaultRoute=None, onboot='yes', **kwargs):
+ def _createConfFile(self, conf, name, ipconfig=None, mtu=None,
+ onboot='yes', **kwargs):
""" Create ifcfg-* file with proper fields per device """
cfg = self.CONFFILE_HEADER + '\n'
cfg += """DEVICE=%s\nONBOOT=%s\n""" % (pipes.quote(name),
pipes.quote(onboot))
cfg += conf
- if ipaddr:
- cfg = cfg + 'IPADDR=%s\nNETMASK=%s\n' % (pipes.quote(ipaddr),
- pipes.quote(netmask))
- if gateway:
- cfg = cfg + 'GATEWAY=%s\n' % pipes.quote(gateway)
- # According to manual the BOOTPROTO=none should be set
- # for static IP
- cfg = cfg + 'BOOTPROTO=none\n'
- else:
- if bootproto:
- cfg = cfg + 'BOOTPROTO=%s\n' % pipes.quote(bootproto)
+ if ipconfig is not None:
+ if ipconfig.ipaddr:
+ cfg = cfg + 'IPADDR=%s\n' % pipes.quote(ipconfig.ipaddr)
+ cfg = cfg + 'NETMASK=%s\n' % pipes.quote(ipconfig.netmask)
+ if ipconfig.gateway:
+ cfg = cfg + 'GATEWAY=%s\n' % pipes.quote(ipconfig.gateway)
+ # According to manual the BOOTPROTO=none should be set
+ # for static IP
+ cfg = cfg + 'BOOTPROTO=none\n'
+ elif ipconfig.bootproto:
+ cfg = cfg + 'BOOTPROTO=%s\n' % pipes.quote(ipconfig.bootproto)
+ if ipconfig.defaultRoute:
+ cfg = cfg + 'DEFROUTE=%s\n' % ipconfig.defaultRoute
if mtu:
cfg = cfg + 'MTU=%d\n' % mtu
- if defaultRoute:
- cfg = cfg + 'DEFROUTE=%s\n' % defaultRoute
cfg += 'NM_CONTROLLED=no\n'
BLACKLIST = ['TYPE', 'NAME', 'DEVICE', 'bondingOptions',
'force', 'blockingdhcp',
@@ -484,24 +483,16 @@
def addBridge(self, bridge, **opts):
""" Create ifcfg-* file with proper fields for bridge """
- ipaddr, netmask, gateway, bootproto, _, defaultRoute = \
- bridge.ipConfig
conf = 'TYPE=Bridge\nDELAY=%s\n' % bridge.forwardDelay
- self._createConfFile(conf, bridge.name, ipaddr, netmask, gateway,
- bootproto, bridge.mtu,
- self._toIfcfgFormat(defaultRoute), **opts)
+ self._createConfFile(conf, bridge.name, bridge.ip, bridge.mtu, **opts)
def addVlan(self, vlan, **opts):
""" Create ifcfg-* file with proper fields for VLAN """
- ipaddr, netmask, gateway, bootproto, _, defaultRoute = \
- vlan.ipConfig
conf = 'VLAN=yes\n'
if vlan.bridge:
conf += 'BRIDGE=%s\n' % pipes.quote(vlan.bridge.name)
- self._createConfFile(conf, vlan.name, ipaddr, netmask, gateway,
- bootproto, vlan.mtu,
- self._toIfcfgFormat(defaultRoute), **opts)
+ self._createConfFile(conf, vlan.name, vlan.ip, vlan.mtu, **opts)
def addBonding(self, bond, **opts):
""" Create ifcfg-* file with proper fields for bond """
@@ -509,10 +500,8 @@
if bond.bridge:
conf += 'BRIDGE=%s\n' % pipes.quote(bond.bridge.name)
- ipaddr, netmask, gateway, bootproto, mtu, defaultRoute = \
- self._getIfaceConfValues(bond, netinfo.NetInfo())
- self._createConfFile(conf, bond.name, ipaddr, netmask, gateway,
- bootproto, mtu, defaultRoute, **opts)
+ ipconfig = self._getIfaceConfValues(bond, netinfo.NetInfo())
+ self._createConfFile(conf, bond.name, ipconfig, **opts)
# create the bonding device to avoid initscripts noise
if bond.name not in open(netinfo.BONDING_MASTERS).read().split():
@@ -530,31 +519,28 @@
if nic.bond:
conf += 'MASTER=%s\nSLAVE=yes\n' % pipes.quote(nic.bond.name)
- ipaddr, netmask, gateway, bootproto, mtu, defaultRoute = \
- self._getIfaceConfValues(nic, _netinfo)
- self._createConfFile(conf, nic.name, ipaddr, netmask, gateway,
- bootproto, mtu, defaultRoute, **opts)
+ ipconfig = self._getIfaceConfValues(nic, _netinfo)
+ self._createConfFile(conf, nic.name, ipconfig, **opts)
@staticmethod
def _getIfaceConfValues(iface, _netinfo):
- ipaddr, netmask, gateway, bootproto, _, defaultRoute = \
- iface.ipConfig
- defaultRoute = ConfigWriter._toIfcfgFormat(defaultRoute)
+ ipconfig = iface.ip
+ defaultRoute = ConfigWriter._toIfcfgFormat(ipconfig.inet.defaultRoute)
mtu = iface.mtu
if _netinfo.ifaceUsers(iface.name):
confParams = netinfo.getIfaceCfg(iface.name)
- if not ipaddr and bootproto != 'dhcp':
- ipaddr = confParams.get('IPADDR', None)
- netmask = confParams.get('NETMASK', None)
- gateway = confParams.get('GATEWAY', None)
- bootproto = confParams.get('BOOTPROTO', None)
+ if not ipconfig.inet.address and ipconfig.bootproto != 'dhcp':
+ ipconfig.inet.address = confParams.get('IPADDR', None)
+ ipconfig.inet.netmask = confParams.get('NETMASK', None)
+ ipconfig.inet.gateway = confParams.get('GATEWAY', None)
+ ipconfig.bootproto = confParams.get('BOOTPROTO', None)
if defaultRoute is None:
- defaultRoute = confParams.get('DEFROUTE', None)
+ ipconfig.inet.defaultRoute = confParams.get('DEFROUTE', None)
if not iface.mtu:
mtu = confParams.get('MTU', None)
if mtu:
mtu = int(mtu)
- return ipaddr, netmask, gateway, bootproto, mtu, defaultRoute
+ return iface.ip
def removeNic(self, nic):
cf = netinfo.NET_CONF_PREF + nic
--
To view, visit http://gerrit.ovirt.org/18331
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iae5ec15048ed52170371dda1d0fa9b90d51838e3
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Šebek <psebek(a)redhat.com>
10 years, 8 months
Change in vdsm[master]: packaging: spec: own /etc/pki/vdsm/libvirt-spice
by Alon Bar-Lev
Alon Bar-Lev has uploaded a new change for review.
Change subject: packaging: spec: own /etc/pki/vdsm/libvirt-spice
......................................................................
packaging: spec: own /etc/pki/vdsm/libvirt-spice
Change-Id: If939a60a916c1cc8c529d91e4bc379032048d42e
Signed-off-by: Alon Bar-Lev <alonbl(a)redhat.com>
---
M vdsm.spec.in
1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/18/19318/1
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 4d89517..48c0f54 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -1009,6 +1009,7 @@
%dir %{_sysconfdir}/pki/%{vdsm_name}
%dir %{_sysconfdir}/pki/%{vdsm_name}/keys
%dir %{_sysconfdir}/pki/%{vdsm_name}/certs
+%dir %{_sysconfdir}/pki/%{vdsm_name}/libvirt-spice
%config(noreplace) %{_sysconfdir}/pki/%{vdsm_name}/keys/libvirt_password
%dir %{_localstatedir}/lib/%{vdsm_name}
%dir %{_localstatedir}/lib/%{vdsm_name}/netconfback
--
To view, visit http://gerrit.ovirt.org/19318
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If939a60a916c1cc8c529d91e4bc379032048d42e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Alon Bar-Lev <alonbl(a)redhat.com>
10 years, 8 months
Change in vdsm[master]: sp: update lease parameters on masterMigrate
by Federico Simoncelli
Federico Simoncelli has uploaded a new change for review.
Change subject: sp: update lease parameters on masterMigrate
......................................................................
sp: update lease parameters on masterMigrate
In this patch:
- update lease parameters on masterMigrate
- relax the default parameters
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=999343
Change-Id: I0e5935e8a7081c391702f63d450621650769bb92
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
---
M vdsm/storage/sd.py
M vdsm/storage/sp.py
2 files changed, 10 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/76/19176/1
diff --git a/vdsm/storage/sd.py b/vdsm/storage/sd.py
index 68cfda3..fb266d2 100644
--- a/vdsm/storage/sd.py
+++ b/vdsm/storage/sd.py
@@ -123,9 +123,9 @@
DEFAULT_LEASE_PARAMS = {DMDK_LOCK_POLICY: "ON",
DMDK_LEASE_RETRIES: 3,
- DMDK_LEASE_TIME_SEC: 30,
+ DMDK_LEASE_TIME_SEC: 60,
DMDK_LOCK_RENEWAL_INTERVAL_SEC: 5,
- DMDK_IO_OP_TIMEOUT_SEC: 1}
+ DMDK_IO_OP_TIMEOUT_SEC: 10}
MASTER_FS_DIR = 'master'
VMS_DIR = 'vms'
diff --git a/vdsm/storage/sp.py b/vdsm/storage/sp.py
index 38eda39..801784f 100644
--- a/vdsm/storage/sp.py
+++ b/vdsm/storage/sp.py
@@ -847,6 +847,13 @@
newMD.changeLeaseParams(leaseParams)
@unsecured
+ def _copyLeaseParameters(srcDomain, dstDomain):
+ leaseParams = srcDomain.getLeaseParams()
+ self.log.info("Updating lease parameters for domain %s to %s",
+ srcDomain.sdUUID, leaseParams)
+ dstDomain.changeLeaseParams(leaseParams)
+
+ @unsecured
def masterMigrate(self, sdUUID, msdUUID, masterVersion):
self.log.info("sdUUID=%s spUUID=%s msdUUID=%s", sdUUID, self.spUUID,
msdUUID)
@@ -859,6 +866,7 @@
self._refreshDomainLinks(newmsd)
curmsd.invalidateMetadata()
self._convertDomain(newmsd, curmsd.getFormat())
+ self._copyLeaseParameters(curmsd, newmsd)
# new 'master' should be in 'active' status
domList = self.getDomains()
--
To view, visit http://gerrit.ovirt.org/19176
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0e5935e8a7081c391702f63d450621650769bb92
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
10 years, 8 months
Change in vdsm[master]: hsm: deleteImage fails because of wrong dictionary use
by ykaplan@redhat.com
Yeela Kaplan has uploaded a new change for review.
Change subject: hsm: deleteImage fails because of wrong dictionary use
......................................................................
hsm: deleteImage fails because of wrong dictionary use
Change-Id: I81f9a5aa63c0914e3b934046454df64ccd39c269
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=964649
Signed-off-by: Yeela Kaplan <ykaplan(a)redhat.com>
---
M vdsm/storage/hsm.py
M vdsm/storage/sd.py
2 files changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/83/17383/1
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 5da6ae6..4f95819 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -1537,7 +1537,7 @@
if needFake:
img = image.Image(os.path.join(self.storage_repository,
spUUID))
- tName = volsByImg.iterkeys()[0]
+ tName = volsByImg.keys()[0]
tParams = dom.produceVolume(imgUUID, tName).getVolumeParams()
img.createFakeTemplate(sdUUID=sdUUID, volParams=tParams)
self._spmSchedule(spUUID, "deleteImage_%s" % imgUUID, lambda: True)
diff --git a/vdsm/storage/sd.py b/vdsm/storage/sd.py
index 36c4877..38cf888 100644
--- a/vdsm/storage/sd.py
+++ b/vdsm/storage/sd.py
@@ -149,7 +149,7 @@
def getVolsOfImage(allVols, imgUUID):
""" Filter allVols dict for volumes related to imgUUID.
- Returns {volName: (([templateImge], imgUUID, [otherImg]), volPar)
+ Returns {volName: (([templateImage], imgUUID, [otherImg]), volPar)
For a template volume will be more than one image entry.
allVols: The getAllVols() return dict.
--
To view, visit http://gerrit.ovirt.org/17383
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I81f9a5aa63c0914e3b934046454df64ccd39c269
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <ykaplan(a)redhat.com>
10 years, 8 months
Change in vdsm[master]: hsm: fix updateVolumeSize for qcow2 volumes
by Federico Simoncelli
Federico Simoncelli has uploaded a new change for review.
Change subject: hsm: fix updateVolumeSize for qcow2 volumes
......................................................................
hsm: fix updateVolumeSize for qcow2 volumes
Change-Id: I08aa24277d11595e82c93b979c2c34fcf9d09c38
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
---
M vdsm/storage/hsm.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/79/19279/1
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 744a855..6210912 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -696,7 +696,7 @@
if volFormat != volume.COW_FORMAT:
# This method is used only with COW volumes (see docstring),
# for RAW volumes we just return the volume size.
- return dict(size=str(self.getVolumeSize(bs=1)))
+ return dict(size=str(volToExtend.getVolumeSize(bs=1)))
qemuImgFormat = volume.fmt2str(volume.COW_FORMAT)
--
To view, visit http://gerrit.ovirt.org/19279
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I08aa24277d11595e82c93b979c2c34fcf9d09c38
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
10 years, 8 months
Change in vdsm[master]: hsm: when creating fake template get template params before ...
by ykaplan@redhat.com
Yeela Kaplan has uploaded a new change for review.
Change subject: hsm: when creating fake template get template params before deleting
......................................................................
hsm: when creating fake template get template params before deleting
Change-Id: I535f29f1f956afaf28f6f496a240aa75abf1ed70
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=964649
Signed-off-by: Yeela Kaplan <ykaplan(a)redhat.com>
---
M vdsm/storage/hsm.py
1 file changed, 3 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/86/19286/1
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 8660b9b..c8604dc 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -1539,6 +1539,9 @@
self._spmSchedule(spUUID, "zeroImage_%s" % imgUUID, dom.zeroImage,
sdUUID, imgUUID, volsByImg)
else:
+ if fakeTUUID:
+ tParams = dom.produceVolume(imgUUID, fakeTUUID).\
+ getVolumeParams()
dom.deleteImage(sdUUID, imgUUID, volsByImg)
# This is a hack to keep the interface consistent
# We currently have race conditions in delete image, to quickly fix
@@ -1550,8 +1553,6 @@
if fakeTUUID:
img = image.Image(os.path.join(self.storage_repository,
spUUID))
- tParams = dom.produceVolume(imgUUID, fakeTUUID).\
- getVolumeParams()
img.createFakeTemplate(sdUUID=sdUUID, volParams=tParams)
self._spmSchedule(spUUID, "deleteImage_%s" % imgUUID, lambda: True)
--
To view, visit http://gerrit.ovirt.org/19286
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I535f29f1f956afaf28f6f496a240aa75abf1ed70
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <ykaplan(a)redhat.com>
10 years, 8 months
Change in vdsm[ovirt-3.3]: imageSharing: return proper size in httpGetSize
by Federico Simoncelli
Hello Dan Kenigsberg,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/19284
to review the following change.
Change subject: imageSharing: return proper size in httpGetSize
......................................................................
imageSharing: return proper size in httpGetSize
When importing images from OpenStack Glance the Content-Length is 0
so we need to override the value with the content of the custom header
X-Image-Meta-Size.
Change-Id: Icbcc601767d7f5b044b9e0e32f35abccdfb5746b
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
Reviewed-on: http://gerrit.ovirt.org/19222
Reviewed-by: Dan Kenigsberg <danken(a)redhat.com>
---
M vdsm/storage/imageSharing.py
1 file changed, 10 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/84/19284/1
diff --git a/vdsm/storage/imageSharing.py b/vdsm/storage/imageSharing.py
index 5db0a4e..26f299a 100644
--- a/vdsm/storage/imageSharing.py
+++ b/vdsm/storage/imageSharing.py
@@ -29,11 +29,18 @@
headers = curlImgWrap.head(methodArgs.get('url'),
methodArgs.get("headers", {}))
+ size = None
+
if 'Content-Length' in headers:
size = int(headers['Content-Length'])
- elif 'X-Image-Meta-Size' in headers:
- size = int(headers['X-Image-Meta-Size'])
- else:
+
+ # OpenStack Glance returns Content-Length = 0 so we need to
+ # override the value with the content of the custom header
+ # X-Image-Meta-Size.
+ if 'X-Image-Meta-Size' in headers:
+ size = max(size, int(headers['X-Image-Meta-Size']))
+
+ if size is None:
raise RuntimeError("Unable to determine image size")
return size
--
To view, visit http://gerrit.ovirt.org/19284
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Icbcc601767d7f5b044b9e0e32f35abccdfb5746b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.3
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
10 years, 8 months
Change in vdsm[master]: Removing automatic restart of services in libvirt-reconfigure
by ybronhei@redhat.com
Yaniv Bronhaim has uploaded a new change for review.
Change subject: Removing automatic restart of services in libvirt-reconfigure
......................................................................
Removing automatic restart of services in libvirt-reconfigure
libvirt-reconfigure also restarted libvirtd as post reconfigure operation. The
restart is required but there is no reason and its not expected to perform it
automatically as part of the reconfigure operation.
Restart also required to supervdsmd service (as described in the
Bug-Url). Instead of restarting both, this patch prints message to user to
preform the restart manually.
For backward compatibility with systemd, this also update
systemd-vdsmd script to restart libvirtd and supervdsmd services in
previous versions.
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=999853
Change-Id: If3711da62d6c196978fb4f5e89f1bce4b7500470
Signed-off-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
---
M init/systemd/systemd-vdsmd.in
M lib/vdsm/tool/libvirt_configure.sh.in
2 files changed, 6 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/80/18780/1
diff --git a/init/systemd/systemd-vdsmd.in b/init/systemd/systemd-vdsmd.in
index cf20b84..1fcb67b 100644
--- a/init/systemd/systemd-vdsmd.in
+++ b/init/systemd/systemd-vdsmd.in
@@ -27,3 +27,5 @@
[ -n "$2" -a "$2" != "force" ] && usage_exit
"@BINDIR@/vdsm-tool" libvirt-configure ${2:+--force}
+"@BINDIR@/vdsm-tool" service-restart libvirtd
+"@BINDIR@/vdsm-tool" service-restart supervdsmd
diff --git a/lib/vdsm/tool/libvirt_configure.sh.in b/lib/vdsm/tool/libvirt_configure.sh.in
index 3a4f4fa..5103b5b 100755
--- a/lib/vdsm/tool/libvirt_configure.sh.in
+++ b/lib/vdsm/tool/libvirt_configure.sh.in
@@ -282,7 +282,10 @@
ovirt_store_config "${lconf}" "${qconf}" "${ldconf}" "${llogr}"
fi
- /usr/bin/vdsm-tool service-restart libvirtd
+ echo "Reconfigure libvirt is done."
+ echo "To start using new configuration please restart libvirtd and supervdsmd services:"
+ echo "['vdsm-tool service-restart libvirtd']"
+ echo "['vdsm-tool service-restart supervdsmd']"
#
# finished reconfiguration, do not trigger
--
To view, visit http://gerrit.ovirt.org/18780
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If3711da62d6c196978fb4f5e89f1bce4b7500470
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>
10 years, 8 months