Commit 0c5f1b13 authored by Thomas Thrainer's avatar Thomas Thrainer
Browse files

Merge branch 'stable-2.9' into master



* stable-2.9
  Fix bridging in net-common
  Sync build_chroot with buildbot slack role
  Auto-upgrade of disks' config wrt LD-renaming
  Fix tests regarding DISK_LD_DEFAULTS
  Fixing renaming of DISK_LD_DEFAULTS
  Replace LD_* constants with DT_* constants
  QA: fix file storage QA wrt ipolicy
  Bump versions to release 2.9~beta1
  Add design-2.9 to docinput
  NEWS update and version bump for 2.8 rc2
  Lint improvements to regexps
  Add unit test for GetLinuxNodeInfo
  Prepare GetLinuxNodeInfo for testing
  Check right disk template in inst set params
  Make the DRBD collector more failure-resilient
  Add function to unwrap Results logging failures
  Fix bug in NodeD and RapiD usage strings

* stable-2.8
  Make tools/users-setup explain its actions first
  Generate tools/users-setup from descriptions
  Provide ganeti user and group data in easy-to-parse form
  Remove dsahostkeypub during config downgrade
  Mark the DSA host pubkey as optional
  Fix documentation for gnt-node evacuate -p option

Conflicts:
	Makefile.am (trivial)
	devel/build_chroot (took changes from 2.9 but newer regex-pcre
                        version)
	lib/cmdlib/cluster.py (followed LD_* -> DT_* change)
	lib/objects.py (followed LD_* -> DT_* change)
	test/py/ganeti.cmdlib_unittest.py (followed LD_* -> DT_* change)

The LD_* -> DT_* change required some more changes in the cmdlib unit
tests.
Signed-off-by: default avatarThomas Thrainer <thomasth@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
parents 191e5c19 b2e7599d
......@@ -62,6 +62,9 @@
/doc/hs-lint.html
/doc/manpages-enabled.rst
/doc/man-*.rst
/doc/users/groupmemberships
/doc/users/groups
/doc/users/users
# doc/examples
/doc/examples/bash_completion
......
......@@ -132,6 +132,7 @@ DIRS = \
doc/examples \
doc/examples/gnt-debug \
doc/examples/hooks \
doc/users \
test/data/htools \
test/data/htools/rapi \
test/hs/shelltests \
......@@ -224,6 +225,7 @@ CLEANFILES = \
$(BUILT_EXAMPLES) \
doc/examples/bash_completion \
doc/examples/bash_completion-debug \
$(userspecs) \
lib/_generated_rpc.py \
$(man_MANS) \
$(manhtml) \
......@@ -465,6 +467,7 @@ docinput = \
doc/design-2.6.rst \
doc/design-2.7.rst \
doc/design-2.8.rst \
doc/design-2.9.rst \
doc/design-autorepair.rst \
doc/design-bulk-create.rst \
doc/design-chained-jobs.rst \
......@@ -827,12 +830,21 @@ else
exit 1;
endif
doc/users/%: doc/users/%.in Makefile $(REPLACE_VARS_SED)
cat $< | sed -f $(REPLACE_VARS_SED) | LC_ALL=C sort | uniq | (grep -v '^root' || true) > $@
userspecs = \
doc/users/users \
doc/users/groups \
doc/users/groupmemberships
# Things to build but not to install (add it to EXTRA_DIST if it should be
# distributed)
noinst_DATA = \
$(BUILT_EXAMPLES) \
doc/examples/bash_completion \
doc/examples/bash_completion-debug \
$(userspecs) \
$(manhtml)
if HAS_SPHINX
......@@ -1077,7 +1089,6 @@ EXTRA_DIST = \
tools/kvm-ifup.in \
tools/vif-ganeti.in \
tools/net-common.in \
tools/users-setup.in \
tools/vcluster-setup.in \
$(docinput) \
doc/html \
......@@ -1088,6 +1099,9 @@ EXTRA_DIST = \
doc/examples/gnt-debug/README \
doc/examples/gnt-debug/delay0.json \
doc/examples/gnt-debug/delay50.json \
doc/users/groupmemberships.in \
doc/users/groups.in \
doc/users/users.in \
$(dist_TESTS) \
$(TEST_FILES) \
$(python_test_support) \
......@@ -1282,6 +1296,8 @@ TEST_FILES = \
test/data/proc_drbd83_sync_krnl2.6.39.txt \
test/data/proc_drbd84.txt \
test/data/proc_drbd84_sync.txt \
test/data/proc_meminfo.txt \
test/data/proc_cpuinfo.txt \
test/data/qa-minimal-nodes-instances-only.json \
test/data/sys_drbd_usermode_helper.txt \
test/data/vgreduce-removemissing-2.02.02.txt \
......@@ -1541,8 +1557,26 @@ tools/net-common: tools/net-common.in $(REPLACE_VARS_SED)
sed -f $(REPLACE_VARS_SED) < $< > $@
chmod +x $@
tools/users-setup: tools/users-setup.in $(REPLACE_VARS_SED)
sed -f $(REPLACE_VARS_SED) < $< > $@
tools/users-setup: Makefile $(userspecs)
set -e; \
{ echo '#!/bin/sh'; \
echo 'if [ "x$$1" != "x--yes-do-it" ];'; \
echo 'then echo "This will do the following changes"'; \
$(AWK) -- '{print "echo + Will add group ",$$1; count++}\
END {if (count == 0) {print "echo + No groups to add"}}' doc/users/groups; \
$(AWK) -- '{if (NF > 1) {print "echo + Will add user",$$1,"with primary group",$$2} \
else {print "echo + Will add user",$$1}; count++}\
END {if (count == 0) {print "echo + No users to add"}}' doc/users/users; \
$(AWK) -- '{print "echo + Will add user",$$1,"to group",$$2}' doc/users/groupmemberships; \
echo 'echo'; \
echo 'echo "OK? (y/n)"'; \
echo 'read confirm'; \
echo 'if [ "x$$confirm" != "xy" ]; then exit 0; fi'; \
echo 'fi'; \
$(AWK) -- '{print "addgroup --system",$$1}' doc/users/groups; \
$(AWK) -- '{if (NF > 1) {print "adduser --system --ingroup",$$2,$$1} else {print "adduser --system",$$1}}' doc/users/users; \
$(AWK) -- '{print "adduser",$$1,$$2}' doc/users/groupmemberships; \
} > $@
chmod +x $@
tools/vcluster-setup: tools/vcluster-setup.in $(REPLACE_VARS_SED)
......
......@@ -5,7 +5,7 @@ News
Version 2.9.0 beta1
-------------------
*(unreleased)*
*(Released Thu, 29 Aug 2013)*
Incompatible/important changes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......@@ -67,10 +67,10 @@ Python
for the unit tests (and only used for testing).
Version 2.8.0 rc1
Version 2.8.0 rc2
-----------------
*(Released Fri, 2 Aug 2013)*
*(Released Tue, 27 Aug 2013)*
Incompatible/important changes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......@@ -136,6 +136,8 @@ New features
It's set to true by default.
- Instance failover now supports a ``--cleanup`` parameter for fixing previous
failures.
- Support 'viridian' parameter in Xen HVM
- Support DSA SSH keys in bootstrap
New dependencies
~~~~~~~~~~~~~~~~
......@@ -149,8 +151,23 @@ For Python:
- The minimum Python version needed to run Ganeti is now 2.6.
- ``yaml`` library (only for running the QA).
Since 2.8.0 beta1
~~~~~~~~~~~~~~~~~
Since 2.8.0 rc1
~~~~~~~~~~~~~~~
- Support 'viridian' parameter in Xen HVM (Issue 233)
- Include VCS version in ``gnt-cluster version``
- Support DSA SSH keys in bootstrap (Issue 338)
- Fix batch creation of instances
- Use FQDN to check master node status (Issue 551)
- Make the DRBD collector more failure-resilient
Version 2.8.0 rc1
-----------------
*(Released Fri, 2 Aug 2013)*
The first release candidate of the 2.8 series. Since 2.8.0 beta1:
- Fix upgrading/downgrading from 2.7
- Increase maximum RAPI message size
......
......@@ -8,7 +8,7 @@
: ${CHROOT_FINAL_HOOK:=/bin/true}
# Additional Variables taken from the environmen
# DATA_DIR
# CHROOT_EXTRA_DEBIAN_PACKAGES
# CHROOT_EXTRA_DEBIAN_PACKAGES
#Automatically generated variables
CHROOTNAME=$DIST_RELEASE-$ARCH
......@@ -119,83 +119,66 @@ echo "deb http://backports.debian.org/debian-backports" \
in_chroot -- \
apt-get update
#Install selected packages from backports
in_chroot -- \
$APT_INSTALL -t squeeze-backports \
git \
git-email \
vim
in_chroot -- \
$APT_INSTALL python-setuptools build-essential python-dev sudo automake \
fakeroot rsync locales less
echo "en_US.UTF-8 UTF-8" >> $CHDIR/etc/locale.gen
# do not install libghc6-network-dev, since it's too old, and just
# confuses the dependencies
in_chroot -- \
locale-gen
$APT_INSTALL \
autoconf automake \
ghc cabal-install \
libghc6-curl-dev \
libghc6-parallel-dev \
libghc6-text-dev \
libghc6-vector-dev \
libpcre3-dev \
hlint hscolour pandoc \
graphviz socat qemu-utils \
python-docutils \
python-simplejson \
python-pyparsing \
python-pyinotify \
python-pycurl \
python-ipaddr \
python-yaml \
python-paramiko
in_chroot -- \
$APT_INSTALL lvm2 ssh bridge-utils iproute iputils-arping \
ndisc6 python python-pyopenssl openssl \
python-pyparsing python-simplejson \
python-pyinotify python-pycurl python-yaml \
socat fping
$APT_INSTALL python-setuptools python-dev build-essential
in_chroot -- \
$APT_INSTALL python-paramiko qemu-utils
easy_install \
logilab-astng==0.20.1 \
logilab-common==0.50.3 \
mock==1.0.1 \
pylint==0.25.1
in_chroot -- \
easy_install affinity bitarray ipaddr mock==1.0.1
#Haskell packages
in_chroot -- \
$APT_INSTALL ghc6 \
libghc6-parallel-dev libghc6-deepseq-dev \
libghc6-curl-dev
in_chroot -- \
$APT_INSTALL cabal-install
easy_install \
sphinx==1.1.3 \
pep8==1.2 \
coverage==3.4 \
bitarray==0.8.0
in_chroot -- \
cabal update
in_chroot -- \
$APT_INSTALL libpcre3-dev
in_chroot -- \
cabal install --global \
network==2.3 \
regex-pcre==0.94.4 \
hinotify==0.3.2 \
hslogger==1.1.4 \
attoparsec==0.10.1.1\
quickcheck==2.5.1.1 \
attoparsec==0.10.1.1 \
crypto==4.2.4 \
monadcatchio-transformers==0.2.2.0 \
MonadCatchIO-transformers==0.2.2.0 \
mtl==2.0.1.0 \
hashable==1.1.2.0 \
case-insensitive==0.3 \
parsec==3.0.1 \
snap-server==0.8.1 \
text==0.11.3.0 \
vector==0.9.1 \
json==0.4.4 \
process==1.0.1.2
json==0.4.4
#Python development tools
in_chroot -- \
$APT_INSTALL pandoc python-epydoc graphviz
in_chroot -- \
easy_install sphinx==1.1.3 \
logilab-common \
logilab-astng==0.23.1 \
pylint==0.25.1 \
pep8==1.2 \
coverage
#Haskell development tools
in_chroot -- \
cabal install --global \
hunit==1.2.5.2 \
......@@ -207,12 +190,46 @@ in_chroot -- \
test-framework-hunit==0.2.7 \
test-framework-quickcheck2==0.2.12.3
in_chroot -- \
cabal install --global cabal-file-th
in_chroot -- \
cabal install --global shelltestrunner
#Install selected packages from backports
in_chroot -- \
$APT_INSTALL -t squeeze-backports \
git \
git-email \
vim
in_chroot -- \
$APT_INSTALL sudo fakeroot rsync locales less
echo "en_US.UTF-8 UTF-8" >> $CHDIR/etc/locale.gen
in_chroot -- \
locale-gen
in_chroot -- \
$APT_INSTALL lvm2 ssh bridge-utils iproute iputils-arping \
ndisc6 python python-pyopenssl openssl \
python-mock \
socat fping
in_chroot -- \
$APT_INSTALL qemu-utils
in_chroot -- \
easy_install affinity
#Python development tools
in_chroot -- \
$APT_INSTALL pandoc python-epydoc
#Tools for creating debian packages
in_chroot -- \
$APT_INSTALL python-docutils debhelper quilt
$APT_INSTALL debhelper quilt
# extra debian packages
......
......@@ -895,7 +895,7 @@ Beside the per-hypervisor attributes, we also have disk attributes,
which are queried directly on the node (without hypervisor
involvment). The are stored in a separate attribute (``disk_state``),
which is indexed per storage type and name; currently this will be just
``LD_LV`` and the volume name as key.
``DT_PLAIN`` and the volume name as key.
+-------------+-------------------------+--------------------+--------+
|Name |Description |Current state |Type |
......
@GNTMASTERUSER@ @GNTDAEMONSGROUP@
@GNTCONFDUSER@ @GNTDAEMONSGROUP@
@GNTLUXIDUSER@ @GNTDAEMONSGROUP@
@GNTRAPIUSER@ @GNTDAEMONSGROUP@
@GNTMONDUSER@ @GNTDAEMONSGROUP@
@GNTMASTERUSER@ @GNTADMINGROUP@
@GNTRAPIUSER@ @GNTADMINGROUP@
@GNTMASTERUSER@ @GNTCONFDGROUP@
@GNTMONDUSER@ @GNTMASTERDGROUP@
@GNTLUXIDUSER@ @GNTMASTERDGROUP@
@GNTLUXIDUSER@ @GNTCONFDGROUP@
@GNTDAEMONSGROUP@
@GNTADMINGROUP@
@GNTMASTERUSER@
@GNTRAPIUSER@
@GNTCONFDUSER@
@GNTLUXIDUSER@
@GNTMONDUSER@
@GNTMASTERUSER@ @GNTMASTERDGROUP@
@GNTRAPIUSER@ @GNTRAPIGROUP@
@GNTCONFDUSER@ @GNTCONFDGROUP@
@GNTLUXIDUSER@ @GNTLUXIDGROUP@
@GNTMONDUSER@ @GNTMONDGROUP@
@GNTNODEDUSER@
......@@ -88,7 +88,7 @@ _IES_PID_FILE = "pid"
_IES_CA_FILE = "ca"
#: Valid LVS output line regex
_LVSLINE_REGEX = re.compile("^ *([^|]+)\|([^|]+)\|([0-9.]+)\|([^|]{6,})\|?$")
_LVSLINE_REGEX = re.compile(r"^ *([^|]+)\|([^|]+)\|([0-9.]+)\|([^|]{6,})\|?$")
# Actions for the master setup script
_MASTER_START = "start"
......@@ -2847,9 +2847,9 @@ def OSEnvironment(instance, inst_os, debug=0):
if constants.HV_DISK_TYPE in instance.hvparams:
result["DISK_%d_FRONTEND_TYPE" % idx] = \
instance.hvparams[constants.HV_DISK_TYPE]
if disk.dev_type in constants.LDS_BLOCK:
if disk.dev_type in constants.DTS_BLOCK:
result["DISK_%d_BACKEND_TYPE" % idx] = "block"
elif disk.dev_type == constants.LD_FILE:
elif disk.dev_type in [constants.DT_FILE, constants.DT_SHARED_FILE]:
result["DISK_%d_BACKEND_TYPE" % idx] = \
"file:%s" % disk.physical_id[0]
......@@ -2971,12 +2971,12 @@ def BlockdevSnapshot(disk):
@return: snapshot disk ID as (vg, lv)
"""
if disk.dev_type == constants.LD_DRBD8:
if disk.dev_type == constants.DT_DRBD8:
if not disk.children:
_Fail("DRBD device '%s' without backing storage cannot be snapshotted",
disk.unique_id)
return BlockdevSnapshot(disk.children[0])
elif disk.dev_type == constants.LD_LV:
elif disk.dev_type == constants.DT_PLAIN:
r_dev = _RecursiveFindBD(disk)
if r_dev is not None:
# FIXME: choose a saner value for the snapshot size
......
......@@ -919,7 +919,7 @@ def _FormatDiskDetails(dev_type, dev, roman):
"""Formats the logical_id of a disk.
"""
if dev_type == constants.LD_DRBD8:
if dev_type == constants.DT_DRBD8:
drbd_info = dev["drbd_info"]
data = [
("nodeA", "%s, minor=%s" %
......@@ -933,7 +933,7 @@ def _FormatDiskDetails(dev_type, dev, roman):
("port", str(compat.TryToRoman(drbd_info["port"], convert=roman))),
("auth key", str(drbd_info["secret"])),
]
elif dev_type == constants.LD_LV:
elif dev_type == constants.DT_PLAIN:
vg_name, lv_name = dev["logical_id"]
data = ["%s/%s" % (vg_name, lv_name)]
else:
......@@ -968,7 +968,7 @@ def _FormatBlockDevInfo(idx, top_level, dev, roman):
"""Format one line for physical device status.
@type dtype: str
@param dtype: a constant from the L{constants.LDS_BLOCK} set
@param dtype: a constant from the L{constants.DTS_BLOCK} set
@type status: tuple
@param status: a tuple as returned from L{backend.FindBlockDevice}
@return: the string representing the status
......@@ -989,7 +989,7 @@ def _FormatBlockDevInfo(idx, top_level, dev, roman):
minor_string = str(compat.TryToRoman(minor, convert=roman))
txt += ("%s (%s:%s)" % (path, major_string, minor_string))
if dtype in (constants.LD_DRBD8, ):
if dtype in (constants.DT_DRBD8, ):
if syncp is not None:
sync_text = "*RECOVERING* %5.2f%%," % syncp
if estt:
......@@ -1009,7 +1009,7 @@ def _FormatBlockDevInfo(idx, top_level, dev, roman):
else:
ldisk_text = ""
txt += (" %s, status %s%s" % (sync_text, degr_text, ldisk_text))
elif dtype == constants.LD_LV:
elif dtype == constants.DT_PLAIN:
if ldisk_status == constants.LDS_FAULTY:
ldisk_text = " *FAILED* (failed drive?)"
else:
......
......@@ -341,7 +341,7 @@ class LUBackupExport(LogicalUnit):
# instance disk type verification
# TODO: Implement export support for file-based disks
for disk in self.instance.disks:
if disk.dev_type == constants.LD_FILE:
if disk.dev_type in [constants.DT_FILE, constants.DT_SHARED_FILE]:
raise errors.OpPrereqError("Export not supported for instances with"
" file-based disks", errors.ECODE_INVAL)
......
......@@ -495,7 +495,7 @@ class LUClusterRepairDiskSizes(NoHooksLU):
@param disk: an L{ganeti.objects.Disk} object
"""
if disk.dev_type == constants.LD_DRBD8:
if disk.dev_type == constants.DT_DRBD8:
assert disk.children, "Empty children for DRBD8?"
fchild = disk.children[0]
mismatch = fchild.size < disk.size
......@@ -757,7 +757,7 @@ class LUClusterSetParams(LogicalUnit):
" enabling lvm-based disk-templates.")
if self.op.vg_name is not None and not self.op.vg_name:
if self.cfg.HasAnyDiskOfType(constants.LD_LV):
if self.cfg.HasAnyDiskOfType(constants.DT_PLAIN):
raise errors.OpPrereqError("Cannot disable lvm storage while lvm-based"
" instances exist", errors.ECODE_INVAL)
......@@ -895,7 +895,7 @@ class LUClusterSetParams(LogicalUnit):
if drbd_enabled:
raise errors.OpPrereqError("Cannot disable drbd helper while"
" DRBD is enabled.")
if self.cfg.HasAnyDiskOfType(constants.LD_DRBD8):
if self.cfg.HasAnyDiskOfType(constants.DT_DRBD8):
raise errors.OpPrereqError("Cannot disable drbd helper while"
" drbd-based instances exist",
errors.ECODE_INVAL)
......
......@@ -1734,7 +1734,8 @@ class LUInstanceMove(LogicalUnit):
bep = self.cfg.GetClusterInfo().FillBE(self.instance)
for idx, dsk in enumerate(self.instance.disks):
if dsk.dev_type not in (constants.LD_LV, constants.LD_FILE):
if dsk.dev_type not in (constants.DT_PLAIN, constants.DT_FILE,
constants.DT_SHARED_FILE):
raise errors.OpPrereqError("Instance disk %d has a complex layout,"
" cannot copy" % idx, errors.ECODE_STATE)
......@@ -2633,9 +2634,9 @@ class LUInstanceSetParams(LogicalUnit):
self.instance.disk_template,
errors.ECODE_INVAL)
if not self.cluster.IsDiskTemplateEnabled(self.instance.disk_template):
if not self.cluster.IsDiskTemplateEnabled(self.op.disk_template):
raise errors.OpPrereqError("Disk template '%s' is not enabled for this"
" cluster." % self.instance.disk_template)
" cluster." % self.op.disk_template)
if (self.instance.disk_template,
self.op.disk_template) not in self._DISK_CONVERSIONS:
......
......@@ -55,16 +55,6 @@ _DISK_TEMPLATE_NAME_PREFIX = {
}
_DISK_TEMPLATE_DEVICE_TYPE = {
constants.DT_PLAIN: constants.LD_LV,
constants.DT_FILE: constants.LD_FILE,
constants.DT_SHARED_FILE: constants.LD_FILE,
constants.DT_BLOCK: constants.LD_BLOCKDEV,
constants.DT_RBD: constants.LD_RBD,
constants.DT_EXT: constants.LD_EXT,
}
def CreateSingleBlockDev(lu, node_uuid, instance, device, info, force_open,
excl_stor):
"""Create a single block device on a given node.
......@@ -390,16 +380,16 @@ def _GenerateDRBD8Branch(lu, primary_uuid, secondary_uuid, size, vgnames, names,
port = lu.cfg.AllocatePort()
shared_secret = lu.cfg.GenerateDRBDSecret(lu.proc.GetECId())
dev_data = objects.Disk(dev_type=constants.LD_LV, size=size,
dev_data = objects.Disk(dev_type=constants.DT_PLAIN, size=size,
logical_id=(vgnames[0], names[0]),
params={})
dev_data.uuid = lu.cfg.GenerateUniqueID(lu.proc.GetECId())
dev_meta = objects.Disk(dev_type=constants.LD_LV,
dev_meta = objects.Disk(dev_type=constants.DT_PLAIN,
size=constants.DRBD_META_SIZE,
logical_id=(vgnames[1], names[1]),
params={})
dev_meta.uuid = lu.cfg.GenerateUniqueID(lu.proc.GetECId())
drbd_dev = objects.Disk(dev_type=constants.LD_DRBD8, size=size,
drbd_dev = objects.Disk(dev_type=constants.DT_DRBD8, size=size,
logical_id=(primary_uuid, secondary_uuid, port,
p_minor, s_minor,
shared_secret),
......@@ -493,7 +483,7 @@ def GenerateDiskTemplate(
else:
raise errors.ProgrammerError("Unknown disk template '%s'" % template_name)
dev_type = _DISK_TEMPLATE_DEVICE_TYPE[template_name]
dev_type = template_name
for idx, disk in enumerate(disk_info):
params = {}
......@@ -819,7 +809,7 @@ class LUInstanceRecreateDisks(LogicalUnit):
continue
# update secondaries for disks, if needed
if self.op.node_uuids and disk.dev_type == constants.LD_DRBD8:
if self.op.node_uuids and disk.dev_type == constants.DT_DRBD8:
# need to update the nodes and minors
assert len(self.op.node_uuids) == 2
assert len(disk.logical_id) == 6 # otherwise disk internals
......@@ -840,7 +830,7 @@ class LUInstanceRecreateDisks(LogicalUnit):
for idx, new_id, changes in mods:
disk = self.instance.disks[idx]
if new_id is not None:
assert disk.dev_type == constants.LD_DRBD8
assert disk.dev_type == constants.DT_DRBD8
disk.logical_id = new_id
if changes:
disk.Update(size=changes.get(constants.IDISK_SIZE, None),
......@@ -2261,11 +2251,11 @@ class TLReplaceDisks(Tasklet):
(data_disk, meta_disk) = dev.children
vg_data = data_disk.logical_id[0]
lv_data = objects.Disk(dev_type=constants.LD_LV, size=dev.size,
lv_data = objects.Disk(dev_type=constants.DT_PLAIN, size=dev.size,
logical_id=(vg_data, names[0]),
params=data_disk.params)
vg_meta = meta_disk.logical_id[0]
lv_meta = objects.Disk(dev_type=constants.LD_LV,
lv_meta = objects.Disk(dev_type=constants.DT_PLAIN,
size=constants.DRBD_META_SIZE,
logical_id=(vg_meta, names[1]),
params=meta_disk.params)
......@@ -2541,7 +2531,7 @@ class TLReplaceDisks(Tasklet):
iv_names[idx] = (dev, dev.children, new_net_id)
logging.debug("Allocated new_minor: %s, new_logical_id: %s", new_minor,
new_net_id)
new_drbd = objects.Disk(dev_type=constants.LD_DRBD8,
new_drbd = objects.Disk(dev_type=constants.DT_DRBD8,
logical_id=new_alone_id,
children=dev.children,
size=dev.size,
......
......@@ -891,7 +891,7 @@ class ConfigWriter(object):
if disk.logical_id is None and disk.physical_id is not None:
return
if disk.dev_type == constants.LD_DRBD8:
if disk.dev_type == constants.DT_DRBD8:
pnode, snode, port, pminor, sminor, secret = disk.logical_id
if node_uuid not in (pnode, snode):
raise errors.ConfigurationError("DRBD device not knowing node %s" %
......@@ -981,7 +981,7 @@ class ConfigWriter(object):
"""
def _AppendUsedMinors(get_node_name_fn, instance, disk, used):
duplicates = []
if disk.dev_type == constants.LD_DRBD8 and len(disk.logical_id) >= 5:
if disk.dev_type == constants.DT_DRBD8 and len(disk.logical_id) >= 5:
node_a, node_b, _, minor_a, minor_b = disk.logical_id[:5]
for node_uuid, minor in ((node_a, minor_a), (node_b, minor_b)):
assert node_uuid in used, \
......@@ -1580,7 +1580,7 @@ class ConfigWriter(object):
inst.name = new_name
for (idx, disk) in enumerate(inst.disks):
if disk.dev_type == constants.LD_FILE:
if disk.dev_type in [constants.DT_FILE, constants.DT_SHARED_FILE]:
# rename the file paths in logical and physical id
file_storage_dir = os.path.dirname(os.path.dirname(disk.logical_id[1]))
disk.logical_id = (disk.logical_id[0],
......