Commit 79707d0e authored by Dimitris Aragiorgis's avatar Dimitris Aragiorgis
Browse files

deploy/ci: Setup lvm in case extra disk exists

Ganeti needs a VG in order to support plain/drbd disk templates.
In case an extra disk exists, deploy will create a PV and a VG
on this disk.

Use options `extra_disk` in nodes.conf and `vg` in ganeti.conf for
this purpose.

VMs spawned currently during ci do not have extra disks. Update the
corresponding schema.
Signed-off-by: default avatarDimitris Aragiorgis <>
parent de81d118
......@@ -44,4 +44,5 @@ vm_private_iface = eth2
# extra disk name inside the nodes
# if defined, snf-deploy will create a VG for ganeti in order to support lvm storage
# if not then only file disk template will be supported
extra_disk = /dev/vdb
# ci vms do not have extra disk
extra_disk =
......@@ -339,10 +339,16 @@ class Ganeti(SynnefoComponent):
def prepare_lvm(self):
return [
"pvcreate %s" % self.env.env.extra_disk,
"vgcreate %s %s" % (self.env.env.extra_disk,
ret = []
disk = self.env.env.extra_disk
vg =
if disk:
ret = [
"test -e %s" % disk,
"pvcreate %s" % disk,
"vgcreate %s %s" % (vg, disk)
return ret
def prepare_net_infra(self):
br = self.env.env.common_bridge
......@@ -354,7 +360,7 @@ class Ganeti(SynnefoComponent):
return [
"mkdir -p /srv/ganeti/file-storage/",
"sed -i 's/^127.*$/ localhost/g' /etc/hosts"
] + self.prepare_net_infra()
] + self.prepare_net_infra() + self.prepare_lvm()
def restart(self):
return ["/etc/init.d/ganeti restart"]
......@@ -275,7 +275,6 @@ def setup_ganeti_role():
execute(update_exports_for_node, node_info)
execute(add_ganeti_node, node_info)
#FIXME: prepare_lvm ????
@roles("ganeti", "master")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment