Commit de81d118 authored by Dimitris Aragiorgis's avatar Dimitris Aragiorgis

deploy: Extract synnefo's components from ganeti

The components PithosBackend, Image, GTools, and GanetiCollectd
are related to Ganeti but used only by Synnefo.

Define new role, named 'snf-ganeti' to include those components and use
it with the `snf-deploy ganeti` command.

Install ganeti-instance-debootstrap so that we have a working os
provider.

snf-image takes a lot of time to be configured (curl,
snf-image-update-helper, wget debian-base image) and is not needed
for a simple Ganeti cluster (i.e. QA cluster).

Move wget of debian base image to Image component and not nfs.
In order not to download many times check if it already exists
in the proper path.
Signed-off-by: default avatarDimitris Aragiorgis <dimara@grnet.gr>
parent 33938c1b
......@@ -447,6 +447,7 @@ def get_actions(*args):
"backend": [
"setup_master_role",
"setup_ganeti_role",
"setup_snf_ganeti_role",
"add_ganeti_backend",
],
"ganeti": [
......@@ -466,6 +467,7 @@ def get_actions(*args):
"setup_cms_role",
"setup_master_role",
"setup_ganeti_role",
"setup_snf_ganeti_role",
"setup_stats_role",
"set_default_quota",
"add_ganeti_backend",
......
......@@ -323,6 +323,7 @@ class Ganeti(SynnefoComponent):
"bridge-utils",
"lvm2",
"drbd8-utils",
"ganeti-instance-debootstrap",
]
def check(self):
......@@ -417,6 +418,14 @@ class Image(SynnefoComponent):
def check(self):
return ["mkdir -p %s" % self.env.env.image_dir]
def prepare(self):
url = self.env.env.debian_base_url
d = self.env.env.image_dir
image = "debian_base.diskdump"
return [
"test -e %s/%s || wget %s -O %s/%s" % (d, image, url, d, image)
]
def configure(self):
tmpl = "/etc/default/snf-image"
replace = {
......@@ -793,12 +802,6 @@ class NFS(SynnefoComponent):
"nfs-kernel-server"
]
def prepare_image(self):
url = self.env.env.debian_base_url
d = self.env.env.image_dir
image = "debian_base.diskdump"
return ["wget %s -O %s/%s" % (url, d, image)]
def prepare(self):
p = self.env.env.pithos_dir
return [
......@@ -808,7 +811,7 @@ class NFS(SynnefoComponent):
"mkdir -p /srv/archip/maps",
"chown www-data.www-data %s/data" % p,
"chmod g+ws %s/data" % p,
] + self.prepare_image()
]
def update_exports(self, node_info):
cmd = """
......
......@@ -278,6 +278,14 @@ def setup_ganeti_role():
#FIXME: prepare_lvm ????
@roles("ganeti", "master")
def setup_snf_ganeti_role():
# needed in case of single node cluster
if not env.host:
return
SetupSynnefoRole("snf-ganeti")
@roles("master")
def setup_master_role():
node_info = get_node_info(env.host)
......
......@@ -37,13 +37,13 @@ ROLES = {
"client": [HW, SSH, DNS, APT, Kamaki, Burnin],
"ganeti": [
HW, SSH, DNS, DDNS, APT, Mount,
Ganeti, ExtStorage, PithosBackend, Archip, ArchipGaneti,
Image, Network, GTools, GanetiCollectd,
Ganeti, ExtStorage, Archip, ArchipGaneti, Network
],
"master": [
HW, SSH, DNS, DDNS, APT, Mount,
Ganeti, ExtStorage, Master, PithosBackend, Archip, ArchipGaneti,
Image, Network, GTools, GanetiCollectd,
HW, SSH, DNS, DDNS, APT, Mount, Ganeti, Master, Network,
],
"snf-ganeti": [
PithosBackend, Image, GTools, GanetiCollectd
],
}
......
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