Commit e330e80a authored by Dimitris Aragiorgis's avatar Dimitris Aragiorgis

deploy: Add new component GanetiDev

This is used to create a development environment for Ganeti.
It clones the official repo, installs all packages needed,
and adds a qa-sample.json file that reflects to the
Ganeti cluster found in the configuration.
Signed-off-by: default avatarDimitris Aragiorgis <dimara@grnet.gr>
parent 9093eb07
......@@ -6,7 +6,7 @@ cluster_netdev = eth0
cluster_name = ganeti1
cluster_ip = 192.168.0.13
vg = autovg
vg = ganeti
synnefo_public_network_subnet = 10.2.1.0/24
synnefo_public_network_gateway = 10.2.1.1
......
{
"# Note:": null,
"# This file is stored in the JSON format and does not support": null,
"# comments. As a work-around, comments are keys starting with a hash": null,
"# sign (#).": null,
"name": "%CLUSTER_NAME%",
"# Name used for renaming cluster": null,
"rename": "ganeti1-rename",
"# Virtual cluster": null,
"#vcluster-master": "xen-vcluster",
"#vcluster-basedir": "/srv/ganeti/vcluster",
"enabled-hypervisors": "kvm",
"# Dict of hypervisor name and parameters (like on the cmd line)": null,
"hypervisor-parameters": {"kvm": "kernel_path=,vnc_bind_address=0.0.0.0", "xen-pvm": "kernel_path=/boot/vmlinuz-3.2.0-4-amd64", "xen-hvm": "kernel_path=/boot/vmlinuz-3.2.0-4-amd64"},
"# Backend parameters (like on the cmd line)": null,
"backend-parameters": "",
"# Dict of OS name and parameters (like on the cmd line)": null,
"os-parameters": {},
"# Dict of OS name and value dict of hypervisor parameters": null,
"os-hvp": {},
"primary_ip_version": 4,
"# Name of the LVM group for the cluster": null,
"vg-name": "%VG%",
"# Cluster-level value of the exclusive-storage flag": null,
"exclusive-storage": null,
"# Only enable disk templates that the QA machines can actually use.": null,
"enabled-disk-templates": [
"plain",
"drbd",
"diskless"
],
"# Additional arguments for initializing cluster": null,
"cluster-init-args": [],
"# Network interface for master role": null,
"master-netdev": "%CLUSTER_NETDEV",
"# Default network interface parameters": null,
"default-nicparams": {
"mode": "bridged",
"link": "br0"
},
"os": "debootstrap+default",
"maxmem": "1024M",
"minmem": "512M",
"# Instance policy specs": null,
"#ispec_cpu_count_max": null,
"#ispec_cpu_count_min": null,
"#ispec_cpu_count_std": null,
"#ispec_disk_count_max": null,
"#ispec_disk_count_min": null,
"#ispec_disk_count_std": null,
"#ispec_disk_size_max": null,
"ispec_disk_size_min": 512,
"#ispec_disk_size_std": null,
"ispec_mem_size_max": 1024,
"#ispec_mem_size_min": null,
"#ispec_mem_size_std": null,
"#ispec_nic_count_max": null,
"#ispec_nic_count_min": null,
"#ispec_nic_count_std": null,
"# Lists of disks": null,
"disks": [
{
"size": "1G",
"name": "disk0",
"growth": "2G"
},
{
"size": "512M",
"name": "disk1",
"growth": "768M"
}
],
"# Script to check instance status": null,
"instance-check": null,
"# Regular expression to ignore existing tags": null,
"ignore-tags-re": null,
%NODES",
"instances": [
{
"name": "xen-test-inst1.vm.%DOMAIN%",
"# Static MAC address": null,
"#nic.mac/0": "AA:00:00:11:11:11"
},
{
"name": "xen-test-inst2.vm.%DOMAIN%",
"# Static MAC address": null,
"#nic.mac/0": "AA:00:00:22:22:22"
},
{
"name": "xen-test-inst3.vm.%DOMAIN%",
"# Static MAC address": null,
"#nic.mac/0": "AA:00:00:22:22:22"
}
],
"groups": {
"group-with-nodes": "default",
"inexistent-groups": [
"group1",
"group2",
"group3"
]
},
"networks": {
"inexistent-networks": [
"network1",
"network2",
"network3"
]
},
"tests": {
"# Whether tests are enabled or disabled by default": null,
"default": true,
"env": true,
"os": true,
"tags": true,
"rapi": true,
"test-jobqueue": true,
"delay": true,
"create-cluster": false,
"cluster-verify": true,
"cluster-info": true,
"cluster-burnin": true,
"cluster-command": true,
"cluster-copyfile": true,
"cluster-master-failover": true,
"cluster-renew-crypto": true,
"cluster-destroy": true,
"cluster-rename": false,
"cluster-reserved-lvs": true,
"cluster-modify": true,
"cluster-oob": true,
"cluster-epo": true,
"cluster-redist-conf": true,
"cluster-repair-disk-sizes": true,
"cluster-exclusive-storage": true,
"cluster-instance-policy": true,
"haskell-confd": true,
"htools": true,
"group-list": true,
"group-rwops": true,
"network": false,
"node-list": true,
"node-info": true,
"node-volumes": true,
"node-readd": true,
"node-storage": true,
"node-modify": true,
"node-oob": true,
"# This test needs at least three nodes": null,
"node-evacuate": false,
"# This test needs at least two nodes": null,
"node-failover": false,
"instance-add-plain-disk": true,
"instance-add-file": true,
"instance-add-drbd-disk": true,
"instance-add-diskless": true,
"instance-add-restricted-by-disktemplates": true,
"instance-convert-disk": true,
"instance-plain-rapi-common-tests": true,
"instance-remove-drbd-offline": true,
"instance-export": true,
"instance-failover": true,
"instance-grow-disk": true,
"instance-import": true,
"instance-info": true,
"instance-list": true,
"instance-migrate": true,
"instance-modify": true,
"instance-modify-primary": true,
"instance-modify-disks": false,
"instance-reboot": true,
"instance-reinstall": true,
"instance-rename": false,
"instance-shutdown": true,
"instance-device-names": true,
"job-list": true,
"# cron/ganeti-watcher should be disabled for these tests": null,
"instance-automatic-restart": false,
"instance-consecutive-failures": false,
"# This test might fail with certain hypervisor types, depending": null,
"# on whether they support the `gnt-instance console' command.": null,
"instance-console": false,
"# Disabled by default because they take rather long": null,
"instance-replace-disks": false,
"instance-recreate-disks": false,
"# Whether to test the tools/move-instance utility": null,
"inter-cluster-instance-move": false,
"# Run instance tests with different cluster configurations": null,
"default-instance-tests": true,
"exclusive-storage-instance-tests": false
},
"options": {
"burnin-instances": 2,
"burnin-disk-template": "drbd",
"burnin-in-parallel": false,
"burnin-check-instances": false,
"burnin-rename": "ganeti1-rename",
"burnin-reboot": true,
"reboot-types": ["soft", "hard", "full"],
"use-iallocators": false
},
"# vim: set syntax=javascript :": null
}
......@@ -14,6 +14,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import datetime
import ast
import simplejson
from snfdeploy.utils import debug
from snfdeploy.lib import Host
......@@ -1155,6 +1157,7 @@ class GanetiCollectd(SynnefoComponent):
]
class Archip(SynnefoComponent):
REQUIRED_PACKAGES = [
"librados2",
......@@ -1206,3 +1209,133 @@ class ExtStorage(SynnefoComponent):
return [
"git clone %s %s" % (url, extdir)
]
class GanetiDev(SynnefoComponent):
REQUIRED_PACKAGES = [
"automake",
"bridge-utils",
"cabal-install",
"fakeroot",
"fping",
"ghc",
"ghc-haddock",
"git",
"graphviz",
"hlint",
"hscolour",
"iproute",
"iputils-arping",
"libcurl4-openssl-dev",
"libghc-attoparsec-dev",
"libghc-crypto-dev",
"libghc-curl-dev",
"libghc-haddock-dev",
"libghc-hinotify-dev",
"libghc-hslogger-dev",
"libghc-hunit-dev",
"libghc-json-dev",
"libghc-network-dev",
"libghc-parallel-dev",
"libghc-quickcheck2-dev",
"libghc-regex-pcre-dev",
"libghc-snap-server-dev",
"libghc-temporary-dev",
"libghc-test-framework-dev",
"libghc-test-framework-hunit-dev",
"libghc-test-framework-quickcheck2-dev",
"libghc-text-dev",
"libghc-utf8-string-dev",
"libghc-vector-dev",
"lvm2",
"make",
"ndisc6",
"openssl",
"pandoc",
"pep8",
"pylint",
"python",
"python-bitarray",
"python-coverage",
"python-epydoc",
"python-ipaddr",
"python-openssl",
"python-pip",
"python-pycurl",
"python-pyinotify",
"python-pyparsing",
"python-setuptools",
"python-simplejson",
"python-sphinx",
"python-yaml",
"qemu-kvm",
"socat",
"ssh",
"vim"
]
CABAL = [
"hinotify==0.3.2",
"base64-bytestring",
"lifted-base==0.2.0.3",
"lens==3.10",
]
def __init__(self, node_info, env, *args, **kwargs):
""" Take a node_info and env as argument and initialize local vars """
self.node_info = node_info
self.env = env
self.cluster = self.env.env.cluster
self.qa_nodes = [self.env.env.master]
for i, n in enumerate(self.env.env.cluster_nodes):
self.qa_nodes.append(self.env.env.get_node_info(n))
self.qa_nodes_list = []
for n in self.qa_nodes:
self.qa_nodes_list.append({
"primary": n.fqdn,
"secondary": n.ip,
})
def cabal(self):
ret = ["cabal update"]
for p in self.CABAL:
ret.append("cabal install %s" % p)
return ret
def prepare(self):
return self.cabal() + [
"git clone git://git.ganeti.org/ganeti.git"
]
def configure(self):
""" Must return a list of tuples (tmpl_path, replace_dict, mode) """
repl = {
"CLUSTER_NAME": self.env.env.cluster_name,
"VG": self.env.env.vg,
"CLUSTER_NETDEV": self.env.env.cluster_netdev,
"NODES": simplejson.dumps({"nodes": self.qa_nodes_list}),
"DOMAIN": self.env.env.domain
}
return [
("/root/qa-sample.json", repl, {}),
]
def initialize(self):
""" Returs a list of bash commands that initialize the component """
return [
"cd ganeti; ./autogen.sh",
"cd ganeti; ./configure --localstatedir=/var --sysconfdir=/etc",
]
def test(self):
""" Returs a list of bash commands that test existing installation """
ret = []
for n in self.qa_nodes:
ret.append("ssh %s date" % n.hostname)
ret.append("ssh %s date" % n.ip)
ret.append("ssh %s date" % n.fqdn)
return ret
def restart(self):
return []
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