Commit 9093eb07 authored by Dimitris Aragiorgis's avatar Dimitris Aragiorgis

deploy: Add ganeti-qa command

To install a minimal Ganeti cluster for QA run:

 snf-deploy ganeti-qa

This will create a ganeti cluster. The test instances will resolve on
the local nameserver. On the client node it clones the official repo
and installs all required packages required for ganeti development.
A sample qa json file is uploaded under /tmp.

To run the qa go to the client node and run:

 # cd ganeti
 # python ganeti-qa.py /tmp/qa-sample.json --yes-do-it

Note that the installed version in the qa cluster should be the same
used in the qa source.
Signed-off-by: default avatarDimitris Aragiorgis <dimara@grnet.gr>
parent 79707d0e
......@@ -427,7 +427,8 @@ def parse_options():
# available commands
parser.add_argument("command", type=str,
choices=["packages", "vcluster", "cleanup",
"run", "test", "all", "keygen", "ganeti"],
"run", "test", "all", "keygen",
"ganeti", "ganeti-qa"],
help="Run on of the supported deployment commands")
# available actions for the run command
......@@ -456,6 +457,10 @@ def get_actions(*args):
"setup_master_role",
"setup_ganeti_role",
],
"qa": [
"setup_ganeti",
"setup_qa",
],
"all": [
"setup_ns_role",
"setup_nfs_role",
......@@ -612,6 +617,10 @@ def main():
actions = get_actions("ganeti")
fabcommand(args, env, actions)
if args.command == "ganeti-qa":
actions = get_actions("qa")
fabcommand(args, env, actions)
if args.command == "all":
actions = get_actions("all")
fabcommand(args, env, actions)
......
......@@ -15,6 +15,7 @@
import datetime
from snfdeploy.utils import debug
from snfdeploy.lib import Host
class SynnefoComponent(object):
......@@ -61,6 +62,7 @@ class SynnefoComponent(object):
return []
class HW(SynnefoComponent):
def test(self):
return [
......@@ -192,6 +194,17 @@ EOF
self.update_ptrrecord(node_info)
]
def add_qa_instances(self):
instances = [
("xen-test-inst1", "1.2.3.4"),
("xen-test-inst2", "1.2.3.5"),
("xen-test-inst3", "1.2.3.6"),
("xen-test-inst4", "1.2.3.7"),
]
for name, ip in instances:
n = Host(name, ip, None, "vm." + self.env.env.domain, None, None)
self.update_ns_for_node(n)
def initialize(self):
a = [self.update_arecord(n)
for n in self.env.env.nodes_info.values()]
......@@ -367,6 +380,12 @@ class Ganeti(SynnefoComponent):
class Master(SynnefoComponent):
def add_qa_rapi_user(self):
cmd = """
echo ganeti-qa qa_example_passwd write >> /var/lib/ganeti/rapi/users
"""
return [cmd] + self.restart()
def add_rapi_user(self):
user = self.env.env.synnefo_user
passwd = self.env.env.synnefo_rapi_passwd
......@@ -406,6 +425,11 @@ EOF
--hypervisor-parameters kvm:kernel_path=,vnc_bind_address=0.0.0.0 \
--no-ssh-init --no-etc-hosts \
--enabled-disk-templates file,plain,ext,drbd \
--ipolicy-std-specs \
cpu-count=1,disk-count=1,disk-size=1024,memory-size=128,nic-count=1,spindle-use=1 \
--ipolicy-bounds-specs \
min:cpu-count=1,disk-count=1,disk-size=512,memory-size=128,nic-count=0,spindle-use=1/\
max:cpu-count=8,disk-count=16,disk-size=1048576,memory-size=32768,nic-count=8,spindle-use=12 \
{2}
""".format(self.env.env.common_bridge,
self.env.env.cluster_netdev, self.env.env.cluster.fqdn)
......
......@@ -304,6 +304,11 @@ def setup_client_role():
SetupSynnefoRole("client")
def setup_qa():
env.ns.execute("add_qa_instances")
env.master.execute("add_qa_rapi_user")
def setup():
node_info = get_node_info(env.target_node)
if not node_info:
......
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