Commit ea57ae2c authored by Vangelis Koukis's avatar Vangelis Koukis
Browse files

Make RAPI CreateInstance() arguments configurable

Make RAPI CreateInstance() arguments deployment-specific.
Add the GANETI_CREATEINSTANCE_KWARGS setting, which allows the administrator
to set arbitrary arguments to RAPI CreateInstance().

Also add initial version of README.Upgrade, detailing
upgrades of Synnefo deployments.

Fixes #835
parent 3ed29f02
README.Upgrade
===============
This file documents the upgrade to newer versions of the Synnefo software.
v0.5.1 -> v0.5.2
NEW SETTINGS
* 10-backend.py:GANETI_CREATEINSTANCE_KWARGS
REMOVE SETTINGS
* 10-backend.conf/GANETI_OS_PROVIDER
* 20-apo.conf/GANETI_DISK_TEMPLATE
BACKEND CHANGES
* Need to patch Ganeti, file:
lib/python2.6/site-packages/ganeti/rapi/rlib2.py
to honor the wait_for_sync flag, see Synnefo #835.
Patch provided under contrib/patches/ganeti-rlib2.py-v0.5.2
README.deploy -- Instructions for a basic deployment of Synnefo v0.5.1
README.deploy -- Instructions for a basic Synnefo deployment
This document describes the basic steps to obtain a basic, working Synnefo
deployment. It begins by examining the different node roles, then moves to the
installation and setup of distinct software components.
It is current as of Synnefo v0.5.1.
It is current as of Synnefo v0.5.2.
Node types
......@@ -418,7 +418,7 @@ Synnefo deployment.
Download and install gnt-instance-image in all Ganeti nodes from its own
repository, at https://code.grnet.gr/git/gnt-instance-image. It's
recommended to use the win-support branch (known good commit for 0.5.1:
recommended to use the win-support branch (known good commit for 0.5.2:
8afaedb329c981282aed1a6c3daf62e43532f00d).
After installing gnt-instance-image do the following:
......
--- rlib2.py 2011-07-17 20:45:56.000000000 +0300
+++ rlib2.py.20110717 2011-07-17 20:45:51.000000000 +0300
@@ -785,7 +785,7 @@
src_node=baserlib.CheckParameter(data, "src_node", default=None),
src_path=baserlib.CheckParameter(data, "src_path", default=None),
start=baserlib.CheckParameter(data, "start", default=True),
- wait_for_sync=baserlib.CheckParameter(data, "wait_for_sync", default=True),
+ wait_for_sync=True,
ip_check=baserlib.CheckParameter(data, "ip_check", default=True),
name_check=baserlib.CheckParameter(data, "name_check", default=True),
file_storage_dir=baserlib.CheckParameter(data, "file_storage_dir",
......@@ -183,26 +183,36 @@ def create_instance(vm, flavor, image, password):
else:
sz = flavor.disk * 1024
return rapi.CreateInstance(
mode='create',
name=vm.backend_id,
disk_template=settings.GANETI_DISK_TEMPLATE,
disks=[{"size": sz}], #FIXME: Always ask for a 4GB disk for now
nics=[nic],
os=settings.GANETI_OS_PROVIDER,
ip_check=False,
name_check=False,
# Do not specific a node explicitly, have
# Ganeti use an iallocator instead
#
# pnode=rapi.GetNodes()[0],
dry_run=settings.TEST,
beparams=dict(auto_balance=True, vcpus=flavor.cpu, memory=flavor.ram),
osparams=dict(img_id=image.backend_id, img_passwd=password,
img_format=image.format),
# Be explicit about setting serial_console = False for Synnefo-based
# instances regardless of the cluster-wide setting, see #785
hvparams=dict(serial_console=False))
# Handle arguments to CreateInstance() as a dictionary,
# initialize it based on a deployment-specific value.
# This enables the administrator to override deployment-specific
# arguments, such as the disk templatei to use, name of os provider
# and hypervisor-specific parameters at will (see Synnefo #785, #835).
#
kw = settings.GANETI_CREATEINSTANCE_KWARGS
kw['mode'] = 'create'
kw['name'] = vm.backend_id
# Defined in settings.GANETI_CREATE_INSTANCE_KWARGS
# kw['disk_template'] = settings.GANETI_DISK_TEMPLATE
kw['disks'] = [{"size": sz}]
kw['nics'] = [nic]
# Defined in settings.GANETI_CREATE_INSTANCE_KWARGS
# kw['os'] = settings.GANETI_OS_PROVIDER
kw['ip_check'] = False
kw['name_check'] = False
# Do not specific a node explicitly, have
# Ganeti use an iallocator instead
#
# kw['pnode']=rapi.GetNodes()[0]
kw['dry_run'] = settings.TEST
kw['beparams'] = dict(auto_balance=True, vcpus=flavor.cpu,
memory=flavor.ram)
kw['osparams'] = dict(img_id=image.backend_id, img_passwd=password,
img_format=image.format)
# Defined in settings.GANETI_CREATE_INSTANCE_KWARGS
# kw['hvparams'] = dict(serial_console=False)
return rapi.CreateInstance(**kw)
def delete_instance(vm):
......
......@@ -13,4 +13,24 @@ GANETI_CLUSTER_INFO = (GANETI_MASTER_IP, 5080, "synnefo", "ocean!")
# The dash must always appear in the name!
BACKEND_PREFIX_ID = "snf-"
GANETI_OS_PROVIDER = "image+default"
# The following dictionary defines deployment-specific
# arguments to the RAPI CreateInstance call.
# At a minimum it should contain the
# 'disk_template', 'os_provider', and 'hvparams' keys.
#
# More specifically:
# a) disk_template:
# The disk template to use when creating the instance.
# Suggested values: 'plain', or 'drbd'.
# b) os:
# The OS provider to use (customized Ganeti Instance Image)
# c) hvparams:
# Hypervisor-specific parameters (serial_console = False, see #785)
# d) If using the DRBD disk_template, you may want to include
# wait_for_sync = False (see #835).
#
GANETI_CREATEINSTANCE_KWARGS = {
'disk_template': 'drbd',
'os': 'image+default',
'hvparams': {'serial_console': False},
'wait_for_sync': False}
......@@ -47,10 +47,6 @@ APPEND_SLASH = False
#
IGNORE_FLAVOR_DISK_SIZES = False
# Use the following disk template when creating an instance
# on the Ganeti backend. Suggested values: 'plain', or 'drbd'.
GANETI_DISK_TEMPLATE = 'plain'
# Quota
#
# Maximum number of VMs a user is allowed to have
......
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