summaryrefslogtreecommitdiffstats
path: root/deploy/scenario/ha_heat_ceilometer_scenario_0.0.3.yaml
blob: 8ab5f9277ddabcd2c1e02ba8b22d4956743dd51e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
##############################################################################
# Copyright (c) 2015 Ericsson AB and others.
# jonas.bjurel@ericsson.com
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

############################################################################### # Description:
# This .yaml configuration file defines the configuration of the fuel
# deployment and is passed as an argument to deploy.sh
# eg. deploy.sh -c https://artifact.opnfv.org/fuel/config
# This will make build.sh fetch this configuration file and configure the
# deployment accordingly.
# After the deployment, a copy of this file gets uploaded to fuel:
# /root/deploy-config.yaml, as well as the sha-1 sum of this file:
# /root/deploy-config.sha1
##############################################################################

##############################################################################
# deployment configuration meta-data
deployment-scenario-metadata:
   title: OpenStack-only, HA deployment
   version: 0.0.3
   created: Jan 26 2016
   comment: Rebased to Fuel8

##############################################################################
# Stack extentions are opnfv added value features in form of a fuel-plugin
# plug-ins listed below will be enabled and configured according to the
# <module-config-base-uri>/<module-config-name>_<module-config-version>.yaml
# It does so by copying the config file to the local plugin config directory
stack-extensions:

##############################################################################
# By editing the override-config sections below, you can override arbitrary
# configuration name-space settings
dea-override-config:
  nodes:
  - id: 1
    interfaces: interfaces_1
    role: controller
    transformations: transformations_1
  - id: 2
    interfaces: interfaces_1
    role: mongo, controller
    transformations: transformations_1
  - id: 3
    interfaces: interfaces_1
    role: ceph-osd,controller
    transformations: transformations_1
  - id: 4
    interfaces: interfaces_1
    role: ceph-osd,compute
    transformations: transformations_1
  - id: 5
    interfaces: interfaces_1
    role: ceph-osd,compute
    transformations: transformations_1

dha-override-config:
  nodes:
  - id: 1
    libvirtName: controller1
    libvirtTemplate: templates/virtual_environment/vms/controller.xml
  - id: 2
    libvirtName: controller2
    libvirtTemplate: templates/virtual_environment/vms/controller.xml
  - id: 3
    libvirtName: controller3
    libvirtTemplate: templates/virtual_environment/vms/controller.xml
  - id: 4
    libvirtName: compute1
    libvirtTemplate: templates/virtual_environment/vms/compute.xml
  - id: 5
    libvirtName: compute2
    libvirtTemplate: templates/virtual_environment/vms/compute.xml
  - id: 6
    libvirtName: fuel-master
    libvirtTemplate: templates/virtual_environment/vms/fuel.xml
    isFuel: yes
    username: root
    password: r00tme


##############################################################################
# The verification pipeline may populate the section below with arbitrary
# testing information, which post deploy can be retreived from the fuel master:
# /root/deploy-config.yaml
test:
self.fuel_password) def install(self): log('Start Fuel Installation') self.dha.node_power_off(self.fuel_node_id) if os.environ.get('LIBVIRT_DEFAULT_URI'): log('Upload ISO to pool') self.iso_file = self.dha.upload_iso(self.iso_file) else: log('Zero the MBR') self.dha.node_zero_mbr(self.fuel_node_id) self.dha.node_set_boot_order(self.fuel_node_id, ['disk', 'iso']) try: self.proceed_with_installation() except Exception as e: self.post_install_cleanup() err(e) def proceed_with_installation(self): log('Eject ISO') self.dha.node_eject_iso(self.fuel_node_id) log('Insert ISO %s' % self.iso_file) self.dha.node_insert_iso(self.fuel_node_id, self.iso_file) self.dha.node_power_on(self.fuel_node_id) log('Waiting for Fuel master to accept SSH') self.wait_for_node_up() log('Wait until Fuel menu is up') fuel_menu_pid = self.wait_until_fuel_menu_up() log('Inject our own astute.yaml settings') self.inject_own_astute_yaml() log('Let the Fuel deployment continue') log('Found FUEL menu as PID %s, now killing it' % fuel_menu_pid) self.ssh_exec_cmd('kill %s' % fuel_menu_pid, False) log('Wait until installation is complete') self.wait_until_installation_completed() log('Waiting for one minute for Fuel to stabilize') time.sleep(60) self.delete_deprecated_fuel_client_config() if not self.no_plugins: self.collect_plugin_files() self.install_plugins() self.post_install_cleanup() log('Fuel Master installed successfully !') def collect_plugin_files(self): with self.ssh as s: s.exec_cmd('mkdir %s' % PLUGINS_DIR) if self.fuel_plugins_dir: for f in glob.glob('%s/*.rpm' % self.fuel_plugins_dir): s.scp_put(f, PLUGINS_DIR) def install_plugins(self): log('Installing Fuel Plugins') plugin_files = [] with self.ssh as s: for plugin_location in [PLUGINS_DIR, LOCAL_PLUGIN_FOLDER]: s.exec_cmd('mkdir -p %s' % plugin_location) r = s.exec_cmd('find %s -type f -name \'*.rpm\'' % plugin_location) plugin_files.extend(r.splitlines()) for f in plugin_files: log('Found plugin %s, installing ...' % f) r, e = s.exec_cmd('fuel plugins --install %s' % f, False) printout = r + e if e else r if e and all([err not in printout for err in IGNORABLE_FUEL_ERRORS]): raise Exception('Installation of Fuel Plugin %s ' 'failed: %s' % (f, e)) def wait_for_node_up(self): WAIT_LOOP = 240 SLEEP_TIME = 10 success = False for i in range(WAIT_LOOP): try: self.ssh.open() success = True break except Exception: log('Trying to SSH into Fuel VM %s ... sleeping %s seconds' % (self.fuel_ip, SLEEP_TIME)) time.sleep(SLEEP_TIME) finally: self.ssh.close() if not success: raise Exception('Could not SSH into Fuel VM %s' % self.fuel_ip) def wait_until_fuel_menu_up(self): WAIT_LOOP = 60 SLEEP_TIME = 10 CMD = 'ps -ef' SEARCH = 'fuelmenu' fuel_menu_pid = None with self.ssh: for i in range(WAIT_LOOP): ret = self.ssh.exec_cmd(CMD) fuel_menu_pid = self.get_fuel_menu_pid(ret, SEARCH) if not fuel_menu_pid: time.sleep(SLEEP_TIME) else: break if not fuel_menu_pid: raise Exception('Could not find the Fuel Menu Process ID') return fuel_menu_pid def get_fuel_menu_pid(self, printout, search): for line in printout.splitlines(): if line.endswith(search): return clean(line)[1] def ssh_exec_cmd(self, cmd, check=True): with self.ssh: ret = self.ssh.exec_cmd(cmd, check=check) return ret def inject_own_astute_yaml(self): with self.ssh as s: s.exec_cmd('rm -rf %s' % self.work_dir, False) s.exec_cmd('mkdir %s' % self.work_dir) s.scp_put(self.dea_file, self.work_dir) s.scp_put('%s/common.py' % self.file_dir, self.work_dir) s.scp_put('%s/dea.py' % self.file_dir, self.work_dir) s.scp_put('%s/transplant_fuel_settings.py' % self.file_dir, self.work_dir) log('Modifying Fuel astute') s.run('python %s/%s %s/%s' % (self.work_dir, TRANSPLANT_FUEL_SETTINGS, self.work_dir, os.path.basename(self.dea_file))) def wait_until_installation_completed(self): WAIT_LOOP = 360 SLEEP_TIME = 10 CMD = 'ps -ef | grep %s | grep -v grep' % BOOTSTRAP_ADMIN install_completed = False with self.ssh: for i in range(WAIT_LOOP): ret = self.ssh.exec_cmd(CMD) if not ret: install_completed = True break else: time.sleep(SLEEP_TIME) if not install_completed: raise Exception('Fuel installation did not complete') def post_install_cleanup(self): log('Eject ISO file %s' % self.iso_file) self.dha.node_eject_iso(self.fuel_node_id) delete(self.iso_dir) def delete_deprecated_fuel_client_config(self): with self.ssh as s: response, error = s.exec_cmd('fuel -v', False) if (error and 'DEPRECATION WARNING' in error and FUEL_CLIENT_CONFIG in error): log('Delete deprecated fuel client config %s' % FUEL_CLIENT_CONFIG) with self.ssh as s: s.exec_cmd('rm %s' % FUEL_CLIENT_CONFIG, False)