1 of 32

FUEL

Library

& more

Mirantis, 2014

Vladimir Kuklin

Fuel Library Tech Lead

2 of 32

FUEL Library & More

1. what is FUEL: main architecture components

2. getting started

3. starting development of your own component/plugin

4. how to test

5. FUEL roadmap for the near future

3 of 32

What is FUEL

  • FUEL UI/FUEL CLI
  • API + logic-> Nailgun
  • Provisioning -> Cobbler
  • Deployment -> Astute orchestrator + Puppet
  • Health check -> OSTF
  • OSCI -> patches and customized packages
  • fuel-devops -> env-management library
  • fuel system tests -> very useful

4 of 32

What is FUEL: components

5 of 32

What is FUEL: How master node is bootstrapped

  1. GRUB boots. Here you can set network vars, such as ip/dns/gw/netmask
  2. urwid-based fuel-menu is started -> updates astute.yaml -> configures network/NTP/etc.
  3. puppet apply is triggered:
    1. installs packages/configures Postgres/etc.
    2. creates VENVs for python applications
    3. configures cobbler:
      1. registers 3 profiles: bootstrap/centos/ubuntu
      2. installs snippets and kickstart

6 of 32

What is FUEL: How data is passed from Nailgun

  1. nailgun calculates data
  2. prepares data for cobbler and puppet
    • you can alter the result
  3. provisioning:
    • register system in cobbler and reboot it (currently using SSH, IPMI/UPS/PDU in the roadmap)
    • wait for mcollective to respond
  4. deploy:
    • send attrs to the nodes
    • run puppet in the prioritized sequence

7 of 32

What is FUEL: How data gets to the cobbler/puppet

  • Astute receives tasks and executes them:
    • talking to cobbler API(register system/delete system/(re-)boot system)
    • uploading deployment vars to the nodes
    • uploading puppet manifests on the nodes
    • running puppet
    • uploading Cirros image
    • applying hacks and workarounds
    • gets and reports provisioning and deployment progress

8 of 32

What is FUEL: How node passes from null state to ready state

  • discover
    • collect node data and POST it to Nailgun
  • provision
    • get preseed/kickstart
    • common auto-install (lots of hacks included)
  • deploy
    • puppet apply

9 of 32

What is FUEL: How node passes from null state to ready state

Provision a node

cobbler system dumpvars --name node-1:

kernel_options: var1=val1,var2=val2 …

interfaces: JSON

ks_meta : mco_enable=1 mco_vhost=mcollective

Used by snippets and postinst scripts (cobbler templates)

10 of 32

What is FUEL: How node passes from null state to read state

Deploy a node

/etc/astute.yaml

/etc/puppet/manifests/site.pp (osnailyfacter module):

fetch vars from YAML->case switches for deployment mode/role

11 of 32

What is FUEL: Puppet cluster attrs

astute.yaml example:

glance:

user_password: u8BKT2Rm

image_cache_max_size: "13868466176"

db_password: gLDABw4S

storage:

ephemeral_ceph: false

images_ceph: false

12 of 32

What is FUEL: Puppet nodes attrs

astute.yaml example:

nodes:

- name: node-1

storage_address: 192.168.1.1

storage_netmask: 255.255.255.0

internal_address: 192.168.0.1

fqdn: node-1.test.domain.local

role: controller

uid: "1"

13 of 32

What is FUEL: Puppet run

puppet manifest part:

site.pp

$fuel_settings = parseyaml($astute_settings_yaml) …

cluster_ha.pp

$glance_hash = $::fuel_settings['glance']

class {'ceph':

...

use_rgw => $storage_hash['objects_ceph']

14 of 32

What is FUEL: Astute - role priorities

nailgun code piece:

271 def set_deployment_priorities(cls, nodes):

272 """Set priorities of deployment for HA mode."""

273 prior = Priority()

274

275 primary_swift_proxy_piror = prior.next

276 for n in cls.by_role(nodes, 'primary-swift-proxy'):

277 n['priority'] = primary_swift_proxy_piror

15 of 32

Getting Started

  • Download ISO
  • Build your own

http://docs.mirantis.com/fuel-dev/develop/env.html#building-the-fuel-iso

    • Clone github.com:stackforge/fuel-main.git
    • Install prerequisites
    • run `make [iso]`

16 of 32

Getting Started: Running FUEL

  • VBOX: http://software.mirantis.com/quick-start/
  • Prepare environment for your Hypervisor:
    • VMs with disks (system,[ceph],[nova],[glance])
    • several networks (at least one):
      • PXE
      • [management]
      • [storage]
      • [private]

17 of 32

Getting Started: Running FUEL

  • run FUEL system test:
    • use normal Operating System at last
    • activate python venv
    • `pip install -r fuel-main/fuelweb_test/requirements.txt`
    • follow fuelweb_test readme
    • dos.py - devops python scripts
    • export $PYTHONPATH=”$PYTHONPATH:fuel-main/fuelweb_test”,
    • export vars fuelweb_test/settings.py vars
    • python fuelweb_test/run_tests.py -s -v --group=deploy_ha_flat

18 of 32

Getting Started: Altering cluster params

  • FUEL CLI/API:
    • `fuel --env 2 provisioning --default`
    • `fuel --env 2 provisioning --upload <dir>`
    • `fuel --env 2 deployment --default`
    • `fuel --env 2 deployment --upload <dir>`

19 of 32

Starting your own plugin/component

  • generic system component (e.g. mongo)
  • openStack component
  • plugin for OpenStack component

20 of 32

Starting your own plugin/component

  • start a blueprint on Launchpad
    • identify provisioning specifics
      • networking
      • disks
      • etc.
    • identify deployment specifics
      • prerequisites
      • config file changes
      • services start/stop order
      • whether you need HA

21 of 32

Starting your own plugin/component

  • write cobbler snippets for provisioning
    • patch pmanager.py script
    • patch networking snippets
  • write puppet modules
    • implement your own component separately
    • inject its call into osnailyfacter module
  • alter cluster params and upload them

22 of 32

Your own plugin: I want...

  • My own role:
    • alter nailgun role priority code
    • alter nodes hash in astute.yaml

23 of 32

Your own plugin: I want...

  • HA
    • write OCF script for pacemaker (http://linux-ha.org)
    • use corosync puppet module (see galera|neutron modules)
    • configure load-balancing using haproxy if needed�(see openstack::ha classes)

24 of 32

How to test

  • Build ISO with modified code:
    • alter config.mk REPOS and COMMIT params
  • FUEL system tests:
    • use fuel-devops
    • use proboscis python module
    • use kvm snapshot feature
  • OSTF tests

25 of 32

How to test: system tests

  • Snapshots:
    • each stage is snapshotted:�empty->ready->prepare_3|5_slaves
    • you can revert to the snapshot using devops easily

26 of 32

How to test: system tests

  • Example:

74 @test(depends_on=[SetupEnvironment.prepare_slaves_3],

75 groups=["smoke", "deploy_simple_flat"])

76 @log_snapshot_on_error

77 def deploy_simple_flat(self)

94 self.env.revert_snapshot("ready_with_3_slaves")

96 cluster_id = self.fuel_web.create_cluster(

97 name=self.__class__.__name__,

98 mode=DEPLOYMENT_MODE_SIMPLE

99 )

100 self.fuel_web.update_nodes(cluster_id,

102 {'slave-01': ['controller'], 'slave-02': ['compute']})

107 self.fuel_web.deploy_cluster_wait(cluster_id)

27 of 32

How to test: system tests

  • run FUEL system test:
    • use normal Operating System at last
    • activate python venv
    • `pip install -r fuel-main/fuelweb_test/requirements.txt`
    • follow fuelweb_test readme
    • dos.py - devops python scripts
    • export $PYTHONPATH=”$PYTHONPATH:fuel-main/fuelweb_test”,
    • export vars fuelweb_test/settings.py vars
    • python fuelweb_test/run_tests.py -s -v --group=deploy_ha_flat

28 of 32

How to test: system tests return error

  • test will return how to revert to the snapshot smth like this:� `dos.py revert --snapshot_name <env_name> error_<test_name> && dos.py resume ...`
  • go to master node and troubleshoot your installation

29 of 32

FUEL roadmap

  • Cobbler -> Ironic
  • Astute -> Mistral
    • deployment-tool agnostic granular tasks with dependency graph
  • refactoring & refactoring & refactoring
  • latest stable software versions:
    • galera
    • rabbitmq
    • [may be] qpid
    • openvswitch
    • distro versions (CentOS 6.5 & Ubuntu 12.04.4)

30 of 32

FUEL roadmap

  • HA improvements
    • STONITH using IPMI/PDU/APC
    • newer hardened OCF scripts and logic
      • galera
      • postgres binary replication
      • all services under pacemaker
  • merging with upstream puppet modules
    • enable all newer OpenStack components
    • eliminate puppet-openstack module
  • more and more plugins (vCenter,Oracle VM, SoftLayer, Nicira NSX, Mongo for Ceilometer )

31 of 32

FUEL roadmap

  • backup and restore of FUEL node
  • deploy OpenStack trunk code
  • full test coverage: from unit to Rally
  • OpenStack patching and upgrades
  • security hardening (SSL/CA for PKI)

32 of 32

Q&A