openstack summit vancouver: lessons learned on upgrades

25
The importance of HA and automation tools Frédéric Lepied Engineering Manager [email protected] Lessons Learned On Upgrades Senior Software Engineer [email protected] Emilien Macchi

Upload: frederic-lepied

Post on 07-Aug-2015

143 views

Category:

Presentations & Public Speaking


4 download

TRANSCRIPT

Page 1: OpenStack Summit Vancouver:  Lessons learned on upgrades

The importance of HA and automation tools

Frédéric LepiedEngineering [email protected]

Lessons Learned On Upgrades

Senior Software [email protected]

Emilien Macchi

Page 2: OpenStack Summit Vancouver:  Lessons learned on upgrades

Red Hat Cloud Innovation Practice Engineering

Frédéric Lepied: RCIP Engineering managerEmilien Macchi: installer team / Puppet PTL

Page 3: OpenStack Summit Vancouver:  Lessons learned on upgrades

Disclaimer

The examples are taken from former eNovance products and not Red Hat ones.

Page 4: OpenStack Summit Vancouver:  Lessons learned on upgrades

OpenStack is a wonderful place,but upgrades are not easy.

Page 5: OpenStack Summit Vancouver:  Lessons learned on upgrades

What is a successful upgrade?

• No need of new hardware• The less interruption possible• Minor & Major upgrade support• Efficient, fast, reproducible process

Page 6: OpenStack Summit Vancouver:  Lessons learned on upgrades

Roadmap

• Redundant architecture• Enough free capacity• Image based deployment• Automation tooling

Page 7: OpenStack Summit Vancouver:  Lessons learned on upgrades

Redundant Architecture

Page 8: OpenStack Summit Vancouver:  Lessons learned on upgrades

Enough free capacity

• Have enough compute resources to migrate instances

• Have some spare in case of failure

Page 9: OpenStack Summit Vancouver:  Lessons learned on upgrades

Image based workflow (recommended)

• Build your images once• Install using your images• Upgrade using your images

Page 10: OpenStack Summit Vancouver:  Lessons learned on upgrades

Build and archive your images

• Build your image in a CI• Use packaging tools (yum, apt, …)• Compression & archive• Stamp with versioning• Use Cloud Storage (Swift, Ceph)

Image based deployment

Page 11: OpenStack Summit Vancouver:  Lessons learned on upgrades

Limit the number of images

• More images = more pain• Single image with:

• all packages installed• all services disabled at boot

Image based deployment

Page 12: OpenStack Summit Vancouver:  Lessons learned on upgrades

Prohibit packaging tools

• Keep systems:• consistent• reproducible• auditable

• Speed-up configuration management

• Allow to re-enable the tools

Image based deployment

Page 13: OpenStack Summit Vancouver:  Lessons learned on upgrades

Upgrade your system with a tool

• APT / YUM:• too slow at scale (~20 min / node)• need to manage your repositories

• Using eDeploy:• very fast at scale (~20 s / node)• allow rollbacks

Image based deployment

Page 14: OpenStack Summit Vancouver:  Lessons learned on upgrades

Automation tooling

• Control system upgrade• Configuration management• Orchestration• Automate the workflow

Page 15: OpenStack Summit Vancouver:  Lessons learned on upgrades

Control system upgrade

We need:• one command to upgrade one system• no service restarted or reloaded• possibility to rollback

What we use:• eDeploy : tool to upgrade images with rsync

Automation tooling

Page 16: OpenStack Summit Vancouver:  Lessons learned on upgrades

Configuration management

• Puppet, Chef, Ansible, whatever you like• “The best tool is the one you already use.”• But:

• … you need to update your config• … do not manage packages

Automation tooling

Page 17: OpenStack Summit Vancouver:  Lessons learned on upgrades

Orchestrator

• Puppet and Chef are good for configuration• But you need to orchestrate multiple systems:

• restart services in the right order• upgrade the system at the right time

Automation tooling

Page 18: OpenStack Summit Vancouver:  Lessons learned on upgrades

Upgrade workflow

Automation tooling

• Pre-upgrade actions• Resources evacuation• Stop OpenStack services• Stop Infra / system services• Upgrade packages• Start Infra / system services• Start OpenStack services• Post-upgrade actions

Page 19: OpenStack Summit Vancouver:  Lessons learned on upgrades

Example: upgrade a compute node

• evacuate virtual machines• disable nova compute service• system upgrade• update config• service libvirtd restart• service openstack-nova-compute restart• enable nova-compute service• test the service

Automation tooling

Page 20: OpenStack Summit Vancouver:  Lessons learned on upgrades

Ansible snippet example (hypervisor)- name: evacuate compute node script: evacuate-compute.sh tags: 2

- name: restart nova-compute service: name={{ item }} state=restarted with_items:

- "{{ libvirt }}"- "{{ nova_compute }}"

tags: 8

- name: enable nova-compute service script: enable-compute.sh tags: 9

Automation tooling

Page 21: OpenStack Summit Vancouver:  Lessons learned on upgrades

Automate the workflow

Automation tooling

• Upgrades are repetitive• Prepare an upgrade without effort• Prepare Ansible Playbooks with

snippets• Compose Playbooks by computing:

• what is upgraded in the image• which service is running on a node

Page 22: OpenStack Summit Vancouver:  Lessons learned on upgrades

Ansible best practices

• Use tags in snippets to define ordering• Run HA nodes in serial• Run compute nodes in parallel• Use a script for hypervisor evacuation• Allow to continue to roll playbooks after a

failure• a snippet for each service to upgrade

Automation tooling

Page 23: OpenStack Summit Vancouver:  Lessons learned on upgrades

Generate Ansible playbooks per role

Automation tooling

Page 24: OpenStack Summit Vancouver:  Lessons learned on upgrades

• Your OpenStack needs HA

• Make sure you have free capacity

• Image based upgrade is a good option

• Orchestration and Configuration Management are key

Conclusion

Page 25: OpenStack Summit Vancouver:  Lessons learned on upgrades

Thank you!

http://tinyurl.com/ansible-snippets@EmilienMacchi@flepied