Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Deploy and Use OpenStack with Ansible

iGene
July 18, 2017

Deploy and Use OpenStack with Ansible

#OpenStack #Anisble #Kolla
Ansible 是個讓自動化簡單易用的開放原始碼的計畫 --- 它目前是最多人使用用來部署跟設定OpenStack環境的工具。現在,就連OpenStack-infra team 都使用它來自動化OpenStack 的CI 測試。想要知道如何使用Ansible 部署跟應用你的OpenStack 雲嗎?這講題就是你的最佳選擇。如果你知道 Ansible 跟 OpenStack 卻不知道如何開始自動化你的 IT ? 這講題也是你的最佳選擇。
來這個講題你能:

- 了解 Ansible 跟它與 OpenStack 的關係。
- 如何使用 Ansible 快速、輕鬆部署一個 OpenStack 環境。
- 如何使用 Ansible 中的 OpenStack Modules 操作 OpenStack 雲。

iGene

July 18, 2017
Tweet

More Decks by iGene

Other Decks in Technology

Transcript

  1. Who Am I - OpenStack Active User Contributor - Former

    OpenStack Foundation Intern - Organizer at OpenStack Taiwan User Group - Student at NCTU - [email protected]
  2. • Provisioning • Configuration Management • Application Deployment ANSIBLE OPENSTACK

    ANSIBLE KOLLA ANSIBLE OPENSTACK MODULES DEMO • Continuous Delivery • Security and Compliance • Orchestration
  3. • Simple • One task do one thing • Agent-less

    • Extensible • Lots of modules ANSIBLE OPENSTACK ANSIBLE KOLLA ANSIBLE OPENSTACK MODULES DEMO
  4. • Ansible Playbooks for deploying OpenStack • Supports installation of

    most of the OpenStack Projects • Deploys OpenStack on LXC (or baremetal) • Deploys OpenStack from Source • Scalable while also being simple to operate, upgrade, and grow • Ceph Ansible integration ANSIBLE OPENSTACK ANSIBLE KOLLA ANSIBLE OPENSTACK MODULES DEMO
  5. • Need to manaul install Operating System • Required to

    setup network bridges • At least 4 nodes minimum (infra, compute, storage, log) ANSIBLE OPENSTACK ANSIBLE KOLLA ANSIBLE OPENSTACK MODULES DEMO Drawbacks:
  6. • MariaDB with Galera • Memcached • Repository • Load

    balancer • Log aggregation host • Unbound DNS container ANSIBLE OPENSTACK ANSIBLE KOLLA ANSIBLE OPENSTACK MODULES DEMO
  7. • Bare Metal (ironic) • Block Storage (cinder) • Compute

    (nova) • Container Infrastructure Management (magnum) • Dashboard (horizon) • Data Processing (sahara) • Identity (keystone) • Image (glance) • Networking (neutron) • Object Storage (swift) • Orchestration (heat) • Telemetry (aodh, ceilometer, gnocchi) ANSIBLE OPENSTACK ANSIBLE KOLLA ANSIBLE OPENSTACK MODULES DEMO
  8. • Production-ready container deployment tool • Supports installation of most

    of the OpenStack Projects • Very fast to deploy, highly scable • Ceph integration • Immutable infrastructure DEMO ANSIBLE OPENSTACK ANSIBLE KOLLA ANSIBLE OPENSTACK MODULES
  9. • Need to manaul install Operating System • Network bonding

    • No built-in tools to monitor OpenStack service containers status DEMO ANSIBLE OPENSTACK ANSIBLE KOLLA ANSIBLE OPENSTACK MODULES Drawbacks:
  10. 1. Install Operating System 2. Edit config files (globals.yml, inventory)

    3. bootstrap-servers, prechecks, deploy DEMO ANSIBLE OPENSTACK ANSIBLE KOLLA ANSIBLE OPENSTACK MODULES
  11. • Docker • Like Containers • Immutable Infrastructure • Deploy

    from pre-built images • LXC or Baremetal • More like VMs • Fully based on Ansible • Deploy from source OpenStack-Ansible Kolla-Ansible DEMO ANSIBLE OPENSTACK ANSIBLE KOLLA ANSIBLE OPENSTACK MODULES
  12. • Ansible Modules for managing OpenStack Clouds • Supports Nova,

    Keystone, Glance, Neutron, Ironic, Cinder, Swift • Will do almost the same as a HEAT template • Easy to manage full stack automation • Hide difference in datacenter architecture DEMO ANSIBLE OPENSTACK ANSIBLE KOLLA ANSIBLE OPENSTACK MODULES
  13. • Keystone: user, groups, roles, projects • Nova: servers, keypairs,

    security groups, flavors • Neutron: network, ports, subnet, routers, floating IPs • Ironic: nodes, introspection • Swift Objects • Cinder Volume • Glance Image DEMO ANSIBLE OPENSTACK ANSIBLE KOLLA ANSIBLE OPENSTACK MODULES
  14. DEMO ANSIBLE OPENSTACK ANSIBLE KOLLA ANSIBLE OPENSTACK MODULES - name:

    Create test node os_server: state: present auth: "{{ auth }}" name: test image: "cirros" key_name: "openstack-tests" timeout: 200 flavor: test security_groups: test_sg floating_ip_pools: "{{ env.public_net_name | default(omit) }}" - name: Create a volume for test instance os_server_volume: state: present auth: "{{ auth }}" server: test volume: test_volume device: "/dev/vdb"
  15. • Runs on datacenters • Only for virtual resources •

    Just delete the stack • Only cloud-init scripts to provision servers • Runs on your laptop • Common langauge for full stack IT • Have to keep track and manaully delete resource • Easier to provision servers after creation Ansible Heat DEMO ANSIBLE OPENSTACK ANSIBLE KOLLA ANSIBLE OPENSTACK MODULES
  16. DEMO ANSIBLE OPENSTACK ANSIBLE KOLLA ANSIBLE OPENSTACK MODULES • 2

    load balancers, 2 webservers, 1 database server • Cinder volume for database storage • Security groups for firewall • Install Wordpress on webservers
  17. $ sudo apt-get install python-pip $ sudo pip install virtualenvwrapper

    $ sudo apt-get install python-heatclient python-openstackclient python-shade DEMO ANSIBLE OPENSTACK ANSIBLE KOLLA ANSIBLE OPENSTACK MODULES
  18. $ mkdir $HOME/.virtualenvs add these lines to .bashrc export WORKON_HOME=$HOME/.virtualenvs

    source /usr/bin/virtualenvwrapper.sh $ source ~/.bashrc $ mkvirtualenv ansible2 --system-site-packages DEMO ANSIBLE OPENSTACK ANSIBLE KOLLA ANSIBLE OPENSTACK MODULES
  19. (ansible2) $ pip install ansible (ansible2) $ ansible --version (ansible2)

    $ pip install shade --upgrade DEMO ANSIBLE OPENSTACK ANSIBLE KOLLA ANSIBLE OPENSTACK MODULES