Cloud-init. Marc Skinner - Principal Solutions Architect Michael Heldebrant - Solutions Architect Red Hat



Similar documents
How To Boot A Cloud Instance On Ubuntu (Oracle) On Ubuntusa (Orca) On A Ubuntu Cloud Instance (Ora) On An Ubuntu 3.5

Automated Configuration of Open Stack Instances at Boot Time

VMTurbo Operations Manager 4.5 Installing and Updating Operations Manager

Deploying Red Hat Enterprise Virtualization On Tintri VMstore Systems Best Practices Guide

Red Hat Enterprise Linux OpenStack Platform 8 Partner Integration

SUSE Manager in the Public Cloud. SUSE Manager Server in the Public Cloud

Skip the But it Works on My Machine Excuse with Vagrant

ovirt self-hosted engine seamless deployment

OpenStack & Hyper-V. Alessandro Pilo- CEO Cloudbase

Red Hat CloudForms for Cloud Management: Key Features & Roadmap

SOA Software API Gateway Appliance 7.1.x Administration Guide

Virtualization Management the ovirt way

Security Gateway for OpenStack

Mirantis

Eucalyptus Hybrid Cloud Guide

OPEN CLOUD INFRASTRUCTURE BUILT FOR THE ENTERPRISE

ovirt: Open Your Virtual Data Center

How to Backup XenServer VM with VirtualIQ

OpenStack Introduction. November 4, 2015

Deploy and test ovirt using nested virtualization environments. Mark Wu

OpenTOSCA Release v1.1. Contact: Documentation Version: March 11, 2014 Current version:

Postgres on OpenStack

Building a Private Cloud Cloud Infrastructure Using Opensource

Windows Template Creation Guide. How to build your own Windows VM templates for deployment in Cloudturk.

Timofey Turenko. Kirill Krinkin St-Petersburg Electrotechnical University

In order to upload a VM you need to have a VM image in one of the following formats:

CHEF IN THE CLOUD AND ON THE GROUND

The path to the cloud training

Red Hat System Administration 1(RH124) is Designed for IT Professionals who are new to Linux.

RED HAT INFRASTRUCTURE AS A SERVICE OVERVIEW AND ROADMAP. Andrew Cathrow Red Hat, Inc. Wednesday, June 12, 2013

IBM Cloud Manager with OpenStack

Cloud.com CloudStack Community Edition 2.1 Beta Installation Guide

Déployer son propre cloud avec OpenStack. GULL François Deppierraz

Release Notes for Fuel and Fuel Web Version 3.0.1

rackspace.com/cloud/private

SUSE Cloud. End User Guide. August 06, 2014

SUSE Cloud Installation: Best Practices Using an Existing SMT and KVM Environment

Migration of virtual machine to cloud using Openstack Python API Clients

IaaS Configuration for Cloud Platforms

Automated deployment of virtualization-based research models of distributed computer systems

Eucalyptus User Console Guide

Virtualization & Cloud Computing (2W-VnCC)

Introduction to Openstack, an Open Cloud Computing Platform. Libre Software Meeting

HP Helion CloudSystem 9.0

Develop a process for applying updates to systems, including verifying properties of the update. Create File Systems

RED HAT ENTERPRISE LINUX OPENSTACK PLATFORM

Plexxi Control Installation Guide Release 2.1.0

Web Application Firewall

Project Documentation

Onboarding VMs to Cisco OpenStack Private Cloud

Deployment of Private, Hybrid & Public Clouds with OpenNebula

McAfee Public Cloud Server Security Suite

OpenShift on you own cloud. Troy Dawson OpenShift Engineer, Red Hat November 1, 2013

Getting Started with the CLI and APIs using Cisco Openstack Private Cloud

Tcl and Cloud Computing Automation

OpenShift on OpenStack

Using Red Hat Enterprise Linux with Georgia Tech's RHN Satellite Server Installing Red Hat Enterprise Linux

Red Hat Enterprise Linux OpenStack Platform 7 OpenStack Data Processing

The Total Newbie s Introduction to Heat Orchestration in OpenStack

VX 9000E WiNG Express Manager INSTALLATION GUIDE

1 Keystone OpenStack Identity Service

Deploying Baremetal Instances with OpenStack

Zend Server Amazon AMI Quick Start Guide

DOCUMENTATION ON ADDING ENCRYPTION TO OPENSTACK SWIFT

UForge 3.4 Release Notes

About the VM-Series Firewall

How To Manage An Ec2 Instance In A Cloud Instance

Creating a DUO MFA Service in AWS

Single Node Hadoop Cluster Setup

The path to the cloud training

Continuous Delivery on AWS. Version 1.0 DO NOT DISTRIBUTE

Red Hat Enterprise Linux OpenStack Platform Update February 17, 2016

IBM Cloud Manager with OpenStack. Administrator Guide, version 4.1

Server Configuration and Deployment (part 1) Lotus Foundations Essentials

OpenStack IaaS. Rhys Oxenham OSEC.pl BarCamp, Warsaw, Poland November 2013

IBM Cloud Manager with OpenStack. Administrator Guide, version 4.2

SUSE Cloud. OpenStack End User Guide. February 20, 2015

Alfresco Enterprise on AWS: Reference Architecture

CycleServer Grid Engine Support Install Guide. version 1.25

Acronis Backup & Recovery 10 Server for Linux. Update 5. Installation Guide

Red Hat Enterprise Virtualization Disaster Recovery

Installation and Configuration Guide

Server Installation/Upgrade Guide

ovirt Introduction James Rankin Product Manager Red Hat Virtualization Management the ovirt way

Building a big IaaS cloud with Apache CloudStack

October Gluster Virtual Storage Appliance User Guide

How To Install Storegrid Server On Linux On A Microsoft Ubuntu 7.5 (Amd64) Or Ubuntu (Amd86) (Amd77) (Orchestra) (For Ubuntu) (Permanent) (Powerpoint

TUT19344 Managing RH/CentOS with SUSE Manager

AdWhirl Open Source Server Setup Instructions

An Intro to OpenStack. Ian Lawson Senior Solution Architect, Red Hat

Acronis Backup & Recovery 10 Server for Linux. Installation Guide

Cloud on TIEN Part I: OpenStack Cloud Deployment. Vasinee Siripoonya Electronic Government Agency of Thailand Kasidit Chanchio Thammasat

The steps will take about 4 hours to fully execute, with only about 60 minutes of user intervention. Each of the steps is discussed below.

NOC PS manual. Copyright Maxnet All rights reserved. Page 1/45 NOC-PS Manuel EN version 1.3

BLACK BOX. Quick Start Guide. Virtual Central Management System (VCMS) Works with LES Series Console Servers. LES-VCMS. Customer Support Information

Transcription:

Cloud-init Marc Skinner - Principal Solutions Architect Michael Heldebrant - Solutions Architect Red Hat 1

Agenda What is cloud-init? What can you do with cloud-init? How does it work? Using cloud-init enabled images RHEV RHOS VMware Cloudforms leveraging cloud-init 2

What is cloud-init? Provides boot time customization for cloud and virtualization instances. Service runs early during boot, retrieves user data from an external provider and performs actions Supported user data formats: Shell scripts (starts with #!) Cloud config files (starts with #cloud-config) Standard YAML syntax available for many common configuration operations. MIME multipart archive. 3 Custom part handling also available. Modular and highly configurable.

What is cloud-init? cloud-init has modules for handling: Disk configuration Command execution Creating users and groups Package management Writing content files Bootstrapping Chef/Puppet Additional modules can be written in Python if desired. 4

What is cloud-init? Can be used to bootstrap other configuration management tools or agents. Widely used and broadly supported solution: OpenStack Amazon EC2 RHEV VMware Written in Python but other implementations possible (e.g. the shells scripts used in the Cirros image). 5

What is cloud-init? - Data Categories meta-data is provided by the cloud platform. user-data is a chunk of arbitrary data the user provides. Retrieved from data source and saved to /var/lib/cloud/ 6

What can you do with cloud-init? You may already be using it!: Injects SSH keys. Grows root filesystems. Other module support tasks such as: Setting the hostname. Setting the root password. Setting locale and time zone. Running custom scripts. 7

User-data Examples Upgrading and installing packages: #cloud config package_upgrade: true packages: git screen vim enhanced 8

User-data Examples Run an arbitrary command: #cloud config runcmd: rhnreg_ks activationkey=3753... Or: #!/bin/bash rhnreg_ks activationkey=3753... 9

User-data Examples 10 Configure Puppet agent: #cloud config puppet: conf: agent: server: "puppetmaster.example.org" certname: "%i.%f" cacert: BEGIN CERTIFICATE END CERTIFICATE

User-data Examples Configure Chef: #cloud config chef: install_type: "packages" force_install: false server_url: "https://chef.yourorg.com:4000" node_name: "your node name" environment: "production" validation_name: "yourorg validator" validation_key: BEGIN RSA PRIVATE KEY YOUR ORGS VALIDATION KEY HERE 11 END RSA PRIVATE KEY

User-data Examples Configure Chef part 2: run_list: "recipe[apache2]" "role[db]" initial_attributes: apache: prefork: maxclients: 100 keepalive: "off" 12

User-data Examples Including additional user-data files: #include http://config.example.com/cloud config http://config.dept.example.com/cloud config 13

User-data Examples Other possibilities: Additional YUM repository configuration. Guest agent installation/configuration. Use #include or arbitrary wget/curl command to retrieve configuration script from a central location. phone_home to post objects to an arbitrary url More examples at: http://cloudinit.readthedocs.org/en/latest/topics/exam ples.html 14

How does it work RHEV cloud-init on RHEV searches for a floppy drive containing a user-data.txt file RHEV creates virtual floppy drive with user-data.txt file with content in a format cloud-init expects: Shell script (#!) Cloud-config (#cloud-config) 15

Using cloud-init enabled images (RHEV) 16

Using cloud-init enabled images (RHEV) Install the rhel-guest-image-6 package from RH common: # yum install rhel guest image 6 Upload the image to an export domain: # engine image uploader upload export domain DefaultExport /usr/share/rhel guest image 6/rhel guest image 6 6.5 20140116.1 1/ Import the template into RHEV-M Create a virtual machine from the template. Click Run Once. Click Initial Run and then click cloud-init. 17

Using cloud-init enabled images (RHEV) <vm> <payloads> <payload type="floppy"> <file name="user data.txt"> <content> #!/bin/bash echo Testing... >> /root/testing.txt </content> </file> </payload> </payloads> 18 </vm>

How does it work - OpenStack / EC2 Accesses metadata service at http://169.254.169.254/latest/meta-data http://169.254.169.254/latest/user-data NAT rules on your network controller make this work. Service provided by nova-api (accessed via perrouter neutron-metadata-proxy when using Neutron). 19

Using cloud-init enabled images (RHOS) 20

Using cloud-init enabled images (RHOS) 21

How does it work - OpenStack/EC2 Data Source $ curl http://169.254.169.254/latest/meta data ami id ami launch index ami manifest path block device mapping/ hostname instance action instance id instance type kernel id local hostname local ipv4 placement/ public hostname public ipv4 public keys/ ramdisk id Reservation id $ curl http://169.254.169.254/latest/user data #!/bin/bash echo 'Extra user data here' 23

Using cloud-init enabled images (RHOS) Install the rhel-guest-image-6 package from RH common: # yum install rhel guest image 6 Upload the image to glance: # glance image create name rhel65 image disk format=qcow2 container format=bare is public=true file=/usr/share/rhel guest image 6/rhel guest image 6 6.5 20140116.1 1.qcow2 Launch an instance based on the image. 24

Using cloud-init enabled images (RHOS) Can also use the command line client: $ nova boot image rhel 6.5 flavor 1 user data mydata.file 25

How does it work VMware Requires control of power and cdrom drive to the vm and access to the iso domain or the vsphere client to mount the iso cloud-init on vsphere searches for a CDROM with volume id CDROM on boot guest in vsphere using cloud-init reads the iso mounted containing the user-data.txt file: Shell script (#!) Cloud-config (#cloud-config) 26

CloudForms: clone from template with cloud-init 27

Using cloud-init enabled images (VMware) 28

Getting cloud-init enabled images cloud-init package: Included in Red Hat Common channel for RHEL. 0.7.2 in EL6 0.7.4 in EL7 Included in Fedora. Baked into many cloud images: Red Hat Enterprise Linux Fedora Easily added to custom images for most common distributions. 29

Adding cloud-init to your own images (RHEV) Install the cloud-init package Configure /etc/cloud/cloud.cfg Allow root logins disable_root: 0 Add additional modules to customize behavior cloud-final-modules: - package-update-upgrade-install Remove the following to templatize /etc/udev/rules.d/70-persistent-* /etc/ssh/ssh_host* /etc/sysconfig/rhn/systemid 30

Using cloud-init enabled images Gotchas: RHEV injects SSH key into root by default, which is disabled for SSH in the RHEL image (BZ # 1063518 ). Free form text field for user data in UI does not capture Enter or Shift + Enter, need to paste multiline data in (BZ # 1064567). 32

Debugging /var/log/cloud-init.log in the guest contains (very) verbose output from the run. /var/lib/cloud/ contains the data retrieved from the metadata service on config drive. Run can be simulated/repeated from inside the guest: $ cloud init [ h] [ version] [ file FILES] [ debug] [ force] {query,init,modules,single} 33

Further Information Upstream Documentation How we use cloud-init in OpenStack Heat 34