On Github ifarkas / devconf2014-tripleo
Imre Farkas and Ladislav Smola
“TripleO is a program aimed at installing, upgrading and operating OpenStack clouds using OpenStack's own cloud facilities as the foundations - building on Nova, Neutron, Heat and Ironic to automate fleet management at datacenter scale (and scaling down to as few as 2 machines).”
wget http://download.fedoraproject.org/pub/fedora/linux/releases/20/
Images/x86_64/Fedora-x86_64-20-20131211.1-sda.qcow2
nova boot myCentOSServer
--image "3afe97b2-26dc-49c5-a2cc-a2fc8d80c001"
--flavor m1.small
Use Puppet, Chef, Ansible or whatever for configuration
Use Heat!
heat_template_version: 2013-05-23 description: ... parameters: ... resources: ... outputs: ...Just an overview, in-depth coming on next slides!
parameters:
db_name:
type: string
description: WordPress database name
default: wordpress
constraints:
- length: { min: 1, max: 64 }
description: db_name must be between 1 and 64 characters
- allowed_pattern: '[a-zA-Z][a-zA-Z0-9]*'
description: >
db_name must begin with a letter and contain only alphanumeric
characters
resources:
wordpress_instance:
type: OS::Nova::Server
properties:
image: { get_param: image_id }
flavor: { get_param: instance_type }
key_name: { get_param: key_name }
user_data:
...
user_data:
str_replace:
template: |
#!/bin/bash -v
yum -y install mysql mysql-server httpd wordpress
systemctl enable mysqld.service
systemctl enable httpd.service
systemctl start mysqld.service
systemctl start httpd.service
firewall-cmd --add-service=http
firewall-cmd --permanent --add-service=http
outputs:
WebsiteURL:
description: URL for Wordpress wiki
value:
str_replace:
template: http://host/wordpress
params:
host: { get_attr: [wordpress_instance, first_address] }
heat stack-create mystack
--template-file=WordPress_Single_Instance.yaml
--parameters="db_name=$db_name;db_rootpassword=..."
“The goal of the image building process is to produce blank slate machines that have all the necessary bits to fulfill a specific purpose in the running of an Openstack cloud: e.g. a nova-compute node.”
bin/install-packages bin/map-packages bin/map-services finalise.d/01-clean-old-kernels.sh finalise.d/99-setup-first-boot install.d/00-fedora-fixup-audit install.d/00-fedora-fixup-openssl install.d/00-fedora-fixup-pyopenssl install.d/01-install-deps pre-install.d/15-fedora-remove-grub pre-install.d/00-usr-local-bin-secure-path pre-install.d/02-lsb root.d/10-fedora-cloud-image README.md element-deps source-repository-fedoradib-run-parts
[default] command=os-refresh-config [cfn] metadata_url=http://192.0.2.99:8000/v1/ access_key_id = ABCDEFGHIJLMNOP01234567890 secret_access_key = 01234567890ABCDEFGHIJKLMNOP path = MyResource stack_name = my.stack
resources:
wordpress_instance:
type: OS::Nova::Server
properties:
image: { get_param: image_id }
...
metadata:
key: value
converts JSON file to service config
{"keystone": {"database": {"host": "127.0.0.1",
"user": "keystone",
"password": "foobar"}}}
[sql] connection = mysql://keystone:foobar@127.0.0.1/keystone
[database]
connection={{tuskar.db}}
[heat_keystone]
username = {{tuskar.user}}
tenant_name = {{tuskar.tenant_name}}
password = {{tuskar.password}}
auth_url = http://{{keystone.host}}:35357/v2.0
install.d/nova-source-install/74-nova os-apply-config/etc/nova/nova.conf os-refresh-config/configure.d/10-nova-state pre-install.d/00-disable-requiretty README.md element-deps source-repository-nova
setup-seed-vm -a $NODE_ARCH
$TRIPLEO_ROOT/diskimage-builder/bin/ramdisk-image-create \
-a $NODE_ARCH $NODE_DIST $DEPLOY_IMAGE_ELEMENT \
-o $TRIPLEO_ROOT/deploy-ramdisk
boot-seed-vm -a $NODE_ARCH $NODE_DIST neutron-dhcp-agent
init-keystone -p unset unset 192.0.2.1 admin@example.com root@192.0.2.1
setup-endpoints 192.0.2.1 --glance-password unset
--heat-password unset
--neutron-password unset
--nova-password unset
$TRIPLEO_ROOT/diskimage-builder/bin/disk-image-create $NODE_DIST
-a $NODE_ARCH -o $TRIPLEO_ROOT/undercloud
boot-stack nova-baremetal os-collect-config dhcp-all-interfaces
neutron-dhcp-agent
UNDERCLOUD_ID=$(load-image $TRIPLEO_ROOT/undercloud.qcow2)
make -C $TRIPLEO_ROOT/tripleo-heat-templates undercloud-vm.yaml
heat stack-create
-f $TRIPLEO_ROOT/tripleo-heat-templates/undercloud-vm.yaml
-P "PowerUserName=$(whoami);AdminToken=${UNDERCLOUD_ADMIN_TOKEN};
AdminPassword=${UNDERCLOUD_ADMIN_PASSWORD};
GlancePassword=${UNDERCLOUD_GLANCE_PASSWORD};
HeatPassword=${UNDERCLOUD_HEAT_PASSWORD};
NeutronPassword=${UNDERCLOUD_NEUTRON_PASSWORD};
NovaPassword=${UNDERCLOUD_NOVA_PASSWORD};
BaremetalArch=${NODE_ARCH};
PowerManager=$POWER_MANAGER;
undercloudImage=${UNDERCLOUD_ID}"
undercloud
init-keystone -p $UNDERCLOUD_ADMIN_PASSWORD $UNDERCLOUD_ADMIN_TOKEN
$UNDERCLOUD_IP admin@example.com heat-admin@$UNDERCLOUD_IP
setup-endpoints $UNDERCLOUD_IP
--glance-password $UNDERCLOUD_GLANCE_PASSWORD
--heat-password $UNDERCLOUD_HEAT_PASSWORD
--neutron-password $UNDERCLOUD_NEUTRON_PASSWORD
--nova-password $UNDERCLOUD_NOVA_PASSWORD
$TRIPLEO_ROOT/diskimage-builder/bin/disk-image-create $NODE_DIST
-a $NODE_ARCH -o $TRIPLEO_ROOT/overcloud-control
boot-stack cinder-api cinder-volume os-collect-config
neutron-network-node dhcp-all-interfaces swift-proxy swift-storage
OVERCLOUD_CONTROL_ID=$(load-image -d $TRIPLEO_ROOT/overcloud-control.qcow2)
$TRIPLEO_ROOT/diskimage-builder/bin/disk-image-create $NODE_DIST \
-a $NODE_ARCH -o $TRIPLEO_ROOT/overcloud-compute \
nova-compute nova-kvm neutron-openvswitch-agent os-collect-config \
dhcp-all-interfaces
OVERCLOUD_COMPUTE_ID=$(load-image -d $TRIPLEO_ROOT/overcloud-compute.qcow2)
make -C $TRIPLEO_ROOT/tripleo-heat-templates overcloud.yaml
heat stack-create -f $TRIPLEO_ROOT/tripleo-heat-templates/overcloud.yaml
-P "AdminToken=${OVERCLOUD_ADMIN_TOKEN};
AdminPassword=${OVERCLOUD_ADMIN_PASSWORD};
CinderPassword=${OVERCLOUD_CINDER_PASSWORD};
GlancePassword=${OVERCLOUD_GLANCE_PASSWORD};
HeatPassword=${OVERCLOUD_HEAT_PASSWORD};
NeutronPassword=${OVERCLOUD_NEUTRON_PASSWORD};
NovaPassword=${OVERCLOUD_NOVA_PASSWORD};
NeutronPublicInterface=${NeutronPublicInterface};
SwiftPassword=${OVERCLOUD_SWIFT_PASSWORD};
SwiftHashSuffix=${OVERCLOUD_SWIFT_HASH}${OVERCLOUD_LIBVIRT_TYPE};
SSLCertificate=${OVERCLOUD_SSL_CERT};SSLKey=${OVERCLOUD_SSL_KEY}"
overcloud
init-keystone -p $OVERCLOUD_ADMIN_PASSWORD $OVERCLOUD_ADMIN_TOKEN
$OVERCLOUD_IP admin@example.com heat-admin@$OVERCLOUD_IP
${SSLBASE:+--ssl $PUBLIC_API_URL}
setup-endpoints $OVERCLOUD_IP --cinder-password $OVERCLOUD_CINDER_PASSWORD
--glance-password $OVERCLOUD_GLANCE_PASSWORD
--heat-password $OVERCLOUD_HEAT_PASSWORD
--neutron-password $OVERCLOUD_NEUTRON_PASSWORD
--nova-password $OVERCLOUD_NOVA_PASSWORD
--swift-password $OVERCLOUD_SWIFT_PASSWORD
${SSLBASE:+--ssl $PUBLIC_API_URL}
Then we are prepared to deploy any service on the separate baremetals, that can be easily scaled, e.g. Neutron, Ceilometer, Ironic, etc....
In future we will allow to provision multiple images on one machine with Docker.