From 289457e6253dda44cf400341aae7520dbdea80c0 Mon Sep 17 00:00:00 2001 From: "Simental Magana, Marcos" Date: Tue, 28 Jun 2016 14:50:12 -0500 Subject: [PATCH 1/2] Add ciao-deploy using ansible page --- source/ciao-deploy.rst | 180 +++++++++++++++++++++++++++++++++++++++++ source/index_gs.rst | 1 + 2 files changed, 181 insertions(+) create mode 100644 source/ciao-deploy.rst diff --git a/source/ciao-deploy.rst b/source/ciao-deploy.rst new file mode 100644 index 00000000..6b1ac9b9 --- /dev/null +++ b/source/ciao-deploy.rst @@ -0,0 +1,180 @@ +.. _ciao-deploy: + +.. contents:: + +CIAO in ClearLinux +################## + +Cloud Integrated Advanced Orchestrator (ciao) is a new workload scheduler +designed to address limitations in current cloud OS projects. +Ciao provides a lightweight, fully TLS-based, minimal Config, workload-agnostic, +easily updateable, optimized-for-speed scheduler, currently optimized for Openstack. + +For more information visit https://clearlinux.org/ciao. + +Environment +=========== +For this example, we'll use a total of three nodes: + - A `controller `_ node which will be used to communicate with Keystone. + - A `compute node `_ which will spawn the VM's and containers. + + - A `network node `_ which will handle the netowrking for the workloads. + +Prerequisites +============= +Ansible uses ssh to run commands on the remote servers. In order to do that, the servers +must be configured to allow passwordless ssh connections from the root user. Follow these +steps to configure your nodes. + +#. Generate ssh keys:: + + # ssh-keygen + +#. Enable root login:: + + # echo "PermitRootLogin yes" >> /etc/ssh/sshd_config + +#. Enable sshd service:: + + # systemctl enable sshd + # systemctl start sshd + +#. Allow passwordless login:: + + # ssh-copy-id -i root@node + +Install the software +==================== + +Install the ``sysadmin-hostmgmt`` bundle on the development node. This bundle contains +the Ansible software required to run the playbooks, as well as some Ansible roles and +sample playbooks that you can use to build your own:: + + # swupd bundle-add sysadmin-hostmgmt + +Create the playbook +=================== + +The ``sysadmin-hostmgmt`` bundle includes some sample playbooks that you may use and +customize for your own needs. Start by making a copy of the sample playbook into your +home folder:: + + # cp -r /usr/share/ansible/examples/ciao ~/ + +The playbook consist of three files that you should modify to fit your needs:: + + ciao/ + |-- ciao.yml + |-- group_vars + | `-- all + +-- hosts + +The hosts file contains the IP addresses/hostnames of your servers grouped under the roles +they will serve. For this example it should look like this:: + + [dbservers] + ciao-controller.example.com + + [openstack_identity] + ciao-controller.example.com + + [openstack_image] + ciao-controller.example.com + + [ciao_controller] + ciao-controller.example.com + + [ciao_network] + ciao-network.example.com + + [ciao_compute] + ciao-compute.example.com + +This ``groups_var/all`` file contains variables that will applied for your ciao setup. +The mandatory variables are already there; be sure to change the values accordingly to +fit your environment. It should look something like this:: + + --- + database_root_password: secret + + glance_fqdn: ciao-controller.example.com + glance_user_password: secret + glance_database_password: secret + + ciao_controller_ip: 172.17.0.6 + ciao_mgmt_subnet: 172.17.0.0/24 + ciao_compute_subnet: "{{ciao_mgmt_subnet}}" + ciao_csr_password: secret + ciao_ssh_public_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDhn1BIdDv2Rpx6qhYt9Z+3eOg1JIGyt6E0as3J02ymXsN2Zc4s+XXcj0tkifgZmKmm1H4dt1bVMcWcODl8qP6hjRVjSdo7KW8vXYkQv7eXNnhO+4vCttI6UsaB8LDdv6/TRGaRjj66shAC70ySH77/COAHnzTJdSWvzEVBs4hO8rii6MmyDduQhZM14JpCFP2zkZ1ICNcPjf60a4vi2GiW8PWlJwrUuzsa5qfWCExA98UD04lg+mwFCYBfgQeQcXKN+eQqV6XQ8ujE/++pLSjsSSK1/cXCkWtMGJGTgjY5zH20tfIbJPnBeOIlYvWjJDNFvCC5b9UspTLlhnggGhZ root@ciao-controller.example.com + ciao_admin_email: admin@ciao-controller.example.com + ciao_cert_organization: Example, Inc. + + keystone_fqdn: ciao-controller.example.com + keystone_root_domain: ciao-controller.example.com + keystone_p12password: secret + keystone_database_password: secret + keystone_admin_password: secret + keystone_services: + - service_name: "ciao" + service_type: "compute" + keystone_projects: + - project_name: "demo" + keystone_users: + - user_name: "csr" + password: "{{ciao_csr_password}}" + project_name: "admin" + - user_name: "demo" + password: "secret" + project_name: "demo" + keystone_roles: + - demo + keystone_user_roles: + - user_name: csr + project_name: service + role_name: admin + - user_name: demo + project_name: demo + role_name: demo + +A full list of available variables can be found under +``/usr/share/ansible/roles//defaults/main.yml`` + +Run the playbook +================ +Once you have your variables and hosts file configured, the deployment can be fired +with the following command:: + + # ansible-playbook -i hosts ciao.yml + +Verify +====== +Once ansible is done with the setup, on the controller node you can verify the +cluster is ready by running the following command. +Change the username, password, controller and identity values to match +your setup as specified in the ``groups_var/all`` file:: + + # ciao-cli -identity=https://ciao-controller.example.com:35357 -username admin -password secret -controller=ciao-controller.example.com node status + Total Nodes 2 + Ready 2 + Full 0 + Offline 0 + Maintenance 0 + +You could also create a ciaorc file that contains the following environment +variables:: + + # cat ciaorc + export CIAO_CONTROLLER=ciao-controller.example.com + export CIAO_IDENTITY=https://ciao-controller.example.com:35357 + export CIAO_USERNAME=admin + export CIAO_PASSWORD=secure + +then you could verify with the following command:: + + # source ciaorc + # ciao-cli node status + Total Nodes 2 + Ready 2 + Full 0 + Offline 0 + Maintenance 0 diff --git a/source/index_gs.rst b/source/index_gs.rst index ec5c1b2f..97212662 100644 --- a/source/index_gs.rst +++ b/source/index_gs.rst @@ -10,5 +10,6 @@ Getting started gs_installing_clr_as_host gs-clear-containers-gettting-started ciao-cluster-setup + ciao-deploy From 6833466c6f66036c17cdd36c9ecaddb06884d960 Mon Sep 17 00:00:00 2001 From: "Simental Magana, Marcos" Date: Fri, 1 Jul 2016 15:51:38 -0500 Subject: [PATCH 2/2] change wording: to --- source/ciao-deploy.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/ciao-deploy.rst b/source/ciao-deploy.rst index 6b1ac9b9..369f70cd 100644 --- a/source/ciao-deploy.rst +++ b/source/ciao-deploy.rst @@ -22,7 +22,7 @@ For this example, we'll use a total of three nodes: Prerequisites ============= -Ansible uses ssh to run commands on the remote servers. In order to do that, the servers +Ansible uses ssh to run commands on the remote nodes. In order to do that, the nodes must be configured to allow passwordless ssh connections from the root user. Follow these steps to configure your nodes. @@ -69,7 +69,7 @@ The playbook consist of three files that you should modify to fit your needs:: | `-- all +-- hosts -The hosts file contains the IP addresses/hostnames of your servers grouped under the roles +The hosts file contains the IP addresses/hostnames of your nodes grouped under the roles they will serve. For this example it should look like this:: [dbservers]