adding change by carlos how to access ciao workload

Signed-off-by: Leona <leonax.cook@intel.com>
This commit is contained in:
Leona
2016-07-14 13:02:21 -07:00
parent 0af1ae7902
commit 4ac4ca18f5
+79 -86
View File
@@ -2,8 +2,8 @@
.. contents::
Getting started with ciao
#########################
ciao cluster setup
##################
This topic explains how to set up a cluster of machines running Clear Linux* OS
for Intel® Architecture with :abbr:`Cloud Integrated Advanced Orchestrator (CIAO)`, or ciao.
@@ -22,7 +22,7 @@ You'll need at least four machines and a switch connecting them to form
your beginning ciao cluster. The switch is assumed to be plugged directly
into an "upstream" network running a DHCP server. See the illustration below as an example:
.. image:: _static/images/image-blob-ciao-networking.png
.. image:: image-blob-ciao-networking.png
The following examples assume you have four nodes on a ``192.168.0.0/16`` network:
@@ -37,21 +37,21 @@ Network node ("nn")
~~~~~~~~~~~~~~~~~~~
* IP ``192.168.0.102``
* Runs Launcher
* Runs Launcher with ``--network=nn`` option
* Has CNCI image in ``/var/lib/ciao/images``. See below for more on CNCI image preparation.
Compute node 1 ("cn1")
~~~~~~~~~~~~~~~~~~~~~~
* IP ``192.168.0.103``
* Runs Launcher
* Runs Launcher with ``--network=cn`` option
* Has workload images in ``/var/lib/ciao/images``
Compute node 2 ("cn2")
~~~~~~~~~~~~~~~~~~~~~~
* ``IP 192.168.0.104``
* Runs Launcher
* Runs Launcher with ``--network=cn option``
* Has workload images in ``/var/lib/ciao/images``
@@ -75,13 +75,13 @@ OS on all nodes by following the instructions in the topic
`downloadable installer images`_ are compatible with ciao.
After the base installation on each node add the following additional
bundle, which adds components needed by ciao::
bundle, which adds components needed by CIAO::
$ swupd bundle-add cloud-control
Build the ciao software
Build the CIAO software
-----------------------
Ciao is written in the Go programming language. It requires Go 1.6 to
@@ -95,10 +95,10 @@ present, use the ``go get`` tool to fetch and build ciao and its go
dependencies::
$ cd $GOPATH/src
$ go get -v -u github.com/01org/ciao/...
$ go get -v -u github.com/01org/ciao
The binaries will install to ``$GOPATH/bin``. You should have
``ciao-cli``, ``ciao-cert``, ``ciao-cnci-agent``, ``ciao-launcher``,
``ciao-cli``, ``ciao-cert``, ``cnci_agent``, ``ciao-launcher``,
``ciao-controller``, and ``ciao-scheduler``.
Build certificates
@@ -117,7 +117,7 @@ SSNTP server, and connecting clients will validate credentials matched by
those embedded in the certificates.
Create unique certificates for each of your scheduler, compute node, network
node launchers, cnci agent, controller, and the CNCI launcher; save each with a
node launchers, cnciagent, controller, and the CNCI launcher; save each with a
unique name. The names, locations, and contents (signer and role) of the
certificates are very important. The rest of this topic will consistently use
the following example filenames:
@@ -146,10 +146,9 @@ the `Starting a workload` section.
Keystone node
-------------
You need to run a Keystone service. General documentation on
`installing Keystone`_ and
`setting up Keystone`_ services can be found at the OpenStack developer website.
Once your Keystone is running, we need a few configuration points. For example:::
You need to run a Keystone service. General documentation on setting
up Keystone services can be found at the `OpenStack developer`_ website.
We need a few configuration points. For example:::
$ openstack service create --name ciao compute
$ openstack user create --password hello csr
@@ -168,35 +167,6 @@ The controller node will host your controller and scheduler. Certificates are as
to be in ``/etc/pki/ciao``, generated with the correct roles and names
as previously described.
Cluster Configuration
~~~~~~~~~~~~~~~~~~~~~
Ciao's cluster configuration is stored and fetched from a cluster specific storage backend.
Supported backends are plain **local file**, **etcd** [WIP] and **ZooKeeper** [WIP].
For more details about Cluster Configuration Architecture: `CIAO Configuration Architecture`_
- Local File backend
- Create the ``/etc/ciao/configuration.yaml`` file. Example::
configure:
scheduler:
storage_uri: /etc/ciao/configuration.yaml
controller:
compute_ca: /etc/pki/ciao/compute_ca.pem
compute_cert: /etc/pki/ciao/compute_key.pem
identity_user: controller
identity_password: ciao
launcher:
compute_net: 192.168.1.110
mgmt_net: 192.168.1.111
image_service:
url: http://glance.example.com
identity_service:
url: http://keystone.example.com
- More examples at: `CIAO Configuration examples`_
Scheduler
~~~~~~~~~
@@ -269,9 +239,12 @@ images with which you wish to test.
Start the compute node launcher
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The launcher is run with options for declaring certificates. For example::
The launcher is run with options declaring certificates, maximum VMs
(controls when FULL is returned by a node, scaling to the resources
available on your node), server location, and compute node ("cn")
launching type. For example::
$ sudo ./ciao-launcher --cacert=/etc/pki/ciao/CAcert-[scheduler-node-hostname].pem --cert=/etc/pki/ciao/cert-CNAgent-localhost.pem
$ sudo ./launcher --cacert=/etc/pki/ciao/CAcert-[scheduler-node-hostname].pem --cert=/etc/pki/ciao/cert-CNAgent-localhost.pem --server=<your-server-address> --network=cn --compute-net <node compute subnet> --mgmt-net <node management subnet>
Optionally, add ``-logtostderr`` (more verbose with also ``-v=2``) to get
console logging output.
@@ -296,17 +269,19 @@ This section describes how to generate a CNCI image from a vanilla
Clear Cloud qcow2 image::
$ cd /var/lib/ciao/images
$ curl -O https://download.clearlinux.org/demos/ciao/clear-8260-ciao-networking.img.xz
$ xz -T0 --decompress clear-8260-ciao-networking.img.xz
$ ln -s clear-8260-ciao-networking.img 4e16e743-265a-4bf2-9fd1-57ada0b28904
$ $GOPATH/src/github.com/01org/ciao/networking/ciao-cnci-agent/scripts/update_cnci_cloud_image.sh /var/lib/ciao/images/clear-8260-ciao-networking.img /etc/pki/ciao/
$ curl -O https://download.clearlinux.org/demos/ciao/clear-7470-ciao-networking.img.xz
$ xz -T0 --decompress clear-7470-ciao-networking.img.xz
$ ln -s clear-7470-ciao-networking.img 4e16e743-265a-4bf2-9fd1-57ada0b28904
$ $GOPATH/src/github.com/01org/ciao/networking/cnci_agent/scripts/update_cnci_cloud_image.sh /var/lib/ciao/images/clear-7470-ciao-networking.img /etc/pki/ciao/
Start the network node launcher
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The network node's launcher is run similarly to the compute node's launcher::
The network node's launcher is run similarly to the compute node's launcher.
The primary difference is that it uses the network node ("nn") launching
type::
$ sudo ./ciao-launcher --cacert=/etc/pki/ciao/CAcert-[scheduler-node-hostname].pem --cert=/etc/pki/ciao/cert-NetworkingAgent-localhost.pem
$ sudo ./ciao-launcher --cacert=/etc/pki/ciao/CAcert-[scheduler-node-hostname].pem --cert=/etc/pki/ciao/cert-NetworkingAgent-localhost.pem --server=<your-server-address> --network=nn --compute-net <network node compute subnet> --mgmt-net <network node management subnet>
Start the controller
--------------------
@@ -320,20 +295,14 @@ and network node already up and running together.**
the correct roles and names as previously described.
#. Copy in the initial database table data from the ciao-controller source
(``$GOPATH/src/github.com/01org/ciao/ciao-controller/tables`` on your
build/development) to ``./tables`` in the same directory as the
ciao-controller binary. Copying in ``*.csv`` will work if you are testing
a Clear Cloud image, Fedora image and Docker. Other images will require
edits to the csv config files. This location is the default, but can be
changed by modifying the controller command line to include
``--tables_init_path=<your tables path>``.
(``$GOPATH/src/github.com/01org/ciao/ciao-controller`` on your
build/development) to the same directory as the ciao-controller binary.
Copying in ``*.csv`` will work if you are testing a Clear Cloud image,
Fedora image and Docker. Other images will require edits to the csv
config files.
#. Copy in the test workload definitions from
``$GOPATH/src/github.com/01org/ciao/ciao-controller/workloads`` on your
build/development machine to ``./workloads`` in the same directory as the
ciao-controller binary. This location is the default, but can be changed
by modifying the controller command line to include
``--workloads_path=<your workloads path>``.
#. Copy in the test.yaml file from
``$GOPATH/src/github.com/01org/ciao/ciao-controller/test.yaml``.
The `ciao-controller workload_resources.csv`_ and the
`ciao-controller workload_template.csv`_ have four stanzas, so yours
@@ -343,6 +312,10 @@ CNCI). To run other images of your choosing, follow a process similar to
the above: pre-populate OS images and edit each of these two files on
your controller node.
If the controller is on the same physical machine as the scheduler, the
``--url`` option is optional; otherwise it refers to your scheduler
SSNTP server IP.
In order for the ciao-controller's go code to correctly use the CA
certificate(s) generated earlier when you built your keystone server,
this certificate needs to be installed in the control node and be
@@ -367,7 +340,7 @@ name of the system that is hosting the keystone service**.
An SSL-enabled Keystone is required, with additional parameters
for ciao-controller pointing at its certificates::
$ sudo ./ciao-controller --cacert=/etc/pki/ciao/CAcert-[scheduler-node-hostname].pem --cert=/etc/pki/ciao/cert-Controller-localhost.pem
$ sudo ./ciao-controller --cacert=/etc/pki/ciao/CAcert-[scheduler-node-hostname].pem --cert=/etc/pki/ciao/cert-Controller-localhost.pem -identity=https://[keystone-FQDN]:35357 --username=<Ciao keystone service username> --password=<Ciao keystone service password> --url <scheduler-FQDN> --httpskey=./key.pem --httpscert=./cert.pem
Optionally add ``-logtostderr`` (more verbose with also ``-v=2``) to get
console logging output.
@@ -375,17 +348,17 @@ console logging output.
Use the `ciao-cli`_ command line tool to verify that your cluster is
now up and running::
$ ciao-cli -username admin -password <admin_password> node status
$ ciao-cli -username admin -password <admin_password> node list -compute
$ ciao-cli -username admin -password <admin_password> node list -cnci
$ ciao-cli -username admin -password <admin_password> -cluster-status
$ ciao-cli -username admin -password <admin_password> -list-cns
$ ciao-cli -username admin -password <admin_password> -list-cncis
``node status`` shows the number of nodes in your cluster, and the
``-cluster-status`` shows the number of nodes in your cluster, and the
status of each.
``node list -compute`` displays a more detailed view (number of instances per node,
``-list-cns`` displays a more detailed view (number of instances per node,
available resources per node, etc.).
``node list -cnci`` provides information about the current CNCI VMs, and their statuses.
``-list-cncis`` provides information about the current CNCI VMs, and their statuses.
Interacting with your cluster
=============================
@@ -441,36 +414,53 @@ As a valid user, the `ciao-cli`_ tool allows you to start a workload.
First, you may want to know which workloads are available::
$ ciao-cli workload list
$ ciao-cli -list-workloads
Then you can launch one or more workloads::
$ ciao-cli instance add -workload <workload UUID> -instances <number of instances to launch>
$ ciao-cli -launch-instances -workload <workload UUID> -instances <number of instances to launch>
And you can monitor all your instances statuses (``pending`` or ``running``)::
$ ciao-cli instance list
$ ciao-cli -list-instances
Performance data can be obtained (optionally) by adding a specific label
to all your instances::
$ ciao-cli instance add -label <instance-label> -workload <workload UUID> -instances <number of instances to launch>
$ ciao-cli -launch-instances -instance-label <instance-label> -workload <workload UUID> -instances <number of instances to launch>
And eventually fetch the performance data::
$ ciao-cli trace show <label>
$ ciao-cli -dump-label <instance-label>
You will also see activity related to this launch across your cluster
components if you have consoles open and logging to standard output as
described above.
Access your workload
====================
Before you can access a workload, you need to set a SSH key on your configuration before launch the workload, first create a pair of ssh keys and add the public key to you configuration file ciao-controller/workload/test.yml in the ssh-authorized-keys section
* ssh-authorized-keys:
- <your SSH key>
After this you can start/restart the ciao-controller and launch your workload, once your workload is up, you need to know it's IP address, you can find it via ciao-cli
$ ciao-cli instance list
then look for the section "SSH IP", there is the IP assigned to your workload, then access the workload using your private key and the user "demouser"
$ssh demouser@<workload_ip> -i </path/to/your/private-key>
Reset your cluster
==================
First you should delete all instances with the `ciao-cli`_ command line
tool::
$ ciao-cli instance delete -all
$ ciao-cli -delete-instance -all-instances
On your scheduler node, run the following command::
@@ -488,13 +478,19 @@ On the node running your keystone VM, run the following command::
On the network node, run the following commands::
$ sudo ./launcher --hard-reset
$ sudo ./launcher --cacert=/etc/pki/ciao/CAcert-[scheduler-node-hostname].pem --cert=/etc/pki/ciao/cert-NetworkingAgent-localhost.pem --server=<your-server-address> --network=nn --compute-net <node compute subnet> --mgmt-net <node management subnet> --hard-reset
$ sudo killall -9 qemu-system-x86_64
$ sudo rm -rf /var/lib/ciao/instances/
$ sudo reboot
If you were unable to successfully delete all workload VM instances
through the UI, then on each compute node run these commands::
$ sudo ./launcher --hard-reset
$ sudo ./launcher --cacert=/etc/pki/ciao/CAcert-[scheduler-node-hostname].pem --cert=/etc/pki/ciao/cert-CNAgent-localhost.pem --server=<your-server-address> --network=cn --compute-net <node compute subnet> --mgmt-net <node management subnet> --hard-reset
$ sudo killall -9 qemu-system-x86_64
$ sudo docker rm $(sudo docker ps -qa)
$ sudo docker network rm $(sudo docker network ls -q -f "type=custom")
$ sudo rm -rf /var/lib/ciao/instances/
$ sudo reboot
Restart your scheduler, network node launcher, compute node launcher,
@@ -540,13 +536,10 @@ testing.
.. _downloadable installer images: https://download.clearlinux.org/image
.. _downloadable cloud images: https://download.clearlinux.org/image
.. _Fedora 23 Cloud: https://download.fedoraproject.org/pub/fedora/linux/releases/23/Cloud/x86_64/Images/Fedora-Cloud-Base-23-20151030.x86_64.qcow2
.. _installing Keystone: http://docs.openstack.org/developer/keystone/installing.html
.. _setting up Keystone: http://docs.openstack.org/developer/keystone/setup.html
.. _Openstack developer: http://docs.openstack.org/developer/keystone/setup.html
.. _go: https://golang.org/doc/articles/go_command.html
.. _ciao-cert: https://github.com/01org/ciao/blob/master/ssntp/ciao-cert/README.md
.. _CNCI Agent: https://github.com/01org/ciao/tree/master/networking/ciao-cnci-agent
.. _CNCI Agent: https://github.com/01org/ciao/tree/master/networking/cnci_agent
.. _mailing list: https://lists.clearlinux.org/mailman/listinfo/ciao-devel
.. _ciao-cli: https://github.com/01org/ciao/tree/master/ciao-cli
.. _ciao-webui: https://github.com/01org/ciao-webui
.. _CIAO Configuration Architecture: https://github.com/01org/ciao/wiki/Configuration
.. _CIAO Configuration Examples: https://github.com/01org/ciao/tree/master/configuration#configuration-examples
.. _ciao-webui: https://github.com/01org/ciao-webui