{"id":487,"date":"2017-03-29T21:44:03","date_gmt":"2017-03-29T14:44:03","guid":{"rendered":"http:\/\/www.rickyadams.com\/wp\/?p=487"},"modified":"2017-03-29T21:44:30","modified_gmt":"2017-03-29T14:44:30","slug":"deploying-an-openstack-cloud-with-juju","status":"publish","type":"post","link":"https:\/\/www.rickyadams.com\/wp\/deploying-an-openstack-cloud-with-juju\/","title":{"rendered":"Deploying an OpenStack Cloud with Juju"},"content":{"rendered":"<h3>Scope<\/h3>\n<p>The OpenStack platform is powerful and its uses diverse. This section of documentation is primarily concerned with deploying a &#8220;standard&#8221; running OpenStack system using, but not limited to, Canonical components such as MAAS, Juju and Ubuntu. Where appropriate other methods and software will be mentioned.<\/p>\n<h3>Assumptions<\/h3>\n<ol>\n<li><a href=\"http:\/\/askubuntu.com\/questions\/476371\/how-do-i-use-maas-to-install-openstack\">Use of MAAS<\/a> &#8211; follow these intructions first.<\/li>\n<li>Use of Juju<\/li>\n<li>Local network configuration &#8211; This document assumes that you have an adequate local network configuration, including separate interfaces for access to the OpenStack cloud. Ideal networks are laid out in the [MAAS][MAAS documentation for OpenStack].<\/li>\n<\/ol>\n<h2>Planning an installation<\/h2>\n<p>Before deploying any services, it is very useful to take stock of the resources available and how they are to be used. OpenStack comprises of a number of interrelated services (Nova, Swift, etc) which each have differing demands in terms of hosts. For example, the Swift service, which provides object storage, has a different requirement than the Nova service, which provides compute resources.<\/p>\n<p>The minimum requirements for each service and recommendations are laid out in the official <a href=\"http:\/\/docs.openstack.org\/trunk\/openstack-ops\/content\/\" rel=\"nofollow noreferrer\">OpenStack Operations Guide<\/a><\/p>\n<p>The recommended composition of nodes for deploying OpenStack with MAAS and Juju is that all nodes in the system should be capable of running <em>ANY<\/em> of the services. This is best practice for the robustness of the system, as since any physical node should fail, another can be repurposed to take its place. This obviously extends to any hardware requirements such as extra network interfaces.<\/p>\n<p>If for reasons of economy or otherwise you choose to use different configurations of hardware, you should note that your ability to overcome hardware failure will be reduced. It will also be necessary to target deployments to specific nodes &#8211; see the section in the <a href=\"http:\/\/maas.ubuntu.com\/docs\/tags.html\" rel=\"nofollow noreferrer\">MAAS documentation on tags<\/a>.<\/p>\n<h3>Create the OpenStack configuration file<\/h3>\n<p>We will be using Juju charms to deploy the component parts of OpenStack. Each charm encapsulates everything required to set up a particular service. However, the individual services have many configuration options, some of which we will want to change.<\/p>\n<p>To make this task easier and more reproduceable, we will create a separate configuration file with the relevant options for all the services. This is written in a standard YAML format (<a href=\"http:\/\/www.yaml.org\/\" rel=\"nofollow noreferrer\">see www.yaml.org if this is unfamiliar to you<\/a>).<\/p>\n<p>Here is an example of an openstack-config.yaml:<\/p>\n<pre><code>keystone:\r\n  admin-password: openstack\r\n  debug: 'true'\r\n  log-level: DEBUG\r\nnova-cloud-controller:\r\n  network-manager: 'Neutron'\r\n  quantum-security-groups: 'yes'\r\n  neutron-external-network: Public_Network\r\nnova-compute:\r\n  enable-live-migration: 'True'\r\n  migration-auth-type: \"none\"\r\n  virt-type: kvm\r\n  #virt-type: lxc\r\n  enable-resize: 'True'\r\nquantum-gateway:\r\n  ext-port: 'eth1'\r\n  plugin: ovs\r\nglance:\r\n  ceph-osd-replication-count: 3\r\ncinder:\r\n  block-device: None\r\n  ceph-osd-replication-count: 3\r\n  overwrite: \"true\"\r\n  glance-api-version: 2\r\nceph:\r\n  fsid: a51ce9ea-35cd-4639-9b5e-668625d3c1d8\r\n  monitor-secret: AQCk5+dR6NRDMRAAKUd3B8SdAD7jLJ5nbzxXXA==\r\n  osd-devices: \/dev\/sdb\r\n  osd-reformat: 'True'\r\n<\/code><\/pre>\n<p>For all services, we can configure the <code>openstack-origin<\/code> to point to an install source. In this case, we will rely on the default, which will point to the relevant sources for the Ubuntu 14.04 LTS Trusty release. Further configuration for each service is explained in <a href=\"http:\/\/www.ubuntu.com\/download\/cloud\/install-openstack-with-autopilot\" rel=\"nofollow noreferrer\">this document<\/a>.<\/p>\n<h3>Other configurations<\/h3>\n<p>Other settings and configuration options are possible for deployment of the OpenStack services. These are detailed in the documentation of the individual charms used by Juju, and can be inspected by visiting the <a href=\"http:\/\/jujucharms.com\" rel=\"nofollow noreferrer\">online Juju Charm Store<\/a> and searching for the charm using the search box in the top left-hand-side of the page. the configuration settings are then detailed under &#8220;Configuration&#8221; in the main page, as shown:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/i.stack.imgur.com\/DDbGu.png\" alt=\"enter image description here\" \/><\/p>\n<h2>Deploying OpenStack with Juju<\/h2>\n<p>Now that the configuration is defined, we can use Juju to deploy and relate the services.<\/p>\n<h3>Initialising Juju<\/h3>\n<p>Juju requires a minimal amount of setup. Here we assume it has already been configured to work with your MAAS cluster (see the [Juju Install Guide][juju_install] for more information on this.<\/p>\n<p>Firstly, we need to fetch images and tools that Juju will use:<\/p>\n<pre><code>juju sync-tools --debug\r\n<\/code><\/pre>\n<p>Then we can create the bootstrap instance:<\/p>\n<pre><code>juju bootstrap --upload-tools --debug\r\n<\/code><\/pre>\n<p>We use the upload-tools switch to use the local versions of the tools which we just fetched. The debug switch will give verbose output which can be useful. This process may take a few minutes, as Juju is creating an instance and installing the tools. When it has finished, you can check the status of the system with the command:<\/p>\n<pre><code>juju status\r\n<\/code><\/pre>\n<p>This should return something like:<\/p>\n<pre><code>environment: maas\r\nmachines:\r\n  \"0\":\r\n    agent-state: started\r\n    agent-version: 1.18.1.1\r\n    dns-name: localhost\r\n    instance-id: localhost\r\n    series: trusty\r\n<\/code><\/pre>\n<h3>Deploy the OpenStack Charms<\/h3>\n<p>Now that the Juju bootstrap node is up and running we can deploy the services required to make our OpenStack installation. To configure these services properly as they are deployed, we will make use of the configuration file we defined earlier, by passing it along with the <code>--config<\/code> switch with each deploy command. Substitute in the name and path of your config file if different.<\/p>\n<p>It is useful but not essential to deploy the services in the order below. It is also highly reccommended to open an additional terminal window and run the command <code>juju debug-log<\/code>. This will output the logs of all the services as they run, and can be useful for troubleshooting.<\/p>\n<p>It is also recommended to run a <code>juju status<\/code> command periodically, to check that each service has been installed and is running properly. Juju will automatically try to fetch the best possible version of the charm from online Charm Store. If you are installing from within a restricted or closed network, it is possible to pre-fetch the required charms. See [the documentation for offline charms][charms-offline].<\/p>\n<pre><code>juju deploy --to=0 juju-gui\r\njuju deploy rabbitmq-server\r\njuju deploy mysql\r\njuju deploy --config openstack-config.yaml openstack-dashboard\r\njuju deploy --config openstack-config.yaml keystone\r\njuju deploy --config openstack-config.yaml ceph -n 3 \r\njuju deploy --config openstack-config.yaml nova-compute -n 3\r\njuju deploy --config openstack-config.yaml quantum-gateway\r\njuju deploy --config openstack-config.yaml cinder\r\njuju deploy --config openstack-config.yaml nova-cloud-controller\r\njuju deploy --config openstack-config.yaml glance\r\njuju deploy --config openstack-config.yaml ceph-radosgw\r\n<\/code><\/pre>\n<h3>Add relations between the OpenStack services<\/h3>\n<p>Although the services are now deployed, they are not yet connected together. Each service currently exists in isolation. We use the <code>juju add-relation<\/code> command to make them aware of each other and set up any relevant connections and protocols. This extra configuration is taken care of by the individual charms themselves.<\/p>\n<p>We should start adding relations between charms by setting up the Keystone authorization service and its database, as this will be needed by many of the other connections:<\/p>\n<pre><code>juju add-relation keystone mysql\r\n<\/code><\/pre>\n<p>We wait until the relation is set. After it finishes check it with juju status:<\/p>\n<pre><code>juju status mysql\r\njuju status keystone\r\n<\/code><\/pre>\n<p>It can take a few moments for this service to settle. Although it is certainly possible to continue adding relations (Juju manages a queue for pending actions) it can be counterproductive in terms of the overall time taken, as many of the relations refer to the same services.<\/p>\n<p>The following relations also need to be made:<\/p>\n<pre><code>juju add-relation nova-cloud-controller mysql\r\njuju add-relation nova-cloud-controller rabbitmq-server\r\njuju add-relation nova-cloud-controller glance\r\njuju add-relation nova-cloud-controller keystone\r\njuju add-relation nova-compute mysql\r\njuju add-relation nova-compute rabbitmq-server\r\njuju add-relation nova-compute glance\r\njuju add-relation nova-compute nova-cloud-controller\r\njuju add-relation glance mysql\r\njuju add-relation glance keystone\r\njuju add-relation cinder keystone\r\njuju add-relation cinder mysql\r\njuju add-relation cinder rabbitmq-server\r\njuju add-relation cinder nova-cloud-controller\r\njuju add-relation openstack-dashboard keystone\r\njuju add-relation swift-proxy swift-storage\r\njuju add-relation swift-proxy keystone\r\n<\/code><\/pre>\n<p>Finally, the output of juju status should show the all the relations as complete. The OpenStack cloud is now running, but it needs to be populated with some additional components before it is ready for use.<\/p>\n<p>&nbsp;<\/p>\n<p>SOURCE: http:\/\/askubuntu.com\/questions\/78314\/how-do-i-deploy-an-openstack-cloud-with-juju<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Scope The OpenStack platform is powerful and its uses diverse. This section of documentation is primarily concerned with deploying a &#8220;standard&#8221; running OpenStack system using, but not limited to, Canonical components such as MAAS, Juju and Ubuntu. Where appropriate other methods and software will be mentioned. Assumptions Use of MAAS &#8211; follow these intructions first. Use of Juju Local network configuration &#8211; This document assumes that you have an adequate local network configuration, including separate interfaces for access to the&#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"https:\/\/www.rickyadams.com\/wp\/deploying-an-openstack-cloud-with-juju\/\"> Read More<span class=\"screen-reader-text\">  Read More<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,3],"tags":[],"class_list":["post-487","post","type-post","status-publish","format-standard","hentry","category-openstack","category-virtualization"],"_links":{"self":[{"href":"https:\/\/www.rickyadams.com\/wp\/wp-json\/wp\/v2\/posts\/487","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rickyadams.com\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rickyadams.com\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rickyadams.com\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rickyadams.com\/wp\/wp-json\/wp\/v2\/comments?post=487"}],"version-history":[{"count":2,"href":"https:\/\/www.rickyadams.com\/wp\/wp-json\/wp\/v2\/posts\/487\/revisions"}],"predecessor-version":[{"id":489,"href":"https:\/\/www.rickyadams.com\/wp\/wp-json\/wp\/v2\/posts\/487\/revisions\/489"}],"wp:attachment":[{"href":"https:\/\/www.rickyadams.com\/wp\/wp-json\/wp\/v2\/media?parent=487"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rickyadams.com\/wp\/wp-json\/wp\/v2\/categories?post=487"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rickyadams.com\/wp\/wp-json\/wp\/v2\/tags?post=487"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}