Difference between pages "OpenStack Architecture" and "Gentoo Prefix On Mac OS X"

From Funtoo
(Difference between pages)
Jump to navigation Jump to search
 
 
Line 1: Line 1:
This page exists to document [http://www.openstack.org OpenStack] configuration.
There is a way to install Gentoo so that it runs within Mac OS X. This install method is called "Gentoo Prefix".


Note that the current approach is to use devstack, which is not a good way to learn OpenStack. So much of this document will be about doing a devstack-like configuration for Funtoo.
There is a handy script you can use to install Gentoo Prefix on any Mac OS X machine.  


This document will split OpenStack configuration into each architectural component, describing configuration steps for each component separately.
== Requirements ==


== SQL Database ==
For Gentoo Prefix installation to work, you must have the Xcode command-line tools installed, so that a compiler toolchain exists. Here are the steps to install the Xcode command-line tools:


A number of OpenStack services use a SQL back-end for storing various bits of data.
# Install Xcode itself from the Apple Mac OS X install media. If you are using Mac OS Lion, then the Apple App Store has Xcode available. Search for "Xcode" and you will be able to download and install it.
# Now, start Xcode.
# Go to the Xcode menu, then Preferences, then the Downloads tab.
# Click "Install" next to "Command Line Tools".
# You will need to log in with your Apple Developer ID for the download to continue.


While DevStack uses MySQL for its SQL deployment, multiple database back-ends are actually supported thanks to [http://sqlalchemy.org SQLAlchemy] being used behind the scenes, which is a re-targetable Python database API. Thus, it should be possible to use Postgres, etc, by simply using different connection strings. A list of SQLAlchemy connection types can be found on [http://docs.sqlalchemy.org/en/latest/core/engines.html this SQLAlchemy documentation page.]
Here's how you do it. As root (<tt>sudo su -</tt>), type:


Using a single root database user account for all services is not a good policy for production deployment. Ideally, each service should have its own restricted user account with only the ability to access its own database.
The <tt>EPREFIX</tt> variable controls the install location. The default is <tt>~/gentoo</tt>.
 
Let's look at how each service is configured in regards to SQL:
 
=== nova ===
 
Here's how to set up a MySQL database back-end for nova and tell nova to initialize its database tables:
 
<console>
mysql> ##i##create database nova character set latin1;
Query OK, 1 row affected (0.02 sec)
 
mysql> ##i##grant all privileges on nova.* to nova@localhost identified by 'foobar';
Query OK, 0 rows affected (0.00 sec)
</console>
 
Now set the following connection string in <tt>/etc/nova/nova.conf</tt>:
 
<pre>
--sql_connection=mysql://nova:foobar@localhost/nova
</pre>
 
Note the use of the latin1 character set when we created the tables in MySQL. This is so the following command will not cause an error due to the default UTF-8 character set creating indexes that are too big for MySQL to handle:


<console>
<console>
# ##i##nova-manage db sync
$ ##i##wget http://www.cs.stonybrook.edu/~ryao/prefix-install.sh && chmod u+x ./prefix-install.sh && env MAKEOPTS=-j5 ./prefix-install.sh
2012-03-02 21:31:14 DEBUG nova.utils [-] backend <module 'nova.db.sqlalchemy.migration' from '/usr/lib64/python2.7/site-packages/nova/db/sqlalchemy/migration.pyc'> from (pid=17779) __get_b
ackend /usr/lib64/python2.7/site-packages/nova/utils.py:602
</console>
</console>


After running the command above, you should now have all the relevant database tables created:
Bam!
 
<console>
xdev var # ##i##mysql -u root -p nova
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 16
Server version: 5.1.61-log Gentoo Linux mysql-5.1.61
 
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
 
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
 
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 
mysql> ##i##show tables;
+-------------------------------------+
| Tables_in_nova                      |
+-------------------------------------+
| agent_builds                        |
| aggregate_hosts                    |
| aggregate_metadata                  |
| aggregates                          |
| auth_tokens                        |
| block_device_mapping                |
| bw_usage_cache                      |
| certificates                        |
| compute_nodes                      |
| console_pools                      |
...
</console>
 
You have now validated that nova is connecting to your MySQL database correctly.
 
=== glance ===
 
From glance.openstack.org:
 
<blockquote>The Glance project provides services for discovering, registering, and retrieving virtual machine images. Glance has a RESTful API that allows querying of VM image metadata as well as retrieval of the actual image.</blockquote>
 
Glance typically uses a MySQL database called <tt>glance</tt>, although the name is configurable in the connection string.
 
SQL connection settings might be stored in a glance configuration file located at <tt>/opt/stack/glance/etc/glance-registry.conf</tt>. In the devstack installation process, <tt>/opt/stack/glance</tt> contains a git checkout of the glance software.
 
The SQL connection configuration string might look something like this:
 
<pre>
sql_connection = mysql://glance:yourpassword@192.168.206.130/glance
</pre>
 
More info on glance configuration is available [http://docs.openstack.org/diablo/openstack-compute/install/content/glance-registry-conf-file.html here].
 
=== keystone ===
 
Keystone, the OpenStack identity service, also uses SQL. <tt>etc/keystone.conf</tt> keystone install/git repo directory is used to store the SQL configuration:
 
<pre>
sql_connection = %SQL_CONN%
</pre>
 
As everything else, the SQL connection string uses SQLAlchemy syntax.
 
=== Quantum and Open VSwitch ===
 
<blockquote>Quantum is an incubated OpenStack project to provide "network connectivity as a service" between interface devices (e.g., vNICs) managed by other Openstack services (e.g., nova).</blockquote>
 
[http://openvswitch.org Open VSwitch] is described as:
 
<blockquote>Open vSwitch is a production quality, multilayer virtual switch licensed under the open source Apache 2.0 license. It is designed to enable massive network automation through programmatic extension, while still supporting standard management interfaces and protocols (e.g. NetFlow, sFlow, SPAN, RSPAN, CLI, LACP, 802.1ag). In addition, it is designed to support distribution across multiple physical servers similar to VMware's vNetwork distributed vswitch or Cisco's Nexus 1000V. </blockquote>
 
There is an [http://openvswitch.org/openstack/documentation/ Open VSwitch Plug-in for OpenStack Quantum] which can be set up by DevStack. This plug-in uses SQL storage. The SQLAlchemy connection string is stored in (relative to git/install root) <tt>etc/quantum/plugins/openvswitch/ovs_quantum_plugin.ini</tt>. Similarly to everything but nova, the SQL connection string is stored in <tt>sql_connection =</tt> format.
 
If the plugin is enabled, the following settings are added to nova.conf:
 
<pre>
--libvirt_vif_type=ethernet
--libvirt_vif_driver=nova.virt.libvirt.vif.LibvirtOpenVswitchDriver
--linuxnet_interface_driver=nova.network.linux_net.LinuxOVSInterfaceDriver
--quantum_use_dhcp
</pre>
 
=== Melange ===
 
From the Melange site:
 
<blockquote>
Melange is intended to provide network information services for use across OpenStack services. The initial focus will be on IP address management (IPAM) and address discovery (DHCP/dnsmasq) functionality. Melange is intended to be a standalone service with it's own API. However, the initial use case will be to decouple existing IP management and VM address discovery from Nova and support the existing Nova networking capabilities.
</blockquote>
 
Melange also uses a <tt>sql_connection =</tt> string stored in its <tt>etc/melange/melange.conf</tt> (relative to install/git root).
 
== RabbitMQ ==
 
RabbitMQ  is a reliable messaging framework used by OpenStack. Currently, it looks like only nova uses it. Nova is configured to connect to rabbitmq by setting the following lines in <tt>/etc/nova/nova.conf</tt>:
 
<pre>
--rabbit_host=$RABBIT_HOST
--rabbit_password=$RABBIT_PASSWORD
</pre>
 
Rabbit's password is configured using the following command, as root:
 
<console>
# ##i##rabbitmqctl change_password guest $RABBIT_PASSWORD
</console>
 
I am not yet completely sure how RabbitMQ fits into the OpenStack architecture. It may be that the supporting services expect it to be running locally, and that Nova compute nodes need to hook into a Nova instance, which would typically be running remotely. (Thus the ability for DevStack to target a remote RabbitMQ host.)
 
== Virtualization Technology ==
 
DevStack defaults to configuring OpenStack to use libvirt with [[KVM]], and will fall back to basic [[QEMU]] support if the <tt>kvm</tt> kernel module is not available. It also has support for using libvirt with [[LXC]], in addition to using [[Xen]] Server directly (bypassing libvirt.)
 


[[Category:Virtualization]]
Now, let's work on Funtoo Prefix :)
[[Category:OpenStack]]

Latest revision as of 09:19, December 28, 2014

There is a way to install Gentoo so that it runs within Mac OS X. This install method is called "Gentoo Prefix".

There is a handy script you can use to install Gentoo Prefix on any Mac OS X machine.

Requirements

For Gentoo Prefix installation to work, you must have the Xcode command-line tools installed, so that a compiler toolchain exists. Here are the steps to install the Xcode command-line tools:

  1. Install Xcode itself from the Apple Mac OS X install media. If you are using Mac OS Lion, then the Apple App Store has Xcode available. Search for "Xcode" and you will be able to download and install it.
  2. Now, start Xcode.
  3. Go to the Xcode menu, then Preferences, then the Downloads tab.
  4. Click "Install" next to "Command Line Tools".
  5. You will need to log in with your Apple Developer ID for the download to continue.

Here's how you do it. As root (sudo su -), type:

The EPREFIX variable controls the install location. The default is ~/gentoo.

user $ wget http://www.cs.stonybrook.edu/~ryao/prefix-install.sh && chmod u+x ./prefix-install.sh && env MAKEOPTS=-j5 ./prefix-install.sh

Bam!

Now, let's work on Funtoo Prefix :)