Getting started with DevStack as OpenStack playground environment on Ubuntu

I was recently looking to deploy a minimal installation of OpenStack to use as a development environment and to minimise the complexity of installing a complete OpenStack environment where I can build and tear down the environment with minimal effort. This is where DevStack comes into play, as to quote:

DevStack is a series of extensible scripts used to quickly bring up a complete OpenStack environment based on the latest versions of everything from git master. It is used interactively as a development environment and as the basis for much of the OpenStack project’s functional testing.

For my minimal installation of DevStack I am using new installation of Ubuntu Server 16.10 (clean installation and isolated instance recommended due to significant changes to the system). In terms of hardware configuration, the following recommendations are provided. However, this will all be dependant on your use case for DevStack and what you require to achieve and DevStack may also be installed without satisfying the below criteria but you may experience performance/stability issues.

  • Processor – at least 2 cores
  • Memory – at least 8GB
  • Hard Drive – at least 60GB

First of all we will create a user account named ‘stack’ to install DevStack and grant the user sudo privileges with the no password parameter. It is important in this step that we do not complete the installation as the root user.

sudo adduser stack 
echo "stack ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers

Now log out as the current user and reconnect as the ‘stack’ user created in the previous step and clone the repository to the current directory, in this example i am changing the directory to ‘/var’ to create my local copy.

cd /var 
sudo git clone git://github.com/openstack-dev/devstack.git

We will now need to create a configuration file (/var/local.conf) to specify user configuration variables to use when the installation script (/var/devstack/stack.sh) is executed in a subsequent step. The installation will complete without

The below example, contains only password variables so that you are not required to input the values at installation. For a more detailed configuration file containing additional parameters, check out the sample from the respoistory.

cd /var/devstack
sudo vi local.conf 
[[local|localrc]]
ADMIN_PASSWORD=openstack
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD

Once the configuration file has been created, we can now execute the installation script (stack.sh). The installation process will take approximately 15-20 minutes to complete to which will receive console output. Once the installation has completed you will receive an installation summary, URLs, accounts and passwords.

./stack.sh

Once the installation has completed successfully you should be able to browse to the Horizon dashboard and authenticate with the admin credentials configured during installation, at http://{ip address}/dashboard.

horizon-login

If you need to remove the installation of DevStack there is a script included in the repository (./clean.sh) which will remove the installation of DevStack and dependancies and then cleanup the directories touched by the installation. For a detailed list of impacted files and directories during the installation refer to this link.

cd /var/devstack
./clean.sh
rm -rf /opt/stack
rm -rf /usr/local/bin

From my initial attempt at installation, I encountered a number of issues which appear to be permission related I believe this was due to not cloning the repository as the ‘stack’ user account used for the installation. In this case, to resolve you could run the below or alternatively clean-up your installation process and repeat the installation.

sudo chown -R stack:stack /var/devstack 
sudo chmod 770 /var/devstack

Implementing R functionality on Tableau Server

R (https://www.r-project.org/) is a free software environment for statistical computing and graphics. It compiles and runs on a wide variety of UNIX platforms, Windows and MacOS. In this example, I will be installing and configuring R on Ubuntu 14.04 and enabling R functionality with Tableau Server by installing the Rserve library.

‚ÄčIn order to install R¬†‚Äč‚Äčand R packages from the ‘Compreshensive R Archive Network’ (CRAN) we will use the Advanced Packaging Tool (APT) and therefre¬†need¬†‚Äč‚Äčadd the repository to¬†‚Äč‚Äčthe list of sources¬†‚Äčas well as the¬†‚Äčpublic key¬†‚Äčto authenticate packages¬†downloaded using APT, this will ensure we install the latest version of both R (r-base)and the CRAN package for Rserve.

sudo sh -c 'echo "deb http://cran.rstudio.com/bin/linux/ubuntu trusty/" >> /etc/apt/sources.list'‚Äč‚Äč
gpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9
gpg -a --export E084DAB9 | sudo apt-key add -
sudo apt-get update 
sudo apt-get install ‚Äč r-base‚Äč‚Äč

To verify the installation we can enter an interactive shell session, once loaded we shall quit the session

R 
q(save="no")

Now we will install the Rserve CRAN package by invoking the install.package() function in R. In order for the package to be available to all users this is installed as root (su).

sudo su - -c "R -e \"install.packages('Rserve', repos = 'http://cran.rstudio.com/')\""‚Äč

Again, we can verify the installation by entering the R interactive shell session, confirming the Rserve library is available and then quit the session.

R
‚Äčlibrary(Rserve)
q(save="no")

By default Rserve only accepts local connections, in order to enable remote connections will we will need to modify the configuration file ‘/etc/Rserve.conf’. A detailed list of other Rserve connection properties that may be set see https://rforge.net/Rserve/doc.html#start.

remote enabled

In order to ensure the Rserve process is initialised at startyp as a daemon we will need to create the shell script ‘/etc/init.d/Rserve.sh’ as below. As no ownership of files are required for the invocation of the Rserve CRAN package, we will use the ‘nobody’ account to start the daemon.

#!/bin/bash 
sudo -u nobody R CMD Rserve --vanilla 

In order to execute the shell script we will require to set execute permissions to the shell script and add a link to initialise the shell script at startup. ‚Äč

sudo chmod 755 /etc/init.d/Rserve.sh
sudo update-rd.d /etc/init.d/Rserve.sh defaults

To confirm the Rserve process is initialised at startup using the shell script we can reboot the instance and confirm the process is running

ps aux | grep Rserve

The next step is optional, in this example I only want to permit inbound connections on the TCP service port 6311 (Rserve) from the Tableau Server. By default rules added to iptables are ephemeral and on restart will be removed. In order to save the configuration we will install the ‘iptables-persistent’ package.

sudo apt-get install iptables-persistent 

I will firstly insert a drop rule for all connections (IPv4) to the destination port 6311(tcp), then insert an accept rule for the Tableau Server (10.0.0.2) to the destination port 6311(tcp) and then save the updates to preserve the iptables configuration.

sudo iptables -I INPUT -p tcp -s 0.0.0.0/0 --dport 6311 -j DROP
sudo iptables -I INPUT -p tcp -s 10.0.0.2 --dport 6311 -j ACCEPT
sudo service iptables-persistent save‚Äč

The last step is to configure the Tableau Server VizSQL Server connection properties for a Rserve host (10.0.0.3) and port (6311) to enable R functionality within workbooks, optional configuration parameters are also available to use a username and password but in the example access is restricted by firewall rules.

tabadmin stop
‚Äčtabadmin set vizqlserver.rserve.host 10.0.0.3 
tabadmin set vizqlserver.rserve.port 6311
tabadmin configure
tabadmin start 

The configuration is now complete, to verify the VizSQL Server configuration, invoke ‘tabadmin configure -o ‘ to confirm the configuration parameter has been set by dumping the current configuration to a file.

Installing open-vm-tools deployPkg plug-in for Ubuntu Guest Operating Systems

If you are installing the open source implementation of VMware Tools ‘open-vm-tools’ into your guest operating system and require to use the virtual machine as a template or leverage Site Recovery Manager to customize virtual machines after failover, then there is a requirement to install the ‘deployPkg Tools’ plug-in.

The below details installing the plug-in on an Ubuntu operating system, however steps for other operating systems can be found here.

Firstly, we will need to obtain and import the VMware Packaging Public keys which can be downloaded from here and the files are required to be saved into a directory on the guest operating system.  For each key downloaded, we will import the key on successful completion you should receive the below notification:

sudo apt-key add /tmp/keys/VMWARE-PACKAGING-GPG-DSA-KEY.pub
OK
sudo apt-key add /tmp/keys/VMWARE-PACKAGING-GPG-RSA-KEY.pub
OK

We will now create the file ‘/etc/apt/sources.list.d/vmware-tools.list’¬†to add the below package repository and update the package index.

deb http://packages.vmware.com/packages/ubuntu precise main
sudo apt-get update

Once the package index has been updated we can invoke the following to install the ‘deployPKG’ plug-in. Once installed you should be able to customize your template or virtual machine for failover using Site Recovery Manager.

sudo apt-get install open-vm-tools-deploypkg

Installing Likewise Open on Ubuntu 14.04

In the release of Ubuntu 14.04 it would now appear that the likewise open package has been removed from the repository and there is no source package available.

However,  as mentioned at the following article http://www.tecmint.com/integrate-ubuntu-14-04-to-zentyal-pdc/ you can manually download and install the packages. I only followed the steps to download and install the likewise-open and libglade packages as I do not require the GUI package.

To manually download and install the required packages as above, invoke the following:

$ wget http://de.archive.ubuntu.com/ubuntu/pool/main/l/likewise-open/likewise-open_6.1.0.406-0ubuntu10_amd64.deb
$ wget http://de.archive.ubuntu.com/ubuntu/pool/main/libg/libglade2/libglade2-0_2.6.4-1ubuntu3_amd64.deb
$ sudo dpkg -i likewise-open_6.1.0.406-0ubuntu10_amd64.deb
$ sudo dpkg -i libglade2-0_2.6.4-1ubuntu3_amd64.deb

However, I received the following error, when attempting to install the libglade2-0:amd64 package:

dpkg: error processing package libglade2-0:amd64 (--install): dependency problems - leaving unconfigured
Errors were encountered while processing:libglade2-0:amd64

All I was required to do was to run ‘sudo apt-get -f install‘ to install any dependencies the libglade package required and following this I was able to invoke¬†‘domainjoin-cli‘ from the installed likewise open package.

Guest Customization of VM fails with “Error : Could not create file /etc/dhcp3/dhclient.conf!”

I was recently deploying VMs from a Ubuntu template using guest customisation, where guest customization fails and the IP address also fails to be updated with the following error:

An error occurred while customizing <VM>. For details, reference the log file /var/log/vmware-imc/toolsDeployPkg.log in the guest OS

On investigating the log file, the following error has been generated:

ERROR: Error : Could not create file /etc/dhcp3/dhclient.conf!

The cause of this issue is due to VMware Tools being unable to create a file in the /etc/dhcp3 directory as this does not exit.

In order to resolve the issue, you will need to create the directory by converting the template to a VM, making the below change and converting back to a template for deployment.

mkdir /etc/dhcp3

Install MongoDB on Ubuntu

Firstly, import the MongoDB public GPG key to require that the that the package is signed by the distributor.  I also was required to enable outbound connections on TCP service port 34898 to communicate with the key server using the hkp protocol:

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10

Now add the distribution for the package to the repository:

echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list

Finally, reload the repository and install the package:

sudo apt-get update
sudo apt-get install mongodb-10gen

Install RabbitMQ Server On Ubuntu

Add the following entry to /etc/apt/sources.list to use the RabbitMQ repository:

deb http://www.rabbitmq.com/debian/ testing main

To remove warnings about unsigned packages add the RabbitMQ public key to the trusted key list:

wget http://www.rabbitmq.com/rabbitmq-signing-key-public.asc
sudo apt-key add rabbitmq-signing-key-public.asc

Update the respoitories and install RabbitMQ:

sudo apt-get update
sudo apt-get install rabbitmq-server

To confirm the status of the RabbitMQ broker run the following:

sudo rabbitmqctl status