Content¶
Prepare A Lab For Murano¶
This section provides basic information about lab’s system requirements. It also contains a description of a test which you may use to check if your hardware fits the requirements. To do this, run the test and compare the results with baseline data provided.
System prerequisites¶
Supported Operation Systems
- Ubuntu Server 12.04 LTS
- RHEL/CentOS 6.4
System packages are required for Murano
Ubuntu
- gcc
- python-pip
- python-dev
- libxml2-dev
- libxslt-dev
- libffi-dev
- libmysqlclient-dev
- libpq-dev
- python-openssl
- mysql-client
- python-mysqldb
CentOS
- gcc
- python-pip
- python-devel
- libxml2-devel
- libxslt-devel
- libffi-devel
- postgresql-devel
- pyOpenSSL
- mysql
- MySQL-python
Lab Requirements¶
Criteria | Minimal | Recommended |
---|---|---|
CPU | 4 core @ 2.4 GHz | 24 core @ 2.67 GHz |
RAM | 8 GB | 24 GB or more |
HDD | 2 x 500 GB (7200 rpm) | 4 x 500 GB (7200 rpm |
RAID | Software RAID-1 (use mdadm as it will improve read performance almost two times) | Hardware RAID-10 |
Table: Hardware requirements
There are a few possible storage configurations except the shown above. All of them were tested and were working well.
1x SSD 500+ GB
- 1x HDD (7200 rpm) 500+ GB and 1x SSD 250+ GB (install the system onto
the HDD and mount the SSD drive to folder where VM images are)
1x HDD (15000 rpm) 500+ GB
Test Your Lab Host Performance¶
We have measured time required to boot 1 to 5 instances of Windows system simultaneously. You can use this data as the baseline to check if your system is fast enough.
You should use sysprepped images for this test, to simulate VM first boot.
Steps to reproduce test:
Prepare Windows 2012 Standard (with GUI) image in QCOW2 format. Let’s assume that its name is ws-2012-std.qcow2
Ensure that there is NO KVM PROCESSES on the host. To do this, run command:
># ps aux | grep kvm
Make 5 copies of Windows image file:
># for i in $(seq 5); do \ cp ws-2012-std.qcow2 ws-2012-std-$i.qcow2; done
Create script start-vm.sh in the folder with .qcow2 files:
#!/bin/bash [ -z $1 ] || echo "VM count not provided!"; exit 1 for i in $(seq $1); do echo "Starting VM $i ..." kvm -m 1024 -drive file=ws-2012-std-$i.qcow2,if=virtio -net user -net nic,model=virtio -nographic -usbdevice tablet -vnc :$i & done
Start ONE instance with command below (as root) and measure time between VM’s launch and the moment when Server Manager window appears. To view VM’s desktop, connect with VNC viewer to your host to VNC screen :1 (port 5901):
># ./start-vm.sh 1
Turn VM off. You may simply kill all KVM processes by
># killall kvm
7. Start FIVE instances with command below (as root) and measure time interval between ALL VM’s launch and the moment when LAST Server Manager window appears. To view VM’s desktops, connect with VNC viewer to your host to VNC screens :1 thru :5 (ports 5901-5905):
># ./start-vm.sh 5
Turn VMs off. You may simply kill all KVM processes by
># killall kvm
Baseline Data¶
The table below provides baseline data which we’ve got in our environment.
Avg. Time refers to the lab with recommended hardware configuration, while Max. Time refers to minimal hardware configuration.
Boot ONE instance | Boot FIVE instances | |
---|---|---|
Avg. Time | 3m:40s | 8m |
Max. Time | 5m | 20m |
Host Optimizations¶
Default KVM installation could be improved to provide better performance.
The following optimizations may improve host performance up to 30%:
- change default scheduler from CFQ to Deadline
- use ksm
- use vhost-net
Installing and Running the Development Version¶
The contrib/devstack directory contains the files necessary to integrate Murano with Devstack.
Follow Devstack documentation to setup a host for Devstack. Then clone Devstack source code.
Copy Murano integration scripts to Devstack:
$ cp lib/murano ${DEVSTACK_DIR}/lib $ cp lib/murano-dashboard ${DEVSTACK_DIR}/lib $ cp extras.d/70-murano.sh ${DEVSTACK_DIR}/extras.d
Create a localrc file as input to devstack.
The Murano services are not enabled by default, so they must be enabled in localrc before running stack.sh. This example localrc file shows all of the settings required for Murano:
# Enable Heat enable_service heat h-api h-api-cfn h-api-cw h-eng # Enable Murano enable_service murano murano-api murano-engine
Deploy your OpenStack Cloud with Murano:
$ ./stack.sh
Installing and Running Manually¶
Prepare Environment¶
First you need to install a number of packages with your OS package manager. The list of packages depends on the OS you use.
$ sudo apt-get install python-pip python-dev \
> libmysqlclient-dev libpq-dev \
> libxml2-dev libxslt1-dev \
> libffi-dev
Note
Fedora support wasn’t thoroughly tested. We do not guarantee that Murano will work on Fedora.
$ sudo yum install gcc python-setuptools python-devel python-pip
$ sudo yum install gcc python-setuptools python-devel
$ sudo easy_install pip
$ sudo pip install tox
Murano can use various database types on backend. For development purposes SQLite is enough in most cases. For production installations you should use MySQL or PostgreSQL databases.
Warning
Although Murano could use PostgreSQL database on backend, it wasn’t thoroughly tested and should be used with caution.
To use MySQL database you should install it and create an empty database first:
$ apt-get install python-mysqldb mysql-server
$ mysql -u root -p
mysql> CREATE DATABASE murano;
mysql> GRANT ALL PRIVILEGES ON murano.* TO 'murano'@'localhost' \
IDENTIFIED BY 'MURANO_DBPASS';
mysql> exit;
Install the API service and Engine¶
Create a folder which will hold all Murano components.
$ mkdir ~/murano
Clone the Murano git repository to the management server.
$ cd ~/murano $ git clone https://github.com/stackforge/murano
Copy the sample configuration from the source tree to their final location.
$ cd ~/murano/murano/etc/murano $ cp murano.conf.sample murano.conf
Edit murano.conf with your favorite editor. Below is an example which contains basic settings your are likely need to configure.
Note
The example below uses SQLite database. Edit [database] section if you want to use other database type.
[DEFAULT] debug = true verbose = true rabbit_host = %RABBITMQ_SERVER_IP% rabbit_userid = %RABBITMQ_USER% rabbit_password = %RABBITMQ_PASSWORD% rabbit_virtual_host = %RABBITMQ_SERVER_VIRTUAL_HOST% notification_driver = messagingv2 [database] backend = sqlalchemy connection = sqlite:///murano.sqlite [keystone] auth_url = 'http://%OPENSTACK_HOST_IP%:5000/v2.0' [keystone_authtoken] auth_uri = 'http://%OPENSTACK_HOST_IP%:5000/v2.0' auth_host = '%OPENSTACK_HOST_IP%' auth_port = 5000 auth_protocol = http admin_tenant_name = %OPENSTACK_ADMIN_TENANT% admin_user = %OPENSTACK_ADMIN_USER% admin_password = %OPENSTACK_ADMIN_PASSWORD% [murano] url = http://%YOUR_HOST_IP%:8082 [rabbitmq] host = %RABBITMQ_SERVER_IP% login = %RABBITMQ_USER% password = %RABBITMQ_PASSWORD% virtual_host = %RABBITMQ_SERVER_VIRTUAL_HOST%
Create a virtual environment and install Murano prerequisites. We will use tox for that. Virtual environment will be created under .tox directory.
$ cd ~/murano/murano $ tox
Create database tables for Murano.
$ cd ~/murano/murano $ tox -e venv -- murano-db-manage \ > --config-file ./etc/murano/murano.conf upgrade
Open a new console and launch Murano API. A separate terminal is required because the console will be locked by a running process.
$ cd ~/murano/murano $ tox -e venv -- murano-api \ > --config-file ./etc/murano/murano.conf
Import Core Murano Library.
$ cd ~/murano/murano $ tox -e venv -- murano-manage \ > --config-file ./etc/murano/murano.conf \ > import-package ./meta/io.murano
Open a new console and launch Murano Engine. A separate terminal is required because the console will be locked by a running process.
$ cd ~/murano/murano $ tox -e venv -- murano-engine --config-file ./etc/murano/murano.conf
Install Murano Dashboard¶
Murano API & Engine services provide the core of Murano. However, your need a control plane to use it. This section decribes how to install and run Murano Dashboard.
Clone the repository with Murano Dashboard.
$ cd ~/murano $ git clone https://github.com/stackforge/murano-dashboard
Create a virtual environment and install dashboard prerequisites. Again, we use tox for that.
$ cd ~/murano/murano-dashboard $ tox
Install the latest horizon version and all murano-dashboard requirements into the virtual environment:
$ tox -e venv pip install horizon
It may happen, that the last release of horizon will be not capable with latest murano-dashboard code. In that case, horizon need to be installed from master branch of this repository: https://github.com/openstack/horizon
Copy configuration file for dashboard.
$ cd ~/murano/murano-dashboard/muranodashboard/local $ cp local_settings.py.sample local_settings.py
Edit configuration file.
$ cd ~/murano/murano-dashboard/muranodashboard/local $ vim ./local_settings.py
... ALLOWED_HOSTS = '*' # Provide OpenStack Lab credentials OPENSTACK_HOST = '%OPENSTACK_HOST_IP%' ... # Set secret key to prevent it's generation SECRET_KEY = 'random_string' ... DEBUG_PROPAGATE_EXCEPTIONS = DEBUG ...
- Update settings file
Running Murano dashboard on developer environment implies the use of murano settings file instead of horizon. However, for the correct setup requires settings file to be synchronized with corresponding horizon release. But murano-dashboard also have parameters, that should be added to that config. So for your convenience, Murano has special script that allows to quickly synchronize Django settings file for a developer installation. update_setting.sh file can be found here.
To display all possible options run:
./update_setting.sh --help
Note
Ether output or input parameter should be specified.
- --input={PATH/TO/HORIZON/SETTINGS/FILE} - settings file to which murano settings would be applied. If omitted, settings from horizon master branch are downloaded.
- --output={PATH/TO/FILE} - file to store script execution result. Will be overwrite if already exist. If omitted, coincides to the input parameter.
- --tag - horizon release tag name, applied, if no input parameter is provided.
- --remove - if set, Murano parameters would be removed from the settings file.
- --cache-dir={PATH/TO/DIRECTORY} - directory to store intermediate script data. Default is /tmp/muranodashboard-cache.
- --log-file={PATH/TO/FILE} - file to store the script execution log to a separate file.
- Run Django server at 127.0.0.1:8000 or provide different IP and PORT parameters.
$ cd ~/murano/murano-dashboard $ tox -e venv -- python manage.py runserver <IP:PORT>Development server will be restarted automatically on every code change.
- Open dashboard using url http://localhost:8000
Import Murano Applications¶
Murano provides excellent catalog services, but it also requires applications which to provide. This section describes how to import Murano Applications from Murano App Incubator.
Clone Murano App Incubator repository.
$ cd ~/murano $ git clone https://github.com/murano-project/murano-app-incubator
Import every package you need from Murano App Incubator using the command below.
$ cd ~/murano/murano $ tox -e venv -- murano-manage \ > --config-file ./etc/murano/murano.conf \ > import-package ../murano-app-incubator/%APPLICATION_DIRECTORY_NAME%
Network Configuration¶
To work with Murano, tenant network in Openstack installation should be configured in a certain way. This configuration may be set up automatically with the provision of several parameters in config file or manually.
Murano has advanced networking features that give you ability to not care about configuring networks for your application. By default it will create an isolated network for each environment and join all VMs needed by your application to that network. To install and configure application in just spawned virtual machine Murano also requires a router connected to the external network.
To create router automatically, provide the following parameters in config file:
[networking]
external_network = %EXTERNAL_NETWORK_NAME%
router_name = %MURANO_ROUTER_NAME%
create_router = true
To figure out the name of the external network, perform the following command:
$ neutron net-external-list
During the first deploy, required networks and router with specified name will be created and set up.
- Step 1. Create public network
- First, you need to check for existence of external networks. Login as admin and go to Project -> Network -> Network Topology. And check network type in network details at Admin -> Networks -> Network name page. The same action can be done via CLI by running neutron net-external-list. To create new external network examine OpenStack documentation.
- Step 2. Create local network
- Go to Project -> Network -> Networks.
- Click Create Network and fill the form.
![]()
![]()
- Step 3. Create router
- Go to Project -> Network -> Routers
- Click “Create Router”
- In the “Router Name” field, enter the murano-default-router
![]()
If you specify a name other than murano-default-router, it will be necessary to change the following settings in the config file:
[networking] router_name = %SPECIFIED_NAME% create_router = false
- Click on the specified router name
- In the opened view click “Add interface”
- Specify the subnet and IP address
![]()
And check the result in Network Topology tab.
![]()
SSL configuration¶
Murano components are able to work with SSL. This chapter will help your to make proper settings with SSL configuration.
HTTPS for Murano API¶
SSL for Murano API service can be configured in ssl section in /etc/murano/murano.conf. Just point to a valid SSL certificate. See the example below:
[ssl]
cert_file = PATH
key_file = PATH
ca_file = PATH
- cert_file Path to the certificate file the server should use when binding to an SSL-wrapped socket.
- key_file Path to the private key file the server should use when binding to an SSL-wrapped socket.
- ca_file Path to the CA certificate file the server should use to validate client certificates provided during an SSL handshake. This is ignored if cert_file and “key_file” are not set.
The use of SSL is automatically started after point to HTTPS protocol instead of HTTP during registration Murano API service in endpoints (Change publicurl argument to start with https://). SSL for Murano API is implemented like in any other Openstack component. This realization is based on ssl python module so more information about it can be found here.
SSL for RabbitMQ¶
All Murano components communicate with each other by RabbitMQ. This interaction can be encrypted with SSL. By default all messages in Rabbit MQ are not encrypted. Each RabbitMQ Exchange should be configured separately.
Murano API <-> Rabbit MQ exchange <-> Murano Engine
Edit ssl parameters in default section of /etc/murano/murano.conf. Set rabbit_use_ssl option to true and configure ssl kombu parameters. Specify the path to the SSL keyfile and SSL CA certificate in a regular format: /path/to/file without quotes or leave it empty to allow self-signed certificates.
# connect over SSL for RabbitMQ (boolean value)
#rabbit_use_ssl=false
# SSL version to use (valid only if SSL enabled). valid values
# are TLSv1, SSLv23 and SSLv3. SSLv2 may be available on some
# distributions (string value)
#kombu_ssl_version=
# SSL key file (valid only if SSL enabled) (string value)
#kombu_ssl_keyfile=
# SSL cert file (valid only if SSL enabled) (string value)
#kombu_ssl_certfile=
# SSL certification authority file (valid only if SSL enabled)
# (string value)
#kombu_ssl_ca_certs=
Murano Agent -> Rabbit MQ exchange
In main murano configuration file there is a section ,named rabbitmq, that is responsible for set up communication between Murano Agent and Rabbit MQ. Just set ssl parameter to True to enable ssl.
[rabbitmq]
host = localhost
port = 5672
login = guest
password = guest
virtual_host = /
ssl = True
If you want to configure Murano Agent in a different way change the default template. It can be found in Murano Core Library, located at /https://github.com/stackforge/murano/blob/master/meta/io.murano/Resources/Agent-v1.template. Take a look at appSettings section:
<appSettings>
<add key="rabbitmq.host" value="%RABBITMQ_HOST%"/>
<add key="rabbitmq.port" value="%RABBITMQ_PORT%"/>
<add key="rabbitmq.user" value="%RABBITMQ_USER%"/>
<add key="rabbitmq.password" value="%RABBITMQ_PASSWORD%"/>
<add key="rabbitmq.vhost" value="%RABBITMQ_VHOST%"/>
<add key="rabbitmq.inputQueue" value="%RABBITMQ_INPUT_QUEUE%"/>
<add key="rabbitmq.resultExchange" value=""/>
<add key="rabbitmq.resultRoutingKey" value="%RESULT_QUEUE%"/>
<add key="rabbitmq.durableMessages" value="true"/>
<add key="rabbitmq.ssl" value="%RABBITMQ_SSL%"/>
<add key="rabbitmq.allowInvalidCA" value="true"/>
<add key="rabbitmq.sslServerName" value=""/>
</appSettings>
Desired parameter should be set directly to the value of the key that you want to change. Quotes are need to be kept. Thus you can change “rabbitmq.ssl” and “rabbitmq.port” values to make Rabbit MQ work with this exchange in a different from Murano-Engine way. After modification, don’t forget to zip and re-upload core library.
SSL for Murano Dashboard¶
If you are going not to use self-signed certificates additional configuration do not need to be done. Just point https in the URL. Otherwise, set MURANO_API_INSECURE = True on horizon config. You can find it in /etc/openstack-dashboard/local_settings.py..