murano-docs/src/getting-started/src/docbkx/content/setup_lab_environment.xml

504 lines
22 KiB
XML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2013 Mirantis, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<chapter xmlns="http://docbook.org/ns/docbook"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xlink="http://www.w3.org/1999/xlink"
xsi:schemaLocation="http://docbook.org/ns/docbook http://www.docbook.org/xml/5.0/xsd/docbook.xsd
http://www.w3.org/1999/xlink http://www.w3.org/1999/xlink.xsd"
version="5.0">
<title>Setup Lab Environment</title>
<section>
<title>Install OpenStack</title>
<para>
To install Murano you need a working copy of OpenStack.
If you already have a Openstack installation make sure it meets the <link linkend="System Requirements">system requirements</link>.
To install Openstack that will be ready to use with Murano follow the instructions below.
</para>
<para><emphasis role="bold">Using Devstack</emphasis></para>
<para>
Currently the most simple way to build a lab is to use devstack.
The steps are quite simple:
</para>
<itemizedlist>
<listitem>
<para>
Install and configure OS on your hardware. The supported OS is Ubuntu Server 12.04 x64.
</para>
</listitem>
<listitem>
<para>Install all the latest updates:</para>
</listitem>
</itemizedlist>
<programlisting>
># apt-get update
># apt-get -y upgrade
</programlisting>
<itemizedlist>
<listitem>
<para>Create a user <emphasis role="bold">stack</emphasis>:</para>
</listitem>
</itemizedlist>
<programlisting>
># adduser stack
</programlisting>
<itemizedlist>
<listitem>
<para>Add user <emphasis role="bold">stack</emphasis> to sudoers:</para>
</listitem>
</itemizedlist>
<programlisting>
># echo stack ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/stack
># chmod 0440 /etc/sudoers.d/stack
</programlisting>
<itemizedlist>
<listitem>
<para>Create a folder for OpenStack installation files:
</para>
</listitem>
</itemizedlist>
<programlisting>
># mkdir /opt/stack
># chown stack:stack /opt/stack
</programlisting>
<itemizedlist>
<listitem>
<para>Clone the <emphasis role="bold">devstack</emphasis> repo</para>
</listitem>
</itemizedlist>
<programlisting>
># su stack
>$ cd
>$ git clone https://github.com/openstack-dev/devstack.git
</programlisting>
<itemizedlist>
<listitem>
<para>Checkout the <emphasis role="bold">stable/grizzly</emphasis> branch</para>
</listitem>
</itemizedlist>
<programlisting>
>$ cd devstack
>$ git checkout stable/grizzly
</programlisting>
<itemizedlist>
<listitem>
<para>Get <filename>localrc</filename> and <filename>local.sh</filename> files</para>
</listitem>
</itemizedlist>
<programlisting>
>$ wget https://raw.github.com/stackforge/murano-deployment/release-0.2/
getting-started/localrc
>$ wget https://raw.github.com/stackforge/murano-deployment/release-0.2/
getting-started/local.sh -O local.sh-O local.sh
>$ chmod +x local.sh
</programlisting>
<itemizedlist>
<listitem>
<para>Start <emphasis>devstack</emphasis></para>
</listitem>
</itemizedlist>
<programlisting>
>$ ./stack.sh
</programlisting>
<para>
When stack.sh finishes execution your OpenStack
installation is ready.
</para>
</section>
<section xml:id="Samba">
<title>Prepare Shared Prerequisites</title>
<para><emphasis role="bold">Configure Samba Share</emphasis></para>
<para>
<itemizedlist>
<listitem>
<para>Install SAMBA:</para>
</listitem>
</itemizedlist>
<programlisting>
># apt-get update
># apt-get install samba
</programlisting>
<itemizedlist>
<listitem>
<para>Create shared folder:</para>
</listitem>
</itemizedlist>
<programlisting>
># mkdir -p /opt/samba/share
># chown nobody:nogroup /opt/samba/share
</programlisting>
<itemizedlist>
<listitem>
<para>Edit /etc/samba/smb.conf:</para>
</listitem>
</itemizedlist>
<programlisting>
...
[global]    
...    
security = user
...
[share]
   comment = Deployment Share
path = /opt/samba/share  
browsable = yes
guest ok = yes    
guest account = nobody
   read only = no
create mask = 0755
[image-builder-share]
comment = Image Builder Share
path = /opt/image-builder/share
browsable = yes
guest ok = yes    
guest account = nobody
   read only = no
create mask = 0755
</programlisting>
<itemizedlist>
<listitem>
<para>Restart services:</para>
</listitem>
</itemizedlist>
<programlisting>
># restart smbd
># restart nmdb
</programlisting>
</para>
<para><emphasis role="bold">Copy Prerequisites Into The Share</emphasis></para>
<itemizedlist>
<listitem>
<para>Create folder structure:</para>
</listitem>
</itemizedlist>
<programlisting>
># mkdir -p “/opt/samba/share/Prerequisites/IIS”
># mkdir -p “/opt/samba/share/Prerequisites/SQL Server/2012”
># mkdir -p “/opt/samba/share/Prerequisites/SQL Server/Tools”
</programlisting>
<itemizedlist>
<listitem>
<para>Download and put the following files into the specified paths under
<filename>/opt/samba/share</filename> folder:
<orderedlist>
<listitem>
<para>
<link xlink:href="http://www.asp.net/mvc/mvc4">
ASP .NET MVC 4 setup package</link>:
<filename>Prerequisites/AspNetMVC4Setup.exe</filename>
</para>
</listitem>
<listitem>
<para>
<link xlink:href="https://www.dropbox.com/sh/zthldcxnp6r4flm/Y8gxbIZGF_/WebApplications.exe">
Additional files to build ASP application
</link>: should be placed to <filename>Prerequisites/WebApplications.exe</filename>
</para>
</listitem>
<listitem>
<para>
<link xlink:href="http://www.microsoft.com/en-us/download/details.aspx?id=29066">
MS SQL Server 2012</link>: Extract the content of the ISO/EXE file
to the <filename>Prerequisites/SQL Server/2012/</filename>.
After that <filename>setup.exe</filename> should be located inside this directory.
</para>
</listitem>
<listitem>
<para>
<link xlink:href="http://go.microsoft.com/fwlink/?LinkID=239656&amp;clcid=0x409">
Microsoft® Windows PowerShell Extensions for Microsoft® SQL Server®2012</link>:
<filename>Prerequisites/SQL Server/Tools/PowerShellTools.msi</filename>
</para>
</listitem>
<listitem>
<para>
<link xlink:href="http://go.microsoft.com/fwlink/?LinkID=239659&amp;clcid=0x409">
Microsoft® SQL Server® 2012 Shared
Management Objects</link>:
<filename>Prerequisites/SQL Server/Tools/SharedManagementObjects.msi</filename>
</para>
</listitem>
<listitem>
<para>
<link xlink:href="http://go.microsoft.com/fwlink/?LinkID=239644&amp;clcid=0x409">
Microsoft® System CLR Types for Microsoft® SQL Server® 2012
</link>:
<filename>Prerequisites/SQL Server/Tools/SQLSysClrTypes.msi</filename>
</para>
</listitem>
</orderedlist>
</para>
</listitem>
</itemizedlist>
</section>
<section xml:id="Build Windows Image">
<title>Build Windows Image</title>
<para>A pre-built Windows Image is required to create environments
in Murano. Because of its size its better to build the image
on the same host where OpenStack is installed. This section describe
steps required to build such an image.
</para>
<para><emphasis role="bold">Prepare Build Environment</emphasis></para>
<itemizedlist>
<listitem>
<para>
Samba should be already installed (See <link linkend="Samba">Configure samba share</link>)
</para>
</listitem>
<listitem>
<para>Clone <emphasis role="bold">murano-deployment</emphasis> repository:</para>
</listitem>
</itemizedlist>
<programlisting>
># cd /opt/git
># git clone git://github.com/stackforge/murano-deployment.git
</programlisting>
<itemizedlist>
<listitem>
<para>Change directory to <filename>murano-deployment/image-builder</filename>
folder:
</para>
</listitem>
</itemizedlist>
<programlisting>
># cd /opt/git/murano-deployment/image-builder
</programlisting>
<itemizedlist>
<listitem>
<para>Create folder structure for image builder:</para>
</listitem>
</itemizedlist>
<programlisting>
># make build-root
</programlisting>
<itemizedlist>
<listitem>
<para>
Download and put the following files into the specified paths under
<filename>/opt/image-builder </filename>folder:
<orderedlist>
<listitem>
<para>
<link xlink:href="http://technet.microsoft.com/en-us/evalcenter/hh670538.aspx">
Windows 2012 Server ISO evaluation version</link>: libvirt/images/ws­2012­eval.iso
</para>
</listitem>
<listitem>
<para>
<link xlink:href="http://alt.fedoraproject.org/pub/alt/virtio-win/stable/virtio-win-0.1-52.iso">
VirtIO drivers
</link>
should be placed to libvirt/images/virtio-win-0.1-52.iso
</para>
</listitem>
<listitem>
<para>
<link xlink:href=" http://www.cloudbase.it/downloads/CloudbaseInitSetup_Beta.msi">
CloudBase-Init for Windows:
</link>
share/files/CloudbaseInitSetup_Beta.msi
</para>
</listitem>
<listitem>
<para>
<link xlink:href="http://www.farmanager.com/files/Far30b3525.x64.20130717.msi">
Far Manager:
</link>
share/files/Far30b3367.x64.20130426.msi
</para>
</listitem>
<listitem>
<para>
<link xlink:href="https://msysgit.googlecode.com/files/Git-1.8.3-preview20130601.exe">
Git client
</link>
share/files/Git-1.8.1.2-preview20130201.exe
</para>
</listitem>
<listitem>
<para>
<link xlink:href="http://download.sysinternals.com/files/SysinternalsSuite.zip">
Sysinternals
</link>
Suiteshare/files/SysinternalsSuite.zip
</para>
</listitem>
<listitem>
<para>
<link xlink:href="https://www.dropbox.com/sh/zthldcxnp6r4flm/-k1Om_V6XR">
unzip.exe tool
</link>
share/files/unzip.exe
</para>
</listitem>
<listitem>
<para>
<link xlink:href="http://www.microsoft.com/en-us/download/details.aspx?id=34595">
PowerShell v3
</link>
share/files/Windows6.1-KB2506143-x64.msu
</para>
</listitem>
<listitem>
<para>
<link xlink:href="http://www.microsoft.com/en-us/download/details.aspx?id=17718">
.NET 4.0:
</link>
share/files/dotNetFx40_Full_x86_x64.exe
</para>
</listitem>
<listitem>
<para>
<link xlink:href="http://www.microsoft.com/en-us/download/details.aspx?id=30653">
.NET 4.5:
</link>
share/files/dotNetFx45_Full_setup.exe
</para>
</listitem>
<listitem>
<para>
<link xlink:href="https://www.dropbox.com/sh/zthldcxnp6r4flm/-k1Om_V6XR">
Murano Agent
</link>
share/files/MuranoAgent.zip
</para>
</listitem>
</orderedlist>
</para>
</listitem>
<listitem>
<para>Test that all required files are in place:</para>
</listitem>
</itemizedlist>
<programlisting>
># make test-build-files
</programlisting>
<para>
<emphasis role="bold">Build The Image</emphasis></para>
<itemizedlist>
<listitem>
<para>Get list of supported images:</para>
</listitem>
</itemizedlist>
<programlisting>
># make
</programlisting>
<itemizedlist>
<listitem>
<para>Run image build process:</para>
</listitem>
</itemizedlist>
<programlisting>
># make ws-2012-std
</programlisting>
<itemizedlist>
<listitem>
<para>Wait until process finishes</para>
</listitem>
<listitem>
<para>The image file <filename>ws-2012-std.qcow2</filename> will be stored in <filename>
/opt/image-builder/share/images </filename> folder.
</para>
</listitem>
</itemizedlist>
<para><emphasis role="bold">Import Windows Image Into Glance</emphasis></para>
<para>Now when youve built a Windows Image it must be imported into Glance.
</para>
<itemizedlist>
<listitem>
<para>Import <filename>openrc</filename> file which contains environment
variables definitions required by OpenStack components:
</para>
</listitem>
</itemizedlist>
<programlisting>
>$ source openrc
</programlisting>
<itemizedlist>
<listitem>
<para>
Import the Windows Server 2012 image into Glance:
</para>
</listitem>
</itemizedlist>
<programlisting width="200">
>$ cd /opt/image-builder/share/images
>$ glance image-create --name ws-2012-std --disk-format qcow2 \
--container-format bare --file ws-2012-std.qcow2 --is-public true \
--property murano_image_info='{"type":"windows.2012", "title":"Windows Server 2012 Standard"}'
</programlisting>
<warning>
<para>
The value of the --property argument named
murano_image_info is a JSON string. Only double quotes are
valid in JSON, so please type the string exactly as in the
example above.
</para>
</warning>
</section>
<section xml:id="Rabbit">
<title>RabbitMQ Configuration Notes</title>
<para>OpenStack rabbitMQ default credentials could be used for murano services,
but prefered way is to make additional changes into rabbitMQ
configuration, like own vhost, login and password. These steps
require superuser rights and should be run only on the OpenStack
controller node where rabbitMQ service resides.
</para>
<para>How to do this:
<programlisting>
># rabbitmqctl add_user muranouser muranopassword
># rabbitmqctl set_user_tags muranouser administrator
># rabbitmqctl add_vhost muranovhost
># rabbitmqctl set_permissions -p muranovhost muranouser ".*" ".*" ".*"
</programlisting>
</para>
</section>
<section xml:id="Keystone">
<title>Keystone Configuration Notes</title>
<para>Service entry and endpoint associated with it for murano-api and murano-repository
could also be configured in the keystone. If there is no record
about murano-api in the keystone murano-dashboard would try to
reach murano-api service at localhost on the default murano-api
port 8082.(8084 in case of murano-repository)
</para>
<para>How to add service record into the keystone using python keystone
client:
<programlisting>
># keystone service-create --name muranoapi --type murano \
--description "Murano-Api Service"
</programlisting>
And for murano-repository:
<programlisting>
># keystone service-create --name murano-repository --type murano-repository \
--description "Murano-Repository Service"
</programlisting>
This command returns UUID of the created service record, which
should be used below.
<programlisting>
># keystone endpoint-create \
  --service-id UUID_from_above \
  --publicurl http://murano_vm_address:8082 \
  --internalurl http://murano_vm_address:8082 \
  --adminurl http://murano_vm_address:8082 \
</programlisting>
</para>
</section>
</chapter>