~koolhead17/openstackbook/cssbook

« back to all changes in this revision

Viewing changes to Installation.xml

  • Committer: Kiran Murari
  • Date: 2011-09-27 13:32:13 UTC
  • Revision ID: kiranmurari@gmail.com-20110927133213-3681t2ydmyegmy60
modified nova-manage commands and added sqlite instructions

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 <title>Installation and Configuration</title>
3
3
<section xml:id="Introduction-d1e390">
4
4
<title>Introduction</title>
5
 
<para>The following section describes how to set up a minimal cloud infrastructure based on OpenStack using 3 machines. These machines are referred to in this and subsequent chapters as Server1 and Server2 and Client1. Server1 runs all the 7 components of Nova as well as Glance and OpenStack dashboard. Server2 runs only nova-compute. Since OpenStack components follow a shared-nothing policy, each component or any group of components can be installed on any server.</para>
6
 
 
 
5
<para>The following section describes how to set up a minimal cloud infrastructure based on OpenStack using 3 machines. These machines are referred to in this and subsequent chapters as Server1 and Server2 and Client1. Server1 runs all the components of Nova as well as Glance and OpenStack dashboard. Server2 runs only nova-compute. Since OpenStack components follow a shared-nothing policy, each component or any group of components can be installed on any server.</para>
7
6
<para>Client1 is not a required component. In our sample setup, it is used for bundling images, as a client to the web interface, and to run euca commands to manage the infrastructure. Having this client ensures that you do not need to meddle with the servers for tasks such as bundling. Also, bundling of Desktop Systems including Windows will require a GUI and it is better to have a dedicated machine for this purpose. We would recommend this machine to be VT-Enabled so that KVM can be run which allows for Windows VMs during image creation for bundling.</para>
8
7
<para>
9
8
<mediaobject>
73
72
</section>
74
73
<section xml:id="Server1-d1e537">
75
74
<title>Server1</title>
76
 
 <para>As shown in the figure above, Server1 contains all nova- services including nova-compute, nova-api, nova-volume, nova-network, nova-objectstore as well as the Image Service Glance and the Dashboard. </para>
 
75
 <para>As shown in the figure above, Server1 contains all nova- services including nova-compute, nova-api, nova-volume, nova-network, nova-objectstore as well as the Image Service Glance and the Dashboard. It contains two Network Interface Cards (NICs).</para>
77
76
<section xml:id="Base_OS-d1e542">
78
77
<title>Base OS</title>
79
78
<para>Boot the server off the Ubuntu server 11.04 CD. At the graphical menu select Install Ubuntu server and proceed with basic installation steps.
165
164
<programlisting>sudo mysql -uroot -p$MYSQL_PASS -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;"</programlisting>
166
165
<para>Set MySQL root password for login from any IP.</para>
167
166
<programlisting>sudo mysql -uroot -p$MYSQL_PASS -e "SET PASSWORD FOR 'root'@'%' = PASSWORD('$MYSQL_PASS');"</programlisting>
 
167
<para>Create a user named novadbadmin which has access to nova related databases.</para>
 
168
<programlisting>sudo mysql -uroot -p$MYSQL_PASS -e 'CREATE USER novadbadmin;'</programlisting>
 
169
<para>Grant all privileges for novadbadmin on the Database "nova".</para>
 
170
<programlisting>sudo mysql -uroot -p$MYSQL_PASS -e "GRANT ALL PRIVILEGES ON nova.* TO 'novadbadmin'@'%' ;"</programlisting>
 
171
<para>Set password for novadbadmin.</para>
 
172
<programlisting>sudo mysql -uroot -p$MYSQL_PASS -e "SET PASSWORD FOR 'novadbadmin'@'%' = PASSWORD('$MYSQL_PASS');"</programlisting>
168
173
</section>
 
174
<section>
 
175
<title>Installing Sqlite (Instead of Mysql)</title>
 
176
<para>Installation</para>
 
177
<programlisting>sudo apt-get install sqlite</programlisting>
 
178
</section> 
169
179
</section>
170
180
<section xml:id="Nova_Components-d1e718">
171
181
<title>Nova Components</title>
198
208
--image_service=nova.image.glance.GlanceImageService
199
209
--iscsi_ip_prefix=192.168.
200
210
</programlisting>
 
211
<para>For configuring with Sqlite change the line with --sql_connection to:</para>
 
212
<programlisting>--sql_connection=sqlite:////var/lib/nova/nova.sqlite</programlisting> 
201
213
<para>Enable iscsitarget.</para>
202
214
<programlisting>sudo sed -i 's/false/true/g' /etc/default/iscsitarget</programlisting>
203
215
<para>Restart the iscsitarget service</para>
217
229
sudo chmod 644 /etc/nova/nova.conf
218
230
</programlisting>
219
231
<para>Restart all the nova related services.</para>
220
 
<programlisting>sudo /etc/init.d/libvirt-bin restart; sudo restart nova-network; sudo restart nova-compute; sudo restart nova-api; sudo restart nova-objectstore; sudo restart nova-scheduler; sudo restart nova-volume; sudo restart glance-api; sudo restart glance-registry</programlisting>
 
232
<programlisting>sudo restart libvirt-bin; sudo restart nova-network; sudo restart nova-compute; sudo restart nova-api; sudo restart nova-objectstore; sudo restart nova-scheduler; sudo restart nova-volume; sudo restart glance-api; sudo restart glance-registry</programlisting>
221
233
<para>Create nova schema in the MySQL Database.</para>
222
234
<programlisting>sudo nova-manage db sync</programlisting>
223
 
<para>Create a list of IPs to be used from the network of fixed Ips set inside nova.conf.</para>
224
 
<programlisting>sudo nova-manage network create 192.168.3.0/24 1 255
 
235
<para>Create a list of IPs to be used from the network of fixed IPs set inside nova.conf.</para>
 
236
<programlisting>sudo nova-manage network create --bridge_interface=br100 --fixed_range_v4=192.168.3.0/29 --label=proj
225
237
</programlisting>
226
238
<para>Allocate 32 pubic IP addresses for use with the instances starting from 10.10.10.225.</para>
227
 
<programlisting>sudo nova-manage floating create 10.10.10.2 10.10.10.224/27
 
239
<programlisting>sudo nova-manage floating create --ip_range=10.10.10.224/27
228
240
</programlisting>
229
241
<para>Create a user with admin rights on nova.</para>
230
242
<programlisting>sudo nova-manage user admin novaadmin
252
264
<programlisting>source /home/localadmin/creds/novarc
253
265
</programlisting>
254
266
<para>Restart all the nova related services.</para>
255
 
<programlisting>sudo /etc/init.d/libvirt-bin restart; sudo restart nova-network; sudo restart nova-compute; sudo restart nova-api; sudo restart nova-objectstore; sudo restart nova-scheduler; sudo restart nova-volume; sudo restart glance-api; sudo restart glance-registry</programlisting>
 
267
<programlisting>sudo restart libvirt-bin; sudo restart nova-network; sudo restart nova-compute; sudo restart nova-api; sudo restart nova-objectstore; sudo restart nova-scheduler; sudo restart nova-volume; sudo restart glance-api; sudo restart glance-registry</programlisting>
256
268
<para>Check if the credentials are working and if nova has been setup properly by running:</para>
257
269
<programlisting>euca-describe-availability-zones verbose
258
270
</programlisting>