~ubuntu-branches/ubuntu/jaunty/ubuntu-docs/jaunty

« back to all changes in this revision

Viewing changes to serverguide/C/virtualization.xml

  • Committer: Bazaar Package Importer
  • Author(s): Matthew East
  • Date: 2009-03-25 22:03:21 UTC
  • Revision ID: james.westby@ubuntu.com-20090325220321-mlvxr0tk6ht0gmyr
Tags: 9.04.5
* String freeze release

* [Matthew East]
  - Updating logout and shutdown instructions for Jaunty (User Switcher, not System menu)
  - musicvideophotos.xml - use consistent language for extracting audio cds (LP: #346245)
  - musicvideophotos.xml - use direct link to brasero manual
  - Make titles of documents in yelp indexes match the title of the documents themselves (LP: #345852)
  - Refresh pot templates

* [Dougie Richardson]
  - basic-commands.xml - paste instructions correction (LP: #341534)
  - internet/troubleshooting.xml - changing bad wording
  - video.xml - dvd support requires gstreamer-ugly (LP: #338321)
  - connecting.xml - modem instructions (LP: #310331)

* [Adam Sommer] - Server Guide
  - Updated OpenLDAP section for new /etc/default/slapd configuration.
  - Added instructions for setting correct ACL for the Kerberos keys.
  - virtualization.xml - new Eucalyptus and OpenNebula sections
  - installation.xml:
    * rewrite of Extending Volume Groups section (LP: #347201, LP: #346862, and LP: #346859)
    * Updates for Jaunty.
  - security.xml:
    * Updated Firewall section for Jaunty.
    * Corrected "sudo ufw app info Samba" command (LP: #346327).
  - dns.xml - fixing grammar and spelling mistakes (LP: #348032, LP: #348023, LP: #348094).
  - windows-networking - Updated Likewise Open section for Jaunty (feedback from Thierry Carrez).

* [Phil Bull]
  - about-ubuntu.xml - minor edits and updates, simplify a few sentences
  - add-applications.xml:
    * Add new entity for Software Sources, with sensible name
    * Simplify structure
    * Reduce verbosity, concentrate on the instructions
    * Separate-out conceptual information into dedicated sections

* [Nathan Handler]
  - virtualization.xml - typo (LP: #343633)

* [Dean Sas]
  - music.xml - volume control preferences fix (LP: #346957)

* [Tim Bosse]
  - connecting.xml - add basic VPN instructions

Show diffs side-by-side

added added

removed removed

Lines of Context:
878
878
          <title>OpenSSH</title>
879
879
 
880
880
          <para>
881
 
          Another convenient tool that we want to have on our appliance is OpenSSH, as it will provide our admins to access 
882
 
          to access the appliance remotely. However, pushing in the wild an appliance with a pre-installed OpenSSH server 
883
 
          is a big security risk as all these server will share the same secret key, making it very easy for hackers to target 
884
 
          our appliance with all the tools they need to crack it open in a breeze. As for the user password, we will instead 
885
 
          rely on a script that will install OpenSSH the first time a user logs in so that the key generated will be different 
886
 
          for each appliance. For this we'll use a <emphasis>--firstboot</emphasis> script, as it does not need any user interaction. 
 
881
          Another convenient tool that we want to have on our appliance is OpenSSH, as it will allow our admins to access 
 
882
          the appliance remotely. However, pushing in the wild an appliance with a pre-installed OpenSSH server is a big security
 
883
          risk as all these server will share the same secret key, making it very easy for hackers to target our appliance with all
 
884
          the tools they need to crack it open in a breeze. As for the user password, we will instead rely on a script that will
 
885
          install OpenSSH the first time a user logs in so that the key generated will be different for each appliance. For this
 
886
          we'll use a <emphasis>--firstboot</emphasis> script, as it does not need any user interaction.
887
887
          </para>
888
888
 
889
889
        </sect4>
1178
1178
      </itemizedlist>
1179
1179
    </sect2>
1180
1180
  </sect1>
 
1181
  <sect1 id="eucalyptus" status="review">
 
1182
    <title>Eucalyptus</title>
 
1183
 
 
1184
    <sect2 id="eucalyptus-overview" status="review">
 
1185
      <title>Overview</title>
 
1186
 
 
1187
      <para>
 
1188
      <emphasis>Eucalyptus</emphasis> is an open-source software infrastructure for implementing "cloud computing" on your own clusters. 
 
1189
      <emphasis>Eucalyptus</emphasis> allows you to create your own cloud computing environment in order to maximize computing resources
 
1190
      and provide a cloud computing environment to your users. 
 
1191
      </para>
 
1192
 
 
1193
      <para>
 
1194
      This section will cover setting up a Cloud Computing environment using <application>Eucalyptus</application> with 
 
1195
      <application>KVM</application>. For more information on KVM see <xref linkend="libvirt"/>.
 
1196
      </para>
 
1197
 
 
1198
      <para>
 
1199
      The Cloud Computing environment will consist of three components, typically installed on at least two separate machines 
 
1200
      (termed the 'front-end' and 'node(s)' for the rest of this document): 
 
1201
      </para>
 
1202
 
 
1203
      <itemizedlist>
 
1204
        <listitem>
 
1205
          <para>
 
1206
          <emphasis>One Front-End:</emphasis> hosts one Cloud Controller, a Java based Web configuration interface, and a Cluster Controller,
 
1207
          which determines where virtual machines (VMs) will be housed and manages cluster level VM networking. 
 
1208
          </para>
 
1209
        </listitem>
 
1210
        <listitem>
 
1211
          <para>
 
1212
          <emphasis>One or more Compute Nodes:</emphasis> runs the Node Controller component of Eucalyptus, which allows the machine to be part 
 
1213
          of the cloud as a host for VMs. 
 
1214
          </para>
 
1215
        </listitem>
 
1216
      </itemizedlist>
 
1217
 
 
1218
      <para>
 
1219
      The simple <emphasis>System</emphasis> networking option will be used by default. This network method allows virtual machine instances, to 
 
1220
      obtain IP addresses from the local LAN, assuming that a DHCP server is properly configured on the LAN to hand out IPs dynamically to VMs 
 
1221
      that request them. Each node will be configured for bridge  networking. For more details see <xref linkend="bridging"/>. 
 
1222
      </para>
 
1223
 
 
1224
    </sect2>
 
1225
    <sect2 id="eucalyptus-configuration" status="review">
 
1226
      <title>Configuration</title>
 
1227
 
 
1228
      <para>
 
1229
      First, on the <emphasis>Front-End</emphasis> install the appropriate packages. In a terminal prompt on the Front-End enter: 
 
1230
      </para>
 
1231
 
 
1232
<screen>
 
1233
<command>sudo apt-get install eucalyptus-cloud eucalyptus-cc</command>
 
1234
</screen>
 
1235
 
 
1236
      <para>
 
1237
      Next, on the each <emphasis>Compute Node</emphasis> install the node controller package. In a terminal prompt on each Compute Node enter: 
 
1238
      </para>
 
1239
 
 
1240
<screen>
 
1241
<command>sudo apt-get install eucalyptus-nc</command>
 
1242
</screen>
 
1243
 
 
1244
      <para>
 
1245
      Once the installation is complete, and it may take a while, in a browser go to <emphasis>https://front-end:8443</emphasis> and login to the 
 
1246
      administration interface using the default username and password of <emphasis>admin</emphasis>. You will then be prompted to change the 
 
1247
      password, configure an email address for the admin user, and set the storage URL. 
 
1248
      </para>
 
1249
 
 
1250
      <para>
 
1251
      In the web interface's <emphasis>"Configuration"</emphasis> tab, add a cluster under the <emphasis>"Clusters"</emphasis> heading 
 
1252
      (in this configuration, the cluster controller is on the same system as the cloud controller, so entering 'localhost' as the cluster hostname is correct). 
 
1253
      Once the form is filled out click the <emphasis>"Add Cluster"</emphasis>  button. 
 
1254
      </para>
 
1255
 
 
1256
      <para>
 
1257
      Now, back on the <emphasis>Front-End</emphasis>, add the nodes to the cluster:
 
1258
      </para>
 
1259
 
 
1260
<screen>
 
1261
<command>sudo euca_conf -addnode hostname_of_node</command>
 
1262
</screen>
 
1263
 
 
1264
      <para>
 
1265
      You will then be prompted to log into your Node, install the <application>eucalyptus-nc</application> package, and add the <emphasis>eucalyptus</emphasis>
 
1266
      user's ssh key to the node's <filename>authorized_keys</filename> file, and confirm authenticity of the host's OpenSSH RSA key fingerprint. 
 
1267
      Finally, the command will complete by synchronizing the eucalyptus component keys and node registration is complete.
 
1268
      </para>
 
1269
 
 
1270
      <para>
 
1271
      On the Node, the <filename>/etc/eucalyptus/eucalyptus.conf</filename> configuration file will need editing to use your node's bridge interface 
 
1272
      (assuming here that the interface is named <emphasis>'br0'</emphasis>): 
 
1273
      </para>
 
1274
 
 
1275
<programlisting>
 
1276
VNET_INTERFACE="br0"
 
1277
...
 
1278
VNET_BRIDGE="br0"
 
1279
</programlisting>
 
1280
 
 
1281
      <para>
 
1282
      Finally, restart <application>eucalyptus-nc</application>:
 
1283
      </para>
 
1284
 
 
1285
<screen>
 
1286
<command>sudo /etc/init.d/eucalyptus-nc restart</command>
 
1287
</screen>
 
1288
 
 
1289
 
 
1290
      <note>
 
1291
        <para>
 
1292
        Be sure to replace <emphasis>nodecontroller</emphasis>, <emphasis>node01</emphasis>, and <emphasis>node02</emphasis> 
 
1293
        with actual hostnames.
 
1294
        </para>
 
1295
      </note>
 
1296
 
 
1297
      <para>
 
1298
      <application>Eucalyptus</application> is now ready to host images on the cloud. 
 
1299
      </para>
 
1300
 
 
1301
    </sect2>
 
1302
    <sect2 id="eucalyptus-references" status="review">
 
1303
      <title>References</title>
 
1304
 
 
1305
      <itemizedlist>
 
1306
        <listitem>
 
1307
          <para>
 
1308
          See the <ulink url="http://eucalyptus.cs.ucsb.edu/">Eucalyptus website</ulink> for more information.
 
1309
          </para>
 
1310
        </listitem>
 
1311
        <listitem>
 
1312
          <para>
 
1313
          For information on loading instances see the <ulink url="https://help.ubuntu.com/community/Eucalyptus">Eucalyptus Wiki</ulink> page.
 
1314
          </para>
 
1315
        </listitem>
 
1316
        <listitem>
 
1317
          <para>
 
1318
          You can also find help in the <emphasis>#ubuntu-virt</emphasis>, <emphasis>#eucalyptus</emphasis>, and 
 
1319
          <emphasis>#ubuntu-server</emphasis> IRC channels on <ulink url="http://freenode.net">Freenode</ulink>.
 
1320
          </para>
 
1321
        </listitem>
 
1322
      </itemizedlist>
 
1323
      
 
1324
    </sect2>
 
1325
  </sect1>  
 
1326
<sect1 id="opennebula" status="review">
 
1327
    <title>OpenNebula</title>
 
1328
 
 
1329
    <para>
 
1330
    <application>OpenNebula</application> allows virtual machines to be placed and re-placed dynamically on a pool of physical resources.
 
1331
    This allows a virtual machine to be hosted from any location available.  
 
1332
    </para>
 
1333
 
 
1334
    <para>
 
1335
    This section will detail configuring an OpenNebula cluster using three machines: one <emphasis>Front-End</emphasis> host, and two 
 
1336
    <emphasis>Compute Nodes</emphasis> used to run the virtual machines. The Compute Nodes will also need a bridge configured to allow the 
 
1337
    virtual machines access to the local network.  For details see <xref linkend="bridging"/>.
 
1338
    </para>
 
1339
 
 
1340
    <sect2 id="opennebula-installation" status="review">
 
1341
      <title>Installation</title>
 
1342
 
 
1343
      <para>
 
1344
      First, from a terminal on the Front-End enter:
 
1345
      </para>
 
1346
 
 
1347
<screen>
 
1348
<command>sudo apt-get install opennebula</command>
 
1349
</screen>
 
1350
  
 
1351
      <para>
 
1352
      On each Compute Node install:
 
1353
      </para>
 
1354
 
 
1355
<screen>
 
1356
<command>sudo apt-get install opennebula-node</command>
 
1357
</screen>
 
1358
 
 
1359
      <para>
 
1360
      In order to copy SSH keys, the <emphasis>oneadmin</emphasis> user will need to have a password.  On each machine execute:
 
1361
      </para>
 
1362
 
 
1363
<screen>
 
1364
<command>sudo passwd oneadmin</command>
 
1365
</screen>
 
1366
 
 
1367
      <para>
 
1368
      Next, copy the <emphasis>oneadmin</emphasis> user's SSH key to the Compute Nodes, and to the Front-End's <filename>authorized_keys</filename> file:
 
1369
      </para>
 
1370
 
 
1371
<screen>
 
1372
<command>sudo scp /var/lib/one/.ssh/id_rsa.pub oneadmin@node01:/var/lib/one/.ssh/authorized_keys</command>
 
1373
<command>sudo scp /var/lib/one/.ssh/id_rsa.pub oneadmin@node02:/var/lib/one/.ssh/authorized_keys</command>
 
1374
<command>sudo sh -c "cat /var/lib/one/.ssh/id_rsa.pub >> /var/lib/one/.ssh/authorized_keys"</command>
 
1375
</screen>  
 
1376
 
 
1377
      <para>
 
1378
      The SSH key for the Compute Nodes needs to be added to the <filename>/etc/ssh/ssh_known_hosts</filename> file on the Front-End host.  To accomplish
 
1379
      this <application>ssh</application> to each Compute Node as a user other than <emphasis>oneadmin</emphasis>.  Then exit from the SSH session, and 
 
1380
      execute the following to copy the SSH key from <filename>~/.ssh/known_hosts</filename> to <filename>/etc/ssh/ssh_known_hosts</filename>:
 
1381
      </para>
 
1382
 
 
1383
<screen>
 
1384
<command>sudo sh -c "ssh-keygen -f .ssh/known_hosts -F node01 1>> /etc/ssh/ssh_known_hosts"</command>
 
1385
<command>sudo sh -c "ssh-keygen -f .ssh/known_hosts -F node02 1>> /etc/ssh/ssh_known_hosts"</command>
 
1386
</screen>
 
1387
 
 
1388
      <note>
 
1389
        <para>
 
1390
        Replace <emphasis>node01</emphasis> and <emphasis>node02</emphasis> with the appropriate host names.
 
1391
        </para>
 
1392
      </note>
 
1393
 
 
1394
      <para>
 
1395
      This allows the <emphasis>oneadmin</emphasis> to use <application>scp</application>, without a password or manual intervention, to deploy an
 
1396
      image to the Compute Nodes.
 
1397
      </para>
 
1398
 
 
1399
      <para>
 
1400
      On the Front-End create a directory to store the VM images, giving the <emphasis>oneadmin</emphasis> user access to the directory:
 
1401
      </para>
 
1402
 
 
1403
<screen>
 
1404
<command>sudo mkdir /var/lib/one/images</command>
 
1405
<command>sudo chown oneadmin /var/lib/one/images/</command>
 
1406
</screen>
 
1407
 
 
1408
      <para>
 
1409
      Finally, copy a virtual machine disk file into <filename>/var/lib/one/images</filename>.  You can create an Ubuntu virtual machine
 
1410
      using <application>vmbuilder</application>, see <xref linkend="jeos-and-vmbuilder"/> for details.
 
1411
      </para>
 
1412
 
 
1413
    </sect2>
 
1414
    <sect2 id="opennebula-configuration" status="review">
 
1415
      <title>Configuration</title>
 
1416
    
 
1417
      <para>
 
1418
      The <emphasis>OpenNebula Cluster</emphasis> is now ready to be configured, and virtual machines added to the cluster.
 
1419
      </para>
 
1420
 
 
1421
      <para>
 
1422
      From a terminal prompt enter:
 
1423
      </para>
 
1424
 
 
1425
<screen>
 
1426
<command>onehost create node01 im_kvm vmm_kvm tm_ssh</command>
 
1427
<command>onehost create node02 im_kvm vmm_kvm tm_ssh</command>
 
1428
</screen>
 
1429
 
 
1430
      <para>
 
1431
      Next, create a <emphasis>Virtual Network</emphasis> template file named <filename>vnet01.template</filename>:
 
1432
      </para>
 
1433
 
 
1434
<programlisting>
 
1435
NAME            = "LAN"
 
1436
TYPE            = RANGED
 
1437
BRIDGE          = br0
 
1438
NETWORK_SIZE    = C
 
1439
NETWORK_ADDRESS = 192.168.0.0
 
1440
</programlisting>
 
1441
 
 
1442
      <note>
 
1443
        <para>
 
1444
        Be sure to change <emphasis>192.168.0.0</emphasis> to your local network.
 
1445
        </para>
 
1446
      </note>
 
1447
 
 
1448
      <para>
 
1449
      Using the <application>onevnet</application> utility, add the virtual network to OpenNebula:
 
1450
      </para>
 
1451
 
 
1452
<screen>
 
1453
<command>onevnet create vnet01.template</command>
 
1454
</screen>
 
1455
 
 
1456
      <para>
 
1457
      Now create a <emphasis>VM Template</emphasis> file named <filename>vm01.template</filename>:
 
1458
      </para>
 
1459
 
 
1460
<programlisting>
 
1461
NAME   = vm01
 
1462
CPU    = 0.5
 
1463
MEMORY = 512
 
1464
 
 
1465
OS      = [ BOOT   = hd ]
 
1466
 
 
1467
DISK   = [
 
1468
  source   = "/var/lib/one/images/vm01.qcow2",
 
1469
  target   = "hda",
 
1470
  readonly = "no" ]
 
1471
 
 
1472
NIC    = [ NETWORK="LAN" ]
 
1473
 
 
1474
GRAPHICS = [type="vnc",listen="127.0.0.1",port="-1"]
 
1475
</programlisting>
 
1476
 
 
1477
      <para>
 
1478
      Start the virtual machine using <application>onevm</application>:
 
1479
      </para>
 
1480
 
 
1481
<screen>
 
1482
<command>onevm submit vm01.template</command>
 
1483
</screen>
 
1484
 
 
1485
      <para>
 
1486
      Use the <application>onevm list</application> option to view information about virtual machines.  Also, the <application>onevm show vm01</application> 
 
1487
      option will display more details about a specific virtual machine.
 
1488
      </para>
 
1489
 
 
1490
    </sect2>
 
1491
    <sect2 id="opennebula-references" status="review">
 
1492
      <title>References</title>
 
1493
 
 
1494
      <itemizedlist>
 
1495
        <listitem>
 
1496
          <para>
 
1497
          See the <ulink url="http://www.opennebula.org/doku.php?id=start">OpenNebula website</ulink> for more information.
 
1498
          </para>
 
1499
        </listitem>
 
1500
        <listitem>
 
1501
          <para>
 
1502
          You can also find help in the <emphasis>#ubuntu-virt</emphasis> and 
 
1503
          <emphasis>#ubuntu-server</emphasis> IRC channels on <ulink url="http://freenode.net">Freenode</ulink>.
 
1504
          </para>
 
1505
        </listitem>
 
1506
      </itemizedlist>
 
1507
 
 
1508
    </sect2>
 
1509
  </sect1>
1181
1510
</chapter>