aboutsummaryrefslogtreecommitdiffstats
path: root/tests/dbal/sql_insert_buffer_test.php
blob: b0e678b9daef661145424b4683403b12431dca8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/

class phpbb_dbal_sql_insert_buffer_test extends phpbb_database_test_case
{
	protected $db;
	protected $buffer;

	public function setUp(): void
	{
		parent::setUp();

		$this->db = $this->new_dbal();
		$this->buffer = new \phpbb\db\sql_insert_buffer($this->db, 'phpbb_config', 2);
		$this->assert_config_count(2);
	}

	public function getDataSet()
	{
		return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config.xml');
	}

	public function test_multi_insert_disabled_insert_and_flush()
	{
		$this->db->set_multi_insert(false);
		$this->assertTrue($this->buffer->insert($this->get_row(1)));
		$this->assert_config_count(3);
		$this->assertFalse($this->buffer->flush());
		$this->assert_config_count(3);
	}

	public function test_multi_insert_enabled_insert_and_flush()
	{
		$this->check_multi_insert_support();
		$this->assertFalse($this->buffer->insert($this->get_row(1)));
		$this->assert_config_count(2);
		$this->assertTrue($this->buffer->flush());
		$this->assert_config_count(3);
	}

	public function test_multi_insert_disabled_insert_with_flush()
	{
		$this->db->set_multi_insert(false);
		$this->assertTrue($this->buffer->insert($this->get_row(1)));
		$this->assert_config_count(3);
		$this->assertTrue($this->buffer->insert($this->get_row(2)));
		$this->assert_config_count(4);
	}

	public function test_multi_insert_enabled_insert_with_flush()
	{
		$this->check_multi_insert_support();
		$this->assertFalse($this->buffer->insert($this->get_row(1)));
		$this->assert_config_count(2);
		$this->assertTrue($this->buffer->insert($this->get_row(2)));
		$this->assert_config_count(4);
	}

	public function test_multi_insert_disabled_insert_all_and_flush()
	{
		$this->db->set_multi_insert(false);
		$this->assertTrue($this->buffer->insert_all($this->get_rows(3)));
		$this->assert_config_count(5);
	}

	public function test_multi_insert_enabled_insert_all_and_flush()
	{
		$this->check_multi_insert_support();
		$this->assertTrue($this->buffer->insert_all($this->get_rows(3)));
		$this->assert_config_count(4);
		$this->assertTrue($this->buffer->flush());
		$this->assert_config_count(5);
	}

	protected function assert_config_count($num_configs)
	{
		$sql = 'SELECT COUNT(*) AS num_configs
			FROM phpbb_config';
		$result = $this->db->sql_query($sql);
		$this->assertEquals($num_configs, $this->db->sql_fetchfield('num_configs'));
		$this->db->sql_freeresult($result);
	}

	protected function check_multi_insert_support()
	{
		if (!$this->db->get_multi_insert())
		{
			$this->markTestSkipped('Database does not support multi_insert');
		}
	}

	protected function get_row($rownum)
	{
		return array(
			'config_name'	=> "name$rownum",
			'config_value'	=> "value$rownum",
			'is_dynamic'	=> '0',
		);
	}

	protected function get_rows($n)
	{
		$result = array();
		for ($i = 0; $i < $n; ++$i)
		{
			$result[] = $this->get_row($i);
		}
		return $result;
	}
}
a id='n421' href='#n421'>421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487
<?xml version="1.0"  encoding="ISO-8859-1"?>
  <article lang="en">
	  <title>Clone a node/computer using KA method</title>
	  <sect1><title>CLONING WILL ERASE ALL CLIENT NODES DATA !</title><para>!! USE WITH CARE !! </para></sect1>
  <sect1>
    <title>Clone a computer over the network</title>
    <para>
	    Goal of duplication is to easily deploy a computer over network without taking care of numbers of computer. In this documentation, we call golden node the node we want to clone. We can duplicate SCSI or IDE hard drive, and duplication support multiple filesystem (reiserfs, ext2, ext3, ext4, xfs, jfs).
	    This method came from a very old project called CLIC, and was used under IGGI project, all Mandrake Clustering products, and now it is used under XtreemOS project. Now it should be available in 2010 spring, and all futur product.
    </para>
    <para>WARNING: all data on client nodes will be ERASED ! We duplicate partitions of HDD's golden node, and the process will do an fdisk command on the client node, so ALL YOUR DATA will be erased on client nodes.</para>
    <sect2>
      <title>KA method</title>
      <para>
	With KA method you can quickly duplicate a node using a <emphasis role="bold">desc</emphasis>
	file describing partitions. KA method only duplicate data on partitions, so if you have 80go HDD disk, and
	only 10go on it, KA only duplicates 10go, and not the whole disk. KA method doesn't not support RAID software.
      </para>
      <para>
	Drawbacks:
      </para>
      <para>
	<itemizedlist>
		<listitem><para>KA method doesn't support RAID software (use dolly to do that)</para></listitem>
		<listitem><para>all data on client nodes are erased</para></listitem>
		<listitem><para>you need a PXE, DHDCP and TFTP server</para></listitem>
		<listitem><para>you must re-create same partition table as the golden node (even if size can differ)</para></listitem>
		<listitem><para>even if it has been tested, it's still an experimental method</para></listitem>
		<listitem><para>cloning script are old, and need a full rewrite</para></listitem>
		<listitem><para>now it's only works with the Mageia installer (need to patch it to support a KA method)</para></listitem>
		<listitem><para>if a node crash while doing a duplication, the duplication process stop (or became very unstable)</para></listitem>
		<listitem><para>using fdisk to erase and re-format the HDD is not a good way to proceed</para></listitem>
		<listitem><para>UUID support is not really done (fstab use old /dec/sdX)</para></listitem>
		<listitem><para>you can only clone Linux filesystems (if you want to duplicate another kinf of FS, it's up to you to modify the scripts)</para></listitem>
		<listitem><para>of course various other things !</para></listitem>
	</itemizedlist>
      </para>
    </sect2>
    <sect2>
      <title>HOW it works</title>
      <sect3>
	<title>Steps</title>
	<para>
	  The clone process works in three steps
	</para>
	<itemizedlist>
	  <listitem><para><emphasis role="bold">PXE boot to retrieve stage1</emphasis>: the computer boot on PXE mode, retrieve <emphasis role="bold">vmlinuz</emphasis> and an <emphasis role="bold">initrd</emphasis> image. The computer is in <emphasis role="bold">stage1</emphasis> mode, and is able to get the stage2 throug KA. Network is up.</para></listitem>
	  <listitem><para><emphasis role="bold">get stage2</emphasis>: the computer gets the stage2 with the KA method. The <emphasis role="bold">stage2</emphasis> contains all necessary tools to recognize your hardware (the most important things is to detect your HDD and your network card), and all necessary tools/scripts to finalize the cloning process.</para></listitem>
	  <listitem><para><emphasis role="bold">Duplication process</emphasis>: the computer auto-probes needed modules to be able to access the HDD. A basic log server is launched on the client node to be able to run command and get status of the KA duplication process. The computer reconfigure the modprobe.conf and restore the booloader (grub or lilo)</para></listitem>
	</itemizedlist>
      </sect3>
      <sect3>
	<title>Needed files</title>
	<para>
	  All needed files are available in Mageia cooker.
	</para>
	<para>
	  <itemizedlist>
	    <listitem><para><emphasis role="bold">install/stage2/rescue.sqfs</emphasis>: this is the stage2 file with all needed files to detect and probe modules, and launch the third step of the duplication process. This file will be used on the golden node.</para></listitem>
	    <listitem><para><emphasis role="bold">isolinux/alt0/vmlinuz</emphasis>: linux kernel, needed in the <emphasis role="bold">/var/lib/tftpboot/X86PC/linux/images/</emphasis> directory of the PXE server</para></listitem>
	    <listitem><para><emphasis role="bold">isolinux/alt0/all.rdz</emphasis>: stage1 and all needed modules and tools.</para></listitem>
	  </itemizedlist>
	</para>
      </sect3>
    </sect2>
    <sect2>
      <title>Step 1: PXE, TFTP, DHCPD services</title>
      <para>
	To easily clone a computer node, we use PXE technology to boot a <emphasis role="bold">kernel</emphasis>, and an <emphasis role="bold">initrd</emphasis> image wich contains all needed modules for network and media storage. Documentation about PXE can be found here: <ulink url="http://people.mandriva.com/~aginies/doc/pxe/">PXE doc</ulink>. Please, keep in mind setting such services can <emphasis role="bold">DISTURB</emphasis> your current network architecture.
      </para>
      <sect3>
	<title>PXE parameters on server</title>
	<para>
	  Mageia installer supports various methods to install a computer. With PXE configuration file you can specify wich method you want to use to install your node, or add a specific option at boot prompt. Edit your default PXE configuration file to add your custom entry (<emphasis role="bold">/var/lib/tftpboot/X86PC/linux/pxelinux.cfg/default</emphasis>).
	</para>
	<para>
	  <screen>
PROMPT 1
DEFAULT local
DISPLAY messages
TIMEOUT 50
F1 help.txt

label local
    LOCALBOOT 0

label kamethod
    KERNEL images/vmlinuz
    APPEND initrd=images/all.rdz ramdisk_size=64000 vga=788 \
	      automatic=method:ka,interface:eth0,network:dhcp root=/dev/ram3 rw kamethod</screen>
	</para>
	<para>
	  At boot prompt no you can boot:
	</para>
	<para>
	  <itemizedlist>
	    <listitem><para><emphasis role="bold">DEFAULT local</emphasis>: default boot will be local one, change it with the name of a <emphasis role="bold">LABEL</emphasis></para></listitem>
	    <listitem><para><emphasis role="bold">local</emphasis>: boot local</para></listitem>
	    <listitem><para><emphasis role="bold">kamethod</emphasis>: automatic mode, get stage2 through <emphasis role="bold">KA</emphasis>. Network interface is set to eth0. Auto setup the network with DHCP, and use the KA technology to launch the replication method.</para></listitem>
	  </itemizedlist>
	</para>
      </sect3>
      <sect3>
	<title>TFTP server</title>
	<para>
	  TFTP server should be activated in <emphasis role="bold">/etc/xinetd.d/tftp</emphasis> file, and the <emphasis role="bold">xinetd</emphasis> service started.
	</para>
	<para>
	  <screen>
service tftp
{
	    disable= no
	    socket_type= dgram
	    protocol= udp
	    wait= yes
	    user= root
	    server= /usr/sbin/in.tftpd
	    server_args = -s /var/lib/tftpboot
	    per_source= 11
	    cps= 100 2
	    flags= IPv4
}</screen>
	</para>
      </sect3>
      <sect3>
	<title>PXE configuration</title>
	<para>
<programlisting><![CDATA[
# which interface to use
interface=eth0
default_address=IPADDR_PXE

# the multicast ip address to listen on
multicast_address=224.0.1.2

# mtftp info
mtftp_address=IPADDR_TFTP
mtftp_client_port=1758
mtftp_server_port=1759

# the port to listen on
listen_port=4011

# enable multicast?
use_multicast=1

# enable broadcast?
use_broadcast=0

# user prompt
prompt=Press F8 to view menu ...
prompt_timeout=2

# what services to provide, priority in ordering
# CSA = Client System Architecture
# service=<CSA>,<min layer>,<max layer>,<basename>,<menu entry>
service=X86PC,0,2,linux,Mageia x86
service=IA64PC,0,2,linux,Mageia IA64
service=X86PC,0,0,local,Local boot

# tftpd base dir
tftpdbase=/

# domain=guibland.com
domain=
]]></programlisting>
	</para>
      </sect3>
      <sect3>
	<title>DHCPD configuration</title>
	<para>
	  IE of an <emphasis role="bold">/etc/dhcpd.conf</emphasis> configuration file. Change <emphasis role="bold">IPADDR_TFTP</emphasis> with the IP address of the TFTP serrver, and the <emphasis role="bold">NET</emphasis> value. Don't forget to adjust the <emphasis role="bold">domain-name</emphasis> and the <emphasis role="bold">domain-name-servers</emphasis>.
	</para>
	<para>
	  <screen>
ddns-update-style none;
allow booting;
allow bootp;

authoritative;

# Definition of PXE-specific options
# Code 1: Multicast IP address of bootfile
# Code 2: UDP port that client should monitor for MTFTP responses
# Code 3: UDP port that MTFTP servers are using to listen for MTFTP requests
# Code 4: Number of secondes a client must listen for activity before trying
#         to start a new MTFTP transfer
# Code 5: Number of secondes a client must listen before trying to restart
#         a MTFTP transfer

# define Option for the PXE class
option space PXE;
option PXE.mtftp-ip code 1 = ip-address;
option PXE.mtftp-cport code 2 = unsigned integer 16;
option PXE.mtftp-sport code 3 = unsigned integer 16;
option PXE.mtftp-tmout code 4 = unsigned integer 8;
option PXE.mtftp-delay code 5 = unsigned integer 8;
option PXE.discovery-control code 6 = unsigned integer 8;
option PXE.discovery-mcast-addr code 7 = ip-address;

#Define options for pxelinux
option space pxelinux;
option pxelinux.magic code 208 = string;
option pxelinux.configfile code 209 = text;
option pxelinux.pathprefix code 210 = text;
option pxelinux.reboottime code 211 = unsigned integer 32;
site-option-space "pxelinux";

option pxelinux.magic f1:00:74:7e;
option pxelinux.reboottime 30;

#Class that determine the options for Etherboot 5.x requests
class "Etherboot" {
#if The vendor-class-identifier equal Etherboot-5.0
match if substring (option vendor-class-identifier, 0, 13) = "Etherboot-5.0";
# filename define the file retrieve by the client, there nbgrub
# our tftp is chrooted so is just the path to the file
filename "/etherboot/nbgrub";
#Used by etherboot to detect a valid pxe dhcp server
option vendor-encapsulated-options 3c:09:45:74:68:65:72:62:6f:6f:74:ff;
# Set the  "vendor-class-identifier" field to "PXEClient" in dhcp answer
# if this field is not set the pxe client will ignore the answer !
option vendor-class-identifier "Etherboot-5.0";
vendor-option-space PXE;
option PXE.mtftp-ip 0.0.0.0;
# IP of you TFTP server
next-server IPADDR_TFTP;
}

# create the Class PXE
class "PXE" {
# if the "vendor-class-identifier" is set to "PXEClient" in the client dhcp request
match if substring(option vendor-class-identifier, 0, 9) = "PXEClient";
filename "/X86PC/linux/linux.0";
option vendor-class-identifier "PXEClient";
vendor-option-space PXE;
option PXE.mtftp-ip 0.0.0.0;
next-server IPADDR_TFTP;
}

#host node20 {
#    hardware ethernet 00:40:CA:8C:B6:E9;
#    fixed-address node20;
#}

subnet NET.0 netmask 255.255.255.0 {
  option subnet-mask 255.255.255.0;
  option routers IPADDR_GW;
  default-lease-time 288000;
  max-lease-time 864000;
  option domain-name "guibland.com";
  option domain-name-servers IPADDR_DNS;
  next-server IPADDR_TFTP;
  pool {
  range NET.30 NET.40;
  }
}</screen>
	</para>
      </sect3>
    </sect2>
  </sect1>

  <sect1>
    <title>Setup a node as a golden node</title>
    <sect2>
      <title>The rescue.sqfs file</title>
      <para>
	You need the rescue disk (wich contains the <emphasis role="bold">/ka</emphasis> directory),
	Just extract this file, and copy all directory in <emphasis role="bold">/mnt/ka</emphasis>.
      </para>
      <para>
	<screen>
[root@guibpiv ~]# mkdir /mnt/ka
[root@guibpiv ~]# cd /mnt/ka/
[root@guibpiv ka]# unsquashfs rescue.sqfs
[root@guibpiv ka]# mv squashfs-root/* .
[root@guibpiv ka]# ls
bin/  dev/  etc/  ka/  lib/  modules/  proc/  sbin/  squashfs-root/  tmp/  usr/  var/
</screen>
      </para>
      <para>
	  Go in the <emphasis role="bold">/mnt/ka/ka</emphasis> directory, and see all new files available. All those files are needed to do a <emphasis role="bold">KA</emphasis> duplication process. We will explain now the rule of each of them. You can modify all them, those files will be copied in the directory <emphasis role="bold">/tmp/stage2</emphasis> of the client node of the duplication process (second step).
      </para>
      <sect3>
	<title>ka-d.sh</title>
	<para>
		This is the master script to declare a node as a golden node. This script takes a lot of arguments. This script should be run
		on the host wich have the <emphasis role="bold">/mnt/ka</emphasis> directory.
<screen>
    -h, --help : display this message
    -n num : specify the number of (destination) nodes
    -x dir : exclude directory
    -X sdb|sdc : exclude sdb for the replication
    -m drive : copy the master boot record (for windows) of this drive (not really tested yet)
    -M drive file : use 'file' as master boot record (must be 446 bytes long) for the specified drive
    -D partition : also copy partition 'partition'
    -p drive pdesc : use 'pdesc' file as partition scheme (see doc) for the specified drive
    -d delay : delay beteween the release of 2 clients (1/10 second)
    -r 'grub|lilo' : choose the bootloader (you can add mkinitrd options)

    ie: ka-d.sh -n 3 -p sda /tmp/desc -X 'sdb|sdc' -r 'grub --with=ata_piix --with=piix'</screen>
	</para>
      </sect3>
      <sect3>
        <title>replication.conf</title>
	<para>
	  This file contains all variables needed by other scripts. It also tries to get information like IP address.
	</para>
      </sect3>
      <sect3>
	<title>fdisk_to_desc</title>
	<para>
	  This script generate the description table of the hard drive disk in the <emphasis role="bold">/tmp/desc</emphasis> file.
	  This file must follow some rules: one line per partition, with two fields : type of partition and size in megabytes.
	  The  type  can be linux, swap, extended. Other types can be obtained by appending their hexadecimal number to 'type'.
	  For example linux is the same as type83. The size is either a number of megabytes, or the keyword fill (to take all
	  available space). The logical  partitions must have the logical keyword. Do a <emphasis role="bold">man ka-d</emphasis> for more help.
	</para>
      </sect3>
      <sect3>
	<title>gen_modprobe_conf.pl</title>
	<para>
	  This script creates a basic output like the content of the<emphasis role="bold">/etc/modprobe.conf</emphasis> file. Drawbacks
	  this file must be updated for each new modules available in the kernel (based on the <emphasis role="bold">kernel/list_modules.pm</emphasis> file).
	</para>
      </sect3>
      <sect3>
	<title>ka-d-client</title>
	<para>
	  The <emphasis role="bold">ka-d-client</emphasis> binary file is used to get stage2 with the <emphasis role="bold">KA</emphasis> method, and after get the whole system. The important argument is the <emphasis role="bold">-s</emphasis> session name. A <emphasis role="bold">KA</emphasis> can only connect to a specific session (getstage2, kainstall ...). The code source is available in the ka-deploy SRPM.
	</para>
      </sect3>
      <sect3>
	<title>ka-d-server</title>
	<para>
	    The <emphasis role="bold">ka-d-server</emphasis> binary file is used to be a <emphasis role="bold">KA</emphasis> golden node server. Like the <emphasis role="bold">ka-d-client</emphasis> the session arguments is an important parameter (<emphasis role="bold">-s session_name</emphasis>). The session name will be <emphasis role="bold">getstage2</emphasis> to retrieve the stage2 (after the PXE boot) and will be <emphasis role="bold">kainstall1</emphasis> at duplication process step. If you want to do more than one duplication process of nodes at the same time, you should synchronize the ka_sesion name between the server and the client. The code source is available in the ka-deploy SRPM.
	</para>
      </sect3>
      <sect3>
	<title>ka_replication.sh</title>
	<para>
	  Script launched on the <emphasis role="bold">KA</emphasis> client (after getting stage2 and probing modules), to do the full process of the <emphasis role="bold">Ka</emphasis> duplication.
	  This script call other scripts to prepare the node (prepare_node.sh), configure the bootloader (make_initrd_grub or make_initrd_lilo).
	</para>
      </sect3>
      <sect3>
	<title>store_log.sh</title>
	<para>
	  Basic script to store the log of the <emphasis role="bold">KA</emphasis> duplication process on an FTP server. Adjust to feet your need, and uncomment the line <emphasis role="bold">#store_log.sh</emphasis> in the <emphasis role="bold">/mnt/ka/ka/ka_replication.sh</emphasis> file.
	</para>
      </sect3>
      <sect3>
	<title>bootable_flag.sh</title>
	<para>
	  Script to set bootable an HDD using fdisk. First arg must be the HDD device.
	</para>
      </sect3>
      <sect3>
        <title>make_initrd_grub</title>
	<para>
	  Restore and reload the Grub bootloader in the <emphasis role="bold">/mnt/disk</emphasis> directory. It's a very basic script, and perhaps use the <emphasis role="bold">restore_bootloader</emphasis> of the Mageia Rescue should be a better idea.</para>
      </sect3>
      <sect3>
        <title>make_initrd_lilo</title>
	<para>
	  Restore and reload the lilo bootloader in the <emphasis role="bold">/mnt/disk</emphasis> directory. Again it's a very basic script, perhaps we should use the <emphasis role="bold">restore_bootloader</emphasis> of the Mageia Rescue.
	</para>
      </sect3>
      <sect3>
        <title>prepare_node.sh</title>
	<para>
	  This script remove in the futur system the old network's udev rules, old dhcp cache files, launch the script <emphasis role="bold">gen_modprobe_conf.pl</emphasis> to regenerate an up to date <emphasis role="bold">/etc/modprobe.conf</emphasis> in the new system, and launch the script to restore the bootloader.  If you want to do more action on the installed, system, you can modify this script.
	</para>
      </sect3>
      <sect3>
        <title>send_status.pl</title>
	<para>
	  Very basic perl script to open the port 12345, and paste the content of the <emphasis role="bold">/tmp/ka*</emphasis> file. It also permit the execution of commands on node, if user send a message from the golden node with the <emphasis role="bold">exec</emphasis> prefix.
	</para>
      </sect3>
      <sect3>
        <title>status_node.pl</title>
	<para>
	  Script to connect to a client node, first arg must be the IP address of the node. You can run command on the node with the <emphasis role="bold">exec</emphasis> prefix.
	</para>
      </sect3>
    </sect2>
  </sect1>
  <sect1>
    <title>The golden node, KA server</title>
    <para>
      Now, it is time to build a description of the node partitions. You can use the script <emphasis role="bold">/mnt/ka/ka/fdisk_to_desc</emphasis> as root user, or your favorite text editor,
      you can write a file like this one:
    </para>
    <para>
      <screen>
linux 3500
extended fill
logical swap 500
logical linux fill</screen>
    </para>
    <para>
      This file describes your partition table and the sample above can be considered as a default one for a recommended
      installation. There is a 3.5GB <emphasis role="bold">/</emphasis> partition, a 500 MB swap
      partition, and <emphasis role="bold">/var</emphasis> fills the rest, of course you can adjust
      sizes accoding to your system.
    </para>
    <para>
      Type the following to start the ka replication server as root user on the golden node:
    </para>
    <para>
<programlisting><![CDATA[
[root@node40 ka]# ./ka-d.sh -n 1 -p sda /root/desc -X sdb -r "grub --with=jfs --with=ata_piix"
takembr =
desc = sda /root/desc
+ Mount points :
     /dev/sda5 / ext3
     /dev/sda1 swap swap
+ Hard drives :
     sda
+ Reading partition table description for sda
    Added partition 1 : type 82
    Added partition 5 : type 83
+ Included mount points : /
+ Bootloader is: grub --with=jfs --with=ata_piix
+++ Sending Stage2 +++
Compiled : Aug 23 2007 12:58:29
ARGS=+ka-d-server+-s+getstage2+-n+1+-e+(cd /mnt/ka; tar --create --one-file-system --sparse  . )+
Server IP = 10.0.1.40
command = (cd /mnt/ka; tar --create --one-file-system --sparse  . )
I want 1 clients
Socket 4 on port 30765 on node40.guibland.com ready.
Socket 5 on port 30764 on node40.guibland.com ready.
]]></programlisting>
    </para>
    <para>
      <itemizedlist>
	<listitem><para><emphasis role="bold">-r "grub --with=jfs --with=ata_piix"</emphasis>: use grub bootloader and <emphasis role="bold">--with=jfs --with=piix</emphasis> mkinitrd option in the chrooted system after the <emphasis role="bold">KA</emphasis> deploiement</para></listitem>
	<listitem><para><emphasis role="bold">-n nb_nodes</emphasis>: specify how many nodes are clients</para></listitem>
	<listitem><para><emphasis role="bold">-p sda desc</emphasis>: specify the name of the hdd</para></listitem>
	<listitem><para><emphasis role="bold">-x /tmp</emphasis>: exclude <emphasis role="bold">/tmp</emphasis> directory</para></listitem>
	<listitem><para><emphasis role="bold">-X sdb</emphasis>: exclude <emphasis role="bold">sdb</emphasis> hdd for the duplication</para></listitem>
      </itemizedlist>
    </para>
    <para>
      Now the golden node is waiting for clients nodes to start replication.
    </para>
  </sect1>
  <sect1>
    <title>KA client node</title>
    <sect2>
      <title>PXE server (kamethod)</title>
      <para>
	We have to configure the PXE to boot by default on <emphasis role="bold">kamethod</emphasis>.
	To do this just edit <emphasis role="bold">/var/lib/tftpboot/X86PC/linux/pxelinux.cfg/default</emphasis> and set
	  <emphasis role="bold">DEFAULT</emphasis> to kamethod:
      </para>
      <screen>DEFAULT kamethod</screen>
      <para>
	So, next time a node boots, the PXE server will force the node to boot using the kamethod entry.
      </para>
    </sect2>
    <sect2>
      <title>Stage1 KA method, node waiting stage2 </title>
      <para>
	Now, you boot all remaining nodes. The replication process
	will start once all nodes are up and waiting on the <emphasis role="bold">KA</emphasis>
	screen.
      </para>
      <para>
	If the nodes can't reach the golden node, running the <emphasis role="bold">KA</emphasis>
	server the message <emphasis role="bold">Can't reach a valid KA server</emphasis> will appear.
	Each node will try five times to reach the <emphasis role="bold">KA</emphasis> server, after that the node will reboot.
	As the node boots on <emphasis role="bold">kamethod</emphasis>, it will retry until it finds it.
      </para>
    </sect2>
    <sect2>
      <title>Stage2, the duplication process</title>
      <para>
	Once all the nodes have found the <emphasis role="bold">KA</emphasis> server, the first
	duplication process will start. This step duplicates the
	<emphasis role="bold">stage2</emphasis> from the <emphasis role="bold">/mnt/ka</emphasis> directory
	of the golden node, in the client's nodes memory (<emphasis role="bold">/dev/ram3</emphasis> formated as ext2). Then, nodes chroot their memories (the <emphasis role="bold">/tmp/stage2</emphasis> directory), and launch the <emphasis role="bold">drvinst</emphasis> command from the stage2, to probe all needed their modules (drivers). Then, the second step of the duplication starts.
      </para>
      <para>
	The duplication process will clone your drives following
	the description you have made (<emphasis role="bold">/tmp/desc</emphasis> of the golden node).
	Nodes will rewrite their partition table, then format their filesystems (ReiserFs, XFS,
	ext2/3/4, JFS). All new partitions will be mounted in the <emphasis role="bold">/mnt/disk</emphasis> directory.
	Then, the drive duplication process will begin. On a fast Ethernet switch you can reach speeds of 10MBytes/sec.
      </para>
    </sect2>
    <sect2>
      <title>Prepare the node</title>
	<para>
	At the end of the duplication process, each node will
	chroot its partitions and rebuild its <emphasis role="bold">/boot/initrd.img</emphasis>,
	and <emphasis role="bold">/etc/modprobe.conf</emphasis> files.
	This step ensures that your node will reboot using its potential
	SCSI drives and adjusting its network card driver. Before
	rebooting, each node reinstalls lilo/grub. All your node are
	now ready, and are clone of master node.
      </para>
      </sect2>
    <sect2><title>PXE server to local boot</title>
      <para>
	Don't forget to change the default PXE boot to <emphasis role="bold">local</emphasis>
	so node after replication will boot localy.
      </para>
    </sect2>
  </sect1>
  <sect1>
	  <title>Step by step from scratch KA duplication</title>
	  <para>We will use a PIV 3gz box as golden node, with a SATA hard drive, and an Intel 82540EM Gigabit Ethernet Controller card. This golden box will be the: PXE, DHCPD, TFTP server. Client nodes are</para>
	  <para>
	       <itemizedlist>
		       <listitem><para>basic PIV 2.8gz, with a Realtek Semiconductor 8139 network card, and a IDE hard drive disk</para></listitem>
	 	 	<listitem><para>PE2650 dual XEON 2.4gz, SCSI Hard Drive disk, and NetXtreme BCM5701 Gigabit Ethernet cards</para></listitem>
		</itemizedlist>
	</para>
	<para>Both nodes are configured to boot on their network card.</para>
    <sect2>
      <title>Golden node side</title>
    <para>
      Prepapre the golden node, install all needed tools.
    </para>
      <para>
<programlisting><![CDATA[
[root@localhost ~]# urpmi ka-deploy-source-node
    http://192.168.1.253/cooker/i586/media/main/release/ka-deploy-source-node-0.94.1-1mdv2010.1.i586.rpm
installing ka-deploy-source-node-0.94.1-1mdv2010.1.i586.rpm from /var/cache/urpmi/rpms                                                                   
Preparing...                     ###############################################################################
      1/1: ka-deploy-source-node ###############################################################################

[root@localhost ~]# rpm -ql ka-deploy-source-node
/etc/ka
/etc/ka/replication.conf
/usr/bin/bootable_flag.sh
/usr/bin/fdisk_to_desc
/usr/bin/gen_modprobe_conf.pl
/usr/bin/ka-d-client
/usr/bin/ka-d-server
/usr/bin/ka-d.sh
/usr/bin/ka_replication.sh
/usr/bin/make_initrd_grub
/usr/bin/make_initrd_lilo
/usr/bin/prepare_node.sh
/usr/bin/send_status.pl
/usr/bin/status_node.pl
/usr/bin/store_log.sh
/usr/bin/udev_creation.sh
/usr/share/ka-deploy-0.94.1
/usr/share/man/man1/ka-d-client.1.lzma
/usr/share/man/man1/ka-d-server.1.lzma
/usr/share/man/man1/ka-d.1.lzma
/usr/share/man/man1/ka-d.sh.1.lzma
/usr/share/man/man1/ka-deploy.1.lzma
]]></programlisting>
	</para>
	<para>Create the /mnt/ka directory, and put all stuff in it (this directory will be sent to all client nodes and use to finish
		the duplication process)</para>
	<para>
<programlisting><![CDATA[
[root@localhost ~]# mkdir /mnt/ka
lftp distrib-coffee.ipsl.jussieu.fr:~> cd pub/linux/Mageia/distrib/cauldron/i586/install/stage2/
lftp distrib-coffee.ipsl.jussieu.fr:/pub/linux/Mageia/distrib/cauldron/i586/install/stage2> pget rescue.sqfs 
19132416 bytes transferred in 78 seconds (241.1K/s)                

[root@localhost ~]# urpmi squashfs-tools                                                                      
    http://192.168.1.253/cooker/i586/media/main/release/squashfs-tools-4.0-3.20091221.1mdv2010.1.i586.rpm
installing squashfs-tools-4.0-3.20091221.1mdv2010.1.i586.rpm from /var/cache/urpmi/rpms                       
Preparing...                     ############################################################################
      1/1: squashfs-tools        ############################################################################

[root@localhost ~]# unsquashfs rescue.sqfs 
Parallel unsquashfs: Using 2 processors
988 inodes (1222 blocks) to write
[============================================================================================-] 1222/1222 100%
created 550 files
created 93 directories
created 60 symlinks
created 371 devices
created 1 fifos

[root@localhost ~]# cd squashfs-root/
[root@localhost squashfs-root]# ls
bin/  dev/  etc/  ka/  lib/  modules/  proc/  sbin/  tmp/  usr/  var/
[root@localhost squashfs-root]# mv * /mnt/ka/
]]></programlisting>
	</para>
	<para>Install all needed packages to be able to be a PXE, DHCPD and TFTP server</para>
	<para>
<programlisting><![CDATA[
[root@localhost ka]# ka-d.sh -h
/usr/bin/ka-d.sh : clone this machine
Usage:
	-h, --help : display this message
	-n num : specify the number of (destination) nodes
	-x 'dir|dir2' : exclude directory 
        -X 'sdb|sdc' : exclude sdb for the replication
        -m drive : copy the master boot record (for windows) of this drive
	-M drive file : use 'file' as master boot record (must be 446 bytes long) for the specified drive
	-D partition : also copy partition 'partition'
	-p drive pdesc : use 'pdesc' file as partition scheme (see doc) for the specified drive
	-d delay : delay beteween the release of 2 clients (1/10 second)
	-r 'grub|lilo' : choose the bootloader (you can add mkinitrd options)

	ie: ka-d.sh -n 3 -p sda /tmp/desc -X sdb -r 'grub --with=ata_piix --with=piix'

[root@localhost ka]# urpmi ka-deploy-server
To satisfy dependencies, the following packages are going to be installed:
   Package                        Version      Release       Arch   
(medium "Main")
  bind-utils                     9.7.0        4mdv2010.1    i586    
  clusterscripts-common          3.5          1mdv2010.1    noarch  
  clusterscripts-server-conf     3.5          1mdv2010.1    noarch  
  clusterscripts-server-pxe      3.5          1mdv2010.1    noarch  
  dhcp-server                    4.1.1        5mdv2010.1    i586    
  ka-deploy-server               0.94.1       1mdv2010.1    i586    
  perl-Crypt-PasswdMD5           1.300.0      1mdv2010.1    noarch  
  pxe                            1.4.2        19mdv2010.1   i586    
  pxelinux                       3.83         1mdv2010.1    i586    
  syslinux                       3.83         1mdv2010.1    i586    
  tftp-server                    5.0          4mdv2010.1    i586    
  xinetd                         2.3.14       11mdv2010.1   i586    
12MB of additional disk space will be used.
2.5MB of packages will be retrieved.
Proceed with the installation of the 12 packages? (Y/n) 
]]></programlisting>
	</para>
	<para>Configure all services</para>
	<para>
<programlisting><![CDATA[
[root@localhost ~]# hostname 
node42.guibland.com
[root@localhost ~]# domainname 
guibland.com

[root@localhost ~]# ip addr show eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 100
    link/ether 00:17:31:19:a0:78 brd ff:ff:ff:ff:ff:ff
    inet 10.0.1.42/24 brd 10.0.1.255 scope global eth0
    inet6 fe80::217:31ff:fe19:a078/64 scope link 
       valid_lft forever preferred_lft forever

[root@localhost ~]# vi /etc/pxe.conf 
# which interface to use
interface=eth0
default_address=10.0.1.42

# the multicast ip address to listen on
multicast_address=224.0.1.2

# mtftp info
mtftp_address=10.0.1.42
mtftp_client_port=1758
mtftp_server_port=1759

# the port to listen on
listen_port=4011

# enable multicast?
use_multicast=1

# enable broadcast?
use_broadcast=0

# user prompt
prompt=Press F8 to view menu ...
prompt_timeout=2

# what services to provide, priority in ordering
# CSA = Client System Architecture
# service=<CSA>,<min layer>,<max layer>,<basename>,<menu entry>
service=X86PC,0,2,linux,Mageia x86
service=IA64PC,0,2,linux,Mageia IA64
service=X86PC,0,0,local,Local boot

# tftpd base dir
tftpdbase=/

# domain name
domain=guibland.com

[root@localhost ~]# vi /etc/xinetd.d/tftp 
service tftp
{
        disable = no
        socket_type             = dgram
        protocol                = udp
        wait                    = yes
        user                    = root
        server                  = /usr/sbin/in.tftpd
        server_args             = -s /var/lib/tftpboot
        per_source              = 11
        cps                             = 100 2
        flags                   = IPv4
}


[root@localhost ~]# cp /etc/dhcpd.conf.pxe.single /etc/dhcpd.conf
cp: overwrite `/etc/dhcpd.conf'? y

[root@localhost ~]# cat /etc/resolv.conf
nameserver 10.0.1.253
search guibland.com

[root@localhost ~]# cat /etc/dhcpd.conf
# for explanation in french go to : http://www.delafond.org/traducmanfr/man/man5/dhcpd.conf.5.html
ddns-update-style none;
allow booting;
allow bootp;

# Your dhcp server is not master on your network !
#not authoritative;
# Your dhcpd server is master on your network !
#authoritative;
authoritative;

#Interface where dhcpd is active
#DHCPD_INTERFACE = "eth0";

# Definition of PXE-specific options
# Code 1: Multicast IP address of bootfile
# Code 2: UDP port that client should monitor for MTFTP responses
# Code 3: UDP port that MTFTP servers are using to listen for MTFTP requests
# Code 4: Number of secondes a client must listen for activity before trying
#         to start a new MTFTP transfer
# Code 5: Number of secondes a client must listen before trying to restart
#         a MTFTP transfer

# define Option for the PXE class
option space PXE;
option PXE.mtftp-ip code 1 = ip-address;
option PXE.mtftp-cport code 2 = unsigned integer 16;
option PXE.mtftp-sport code 3 = unsigned integer 16;
option PXE.mtftp-tmout code 4 = unsigned integer 8;
option PXE.mtftp-delay code 5 = unsigned integer 8;
option PXE.discovery-control code 6 = unsigned integer 8;
option PXE.discovery-mcast-addr code 7 = ip-address;

#Define options for pxelinux
option space pxelinux;
option pxelinux.magic      code 208 = string;
option pxelinux.configfile code 209 = text;
option pxelinux.pathprefix code 210 = text;
option pxelinux.reboottime code 211 = unsigned integer 32;
site-option-space "pxelinux";
# These lines should be customized to your setup
#option pxelinux.configfile "configs/common";
#option pxelinux.pathprefix "/pxelinux/files/";
#filename "/pxelinux/pxelinux.bin";
				
option pxelinux.magic f1:00:74:7e;
option pxelinux.reboottime 30;
#if exists dhcp-parameter-request-list {
# Always send the PXELINUX options
#	append dhcp-parameter-request-list 208, 209, 210, 211;
#	append dhcp-parameter-request-list 208,211;
#					}

#Class that determine the options for Etherboot 5.x requests
class "Etherboot" {

#if The vendor-class-identifier equal Etherboot-5.0
match if substring (option vendor-class-identifier, 0, 13) = "Etherboot-5.0";

# filename define the file retrieve by the client, there nbgrub
# our tftp is chrooted so is just the path to the file
filename "/etherboot/nbgrub";

#Used by etherboot to detect a valid pxe dhcp server
option vendor-encapsulated-options 3c:09:45:74:68:65:72:62:6f:6f:74:ff;

# Set the  "vendor-class-identifier" field to "PXEClient" in dhcp answer        
# if this field is not set the pxe client will ignore the answer !
option vendor-class-identifier "Etherboot-5.0";

vendor-option-space PXE;
option PXE.mtftp-ip 0.0.0.0;

# IP of you TFTP server
next-server 10.0.1.42;
}


# create the Class PXE
class "PXE" {
# if the "vendor-class-identifier" is set to "PXEClient" in the client dhcp request
match if substring(option vendor-class-identifier, 0, 9) = "PXEClient";
  
# filename define the file retrieve by the client, there pxelinux.0
# our tftp is chrooted so is just the path to the file
# If you prefer use grub, use pxegrub compiled for your ethernet card.
#filename "/PXEClient/pxegrub";
filename "/X86PC/linux/linux.0";

# Set the  "vendor-class-identifier" field to "PXEClient" in dhcp answer
# if this field is not set the pxe client will ignore the answer !
option vendor-class-identifier "PXEClient";

				  
vendor-option-space PXE;
option PXE.mtftp-ip 0.0.0.0;

# IP of you TFTP server
next-server 10.0.1.42;
}

# Tags uses by dhcpnode and setup_add_nodes_to_dhcp
# TAG: NODE_LIST_ADMIN_BEGIN

# TAG: NODE_LIST_ADMIN_END

# TAG: MY_ADMIN_BEGIN
subnet 10.0.1.0 netmask 255.255.255.0 {
  option subnet-mask 255.255.255.0;
  option routers 10.0.1.253;
  default-lease-time 288000;
  max-lease-time 864000;
  option domain-name "guibland.com";
  option domain-name-servers  10.0.1.253; 
  next-server 10.0.1.42;
   
  pool { 
    range 10.0.1.110 10.0.1.120;
  }
}

# TAG: MY_ADMIN_END


[root@localhost ~]# service xinetd restart
Stopping xinetd                                                                                [FAILED]
Starting xinetd                                                                                [  OK  ]
[root@localhost ~]# service pxe restart
Stopping PXE server                                                                            [FAILED]
Dhcp server is not running on this machine !
Be sure that a valid PXE Dhcp server is running on your network
Starting PXE server                                                                            [  OK  ]
[root@localhost ~]# service dhcpd restart
Shutting down dhcpd:                                                                           [  OK  ]
Starting dhcpd:                                                                                [  OK  ]
]]></programlisting>
	</para>
	<para>KA listen only listen on eth0, and need a FQDN. So if it is not the case, ka-d-server will try to open
		a port on 0.0.0.0 IP address, wich cause an error. You can fix it easely setting an valid hostname in /etc/hosts file.
	Don't forget to kill ka-d-server with crtl+C key, after testing it will open a port on a valid IP address.</para>
	<para>
<programlisting><![CDATA[
[root@node42 ~]# ka-d-server 
Compiled : May  4 2010 20:33:07
ARGS=+ka-d-server+
Server IP = 0.0.0.0
command = (cd /; tar  --create --one-file-system --sparse /)
I want 1 clients
ka-d-server: server.c:1987: main: Assertion `socket_server >=0' failed.
Aborted


[root@node42 ~]# cat /etc/hosts
127.0.0.1 localhost.localdomain localhost
10.0.1.42	node42.guibland.com

[root@node42 ~]# ka-d-server 
Compiled : May  4 2010 20:33:07
ARGS=+ka-d-server+
Server IP = 10.0.1.42
command = (cd /; tar  --create --one-file-system --sparse /)
I want 1 clients
Socket 3 on port 30765 on node42.guibland.com ready.
Socket 4 on port 30764 on node42.guibland.com ready.
[root@node42 ~]# ^C
]]></programlisting>
	</para>
	<para>We need to describe the partition table of our golden node, to send it to client nodes.</para>
	<para>
<programlisting><![CDATA[
[root@node42 ~]# fdisk -l

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xd9b576f2

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1019     8185086   82  Linux swap / Solaris
/dev/sda2            1020        4843    30716280   83  Linux
/dev/sda3            4844        9729    39246795    5  Extended
/dev/sda5            4844        9729    39246763+  83  Linux


[root@node42 ~]# fdisk_to_desc 
 -devices: sda1 -size en Mo: 7993 -filesystem: Linux
Use of uninitialized value $e in concatenation (.) or string at /usr/bin/fdisk_to_desc line 50.
 -devices: sda2 -size en Mo: 29996 -filesystem: Linux
Use of uninitialized value $e in concatenation (.) or string at /usr/bin/fdisk_to_desc line 55.
 -devices: sda3 -size en Mo: 38326 -filesystem: Extended
 -devices: sda5 -size en Mo: 38326 -filesystem: Linux
Desc file is /tmp/desc
[root@node42 ~]# cat /tmp/d
ddebug.log  desc        
[root@node42 ~]# cat /tmp/desc 
swap 7993
linux 29996
extended 38326
logical linux 38326

[root@node42 ~]# cat /tmp/desc 
swap 7993
linux 29996
extended fill
logical linux fill
]]></programlisting>
	</para>
	<para>Set default PXE boot to kamethod</para>
	<para>
<programlisting><![CDATA[
[root@node42 ~]# cat /var/lib/tftpboot/X86PC/linux/pxelinux.cfg/default 
PROMPT 1
DEFAULT kamethod
DISPLAY messages
TIMEOUT 50

label local
	LOCALBOOT 0

label kamethod
    KERNEL images/vmlinuz