root/README @ 8717fb5f6353d199eb0d5dc240d1fd27657e995c

Revision 8717fb5f6353d199eb0d5dc240d1fd27657e995c, 3.8 kB (checked in by Frederic Lepied <frederic.lepied@…>, 18 months ago)

manage the default pxe boot

  • Property mode set to 100644
Line 
1-*- outline -*-
2
3* PXE Manager
4
5The idea is to build an automaton to control when to boot from the
6local drives and when to boot from the network.
7
8The systems can be used to run automated tests. You can also use this
9system only to provision on demand systems or backup your partitions
10using partimage or anything you want to do with an automated PXE
11system...
12
13The systems must be configured to always boot over PXE.
14
15** Install
16
17- edit the database and PXE config in the settings.py according to
18  your local setup.
19
20- you need python-django installed.
21
22- run ./manage.py syncdb to create the needed sql tables.
23
24- create the PXE profiles in pxelinux.cfg/profiles/ ending in
25  .prof. The local.prof is mandatory and must point to a local boot
26  config. The user running the scripts must have the right to write in
27  pxelinux.cfg. I usually create a group and put it under control of
28  the files under pxelinux.cfg.
29
30- export these 2 environment variables:
31  DJANGO_SETTINGS_MODULE=settings and PYTHONPATH=$PWD.
32
33- run pxemngr syncbootnames to add the names of the PXE profiles in the
34  database.
35
36- add the systems that you want to control by this system like this:
37
38pxemngr addsystem <name> <mac address> [<mac address 2>...]
39
40- set which profile you want your system to PXE boot:
41
42pxemngr nextboot <name> <profile name>
43
44If you want to assign a default profile to all systems, use the
45reserved system name 'default'.
46
47- run ./manage.py runserver <ip addr>:<port> to have a web server
48  waiting for requests to boot locally. You can also configure django
49  to use apache instead of the little embedded server.
50
51- then your PXE scripts must access the following web page
52  http://<ipaddr>:<port>/localboot/ to request a local boot
53  before rebooting else the PXE boot will continue to loop on the same
54  install.
55
56** Advanced
57
58- in your auto-install scripts, you can access the current profile by
59  accessing the following url: http://<ipaddr>:<port>/profile/
60
61** Test system
62
63*** Description
64
65The test system allows to provide test scripts to running systems
66declared in the PXE manager database.
67
68The target system can request a test by using this url:
69http://<ipaddr>:<port>/nexttest/
70
71The tests are usually shell scripts that are built using Django
72templating system. By convention, the tests are usinf a suffix of
73.test. They are stored in the directory set in settings.py under the
74TESTS_DIR variable. A wait.test must exist and will be sent by the
75server to the target system when no test is available. This wait.test
76must wait for some time and then exit to let the system send a new
77test if needed or send back a new wait.test.
78
79After the execution of a test script, the result is sent back to the
80server using the following url: http://<ipaddr>:<port>/upload/<test id>/. I
81usualy run the following curl command to upload the result:
82
83curl --retry 0 -s -f -F "file=@$output" http://<ipaddr>:<port>/upload/<test id>/
84
85These uploaded files are stored under the directory set by the
86TEST_UPLOAD_DIR variable in settings.py.
87
88The system uses a simple convention in these files to lookup
89information. It parses the lines to store informations, warnings and
90errors lines if they begin by 'I: ', 'W: ' and 'E: '. The system also
91tries to find the version of the system by looking for a line starting
92by 'V: '.
93
94You can then navigate on web pages displaying these parsed
95informations under: http://<ipaddr>:<port>/.
96
97*** Control
98
99To instruct the system about which tests are available, use the
100following command:
101
102pxemngr synctestnames
103
104To assign a test to a target system, use the following command:
105
106pxemngr nexttest <system name> <test name>
107
108To display all the tests scheduled for a system, use:
109
110pxemngr dpytest <system name>
111
112*** Web navigation
113
114By pointing your browser to http://<ipaddr>:<port>/, you can navigate
115in the results of the test system.
Note: See TracBrowser for help on using the browser.