(Hosting the kickstart generator) |
m (header) |
||
Line 1: | Line 1: | ||
{{header|qa}} | |||
This guide will help you if you need to [[How to add autotest clients|add many autotest clients]] in the form of virtual machines and you want to automate the process as much as possible. | This guide will help you if you need to [[How to add autotest clients|add many autotest clients]] in the form of virtual machines and you want to automate the process as much as possible. | ||
Revision as of 14:40, 19 July 2010
This guide will help you if you need to add many autotest clients in the form of virtual machines and you want to automate the process as much as possible.
The process will automate these things for you:
- Create new virtual machine with libvirt
- Generate a proper kickstart file according to your preferences
- Automatically install Fedora, set up desired setting (serial console redirection, etc)
- Automatically add required repositories and install required packages
- Disable AutoQA cron tasks
Get the tools
We have created several scripts which you can use. They are not stabilized yet, so you have to retrieve them from our git:
$ git clone 'git://git.fedorahosted.org/autoqa.git' $ cd autoqa $ git checkout -b aqc origin/aqc $ cd utils
In the current directory you can now see aqc-create.py
script and aqc-ks/
directory (aqc is an acronym for AutoQA client). aqc-create.py
is the main script you will want to use for AutoQA client installation, aqc-ks/
is a small web application for generating appropriate kickstarts.
You also need to have libvirt
installed:
# yum install libvirt
Install the virtual AutoQA client
Just run
# ./aqc-create.py --help
to have an idea what can be done with this script.
A simple example would be:
# ./aqc-create.py --name client1 --fedora 13
That will create virtual machine with Fedora 13, your architecture, 512 MB RAM and storage in /dev/vg_autoqa/client1
. A lot of default values have been used here, you can change anything to your needs.
Let's see a more complex example:
# ./aqc-create.py --name client2 --fedora 12 --arch i386 --ram 1024 --disk /tmp/client2.img --ks http://myserver/myks.cfg
This will create virtual machine with Fedora 12, i386 architecture, 1024 MB RAM and storage in a file /tmp/client2.img
(not logical volume). Kickstart used for installation is retrieved from http://myserver/myks.cfg
. Your kickstart must of course match provided options (correct repositories for chosen Fedora release, etc).
A few more important options are --verbose
for increased verbosity, --detach
for not attaching you to client's serial console during installation and --dry
for not really executing anything, just simulating.
The script will print you some helpful messages before you connect and after you disconnect from client's serial console. Be sure not to miss them.
Hosting the kickstart generator
The default kickstart generator is currently hosted inside Red Hat intranet:
http://test1185.test.redhat.com/wsgi/aqc-ks/aqc-ks
You may want to host your own, either because you are not inside Red Hat intranet, or you may want to do some changes. It is simple:
- Install
httpd
andmod_wsgi
. - Ensure your
/etc/httpd/conf.d/wsgi.conf
looks something like this:LoadModule wsgi_module modules/mod_wsgi.so <IfModule mod_wsgi.c> WSGIScriptAlias /wsgi /var/www/wsgi/ <Directory /var/www/wsgi> AllowOverride FileInfo Options ExecCGI MultiViews Indexes FollowSymlinks MultiviewsMatch Handlers AddHandler wsgi-script .wsgi AddHandler wsgi-script .py Order allow,deny Allow from all </Directory> </IfModule>
- Create directory
/var/www/wsgi
. - Copy
aqc-ks/
directory to/var/www/wsgi
. - Restart
httpd
service. - Access your kickstart generator at http://your_host/wsgi/aqc-ks/aqc-ks.
Now you can use your own kickstart generator together with aqc-create.py
like this:
# ./aqc-create.py ... --ks 'http://your_host/wsgi/aqc-ks/aqc-ks?release=%(fedora)s&arch=%(arch)s' ...