Hello,
I have created a simple python script to simplify installation of autoqa clients into virtual machines. As our autoqa efforts progress (setting up staging servers etc) it is quite common task to do, so this script will save you a lot of manual labor.
Script is called "aqc-create.py" ("_Auto_QA _client - create") and is available in 'aqc' branch in utils/ directory in our git:
http://git.fedorahosted.org/git/?p=autoqa.git;a=tree;f=utils;hb=aqc
Usage is simple:
$ aqc-create.py -n Example
will create Fedora 13 virtual machine with <your-arch> arch, 512MB RAM and storage /dev/vg_autoqa/Example.
$ aqc-create.py -n Example2 -f 12 -a i386 -r 1024 --disk /tmp/Example2.img -v -d
will create Fedora 12 machine with i386 arch, 1024MB RAM and storage /tmp/Example2.img. It will be verbose and it will not attach you to the serial console of the new machine, so the installation will run on background.
More options are available, see --help.
The installation is fully automatized and it uses kickstart generated by simple wsgi application available in utils/aqc-ks/ directory. It is currently deployed at our staging server: * help usage: http://test1185.test.redhat.com/wsgi/aqc-ks/aqc-ks * example usage: http://test1185.test.redhat.com/wsgi/aqc-ks/aqc-ks?release=13&arch=x86_6...
(This is just an implementation detail, the script uses it automatically and you don't have to care about it.)
aqc-create.py will do these things for you: * call virt-install with correct options (kickstart path, serial console redirection, boot kernel location, etc) * generate a kickstart * add jlaska's autoqa repo * install autotest and autoqa packages and disable their cron tasks * add autotest-server's ssh certificate to /root/.ssh/authorized_keys (currently the staging server's certificate is added by default)
The client is fully prepared automatically and all you have to do at the autotest-server is call these commands: $ ssh root@<hostname> 'true' # just to add the fingerprint to known_hosts $ atest host create -t x86_64 -b fc13,virt <hostname> # change labels if needed
(If you have ideas how to get rid of the first line, comments are welcome.)
So, please comment and report problems, but I have used it many times in the last few days and it seems to be working really well. Maybe we can even use it in our tutorial wiki pages, it may help beginners to start with AutoQA. I'll try to document it later.
If you think this script is valuable, I would like to integrate it into our master branch. Do you think the name (aqc-create/aqc-ks) and the location (utils/) is fine, or do you have other suggestions? Or maybe we want to have it stored somewhere else than in autoqa source code? Let me know.
Kamil
On Fri, 2010-07-09 at 09:24 -0400, Kamil Paral wrote:
Hello,
I have created a simple python script to simplify installation of autoqa clients into virtual machines. As our autoqa efforts progress (setting up staging servers etc) it is quite common task to do, so this script will save you a lot of manual labor.
Script is called "aqc-create.py" ("_Auto_QA _client - create") and is available in 'aqc' branch in utils/ directory in our git:
http://git.fedorahosted.org/git/?p=autoqa.git;a=tree;f=utils;hb=aqc
Usage is simple:
$ aqc-create.py -n Example
will create Fedora 13 virtual machine with <your-arch> arch, 512MB RAM and storage /dev/vg_autoqa/Example.
$ aqc-create.py -n Example2 -f 12 -a i386 -r 1024 --disk /tmp/Example2.img -v -d
will create Fedora 12 machine with i386 arch, 1024MB RAM and storage /tmp/Example2.img. It will be verbose and it will not attach you to the serial console of the new machine, so the installation will run on background.
More options are available, see --help.
The installation is fully automatized and it uses kickstart generated by simple wsgi application available in utils/aqc-ks/ directory. It is currently deployed at our staging server:
- help usage: http://test1185.test.redhat.com/wsgi/aqc-ks/aqc-ks
- example usage: http://test1185.test.redhat.com/wsgi/aqc-ks/aqc-ks?release=13&arch=x86_6...
(This is just an implementation detail, the script uses it automatically and you don't have to care about it.)
aqc-create.py will do these things for you:
- call virt-install with correct options (kickstart path, serial console
redirection, boot kernel location, etc)
- generate a kickstart
- add jlaska's autoqa repo
- install autotest and autoqa packages and disable their cron tasks
- add autotest-server's ssh certificate to /root/.ssh/authorized_keys (currently the staging server's certificate is added by default)
The client is fully prepared automatically and all you have to do at the autotest-server is call these commands: $ ssh root@<hostname> 'true' # just to add the fingerprint to known_hosts $ atest host create -t x86_64 -b fc13,virt <hostname> # change labels if needed
(If you have ideas how to get rid of the first line, comments are welcome.)
So, please comment and report problems, but I have used it many times in the last few days and it seems to be working really well. Maybe we can even use it in our tutorial wiki pages, it may help beginners to start with AutoQA. I'll try to document it later.
If you think this script is valuable, I would like to integrate it into our master branch. Do you think the name (aqc-create/aqc-ks) and the location (utils/) is fine, or do you have other suggestions? Or maybe we want to have it stored somewhere else than in autoqa source code? Let me know.
Don't know if this was already decided or not, but utils/ seems like a logical first step to get this into master. As you note, we can determine a more appropriate location when we begin integrating the virt-guest support more tightly into the autotest/autoqa test workflow.
Thanks, James
----- "Kamil Paral" kparal@redhat.com wrote:
Hello,
I have created a simple python script to simplify installation of autoqa clients into virtual machines. As our autoqa efforts progress (setting up staging servers etc) it is quite common task to do, so this script will save you a lot of manual labor.
I have documented this tool at: https://fedoraproject.org/wiki/Automate_AutoQA_clients_installation
autoqa-devel@lists.fedorahosted.org