Commands to copy/paste to deploy LAVA
You can use this series of commands to create your own local instance of LAVA; create a default QEMU device/device-type, create sample testscript and create and schedule your first LAVA job.
It is recommended that you perform this on a clean system or in a VM as the LAVA install could overwrite some of your data. You can perform these steps in a VM (one provided below), natively on your system. It is also better to ssh into the VM to insure you can paste easily.
Ubuntu 12.04 has been tested
Commands for copy and paste
# You may want to login # bzr launchpad-login <launchpad.net login id>
Download lava-deployment-tool and install your instance
Create a super user (u:admin/p:admin)
1 adminuser=admin 2 adminpass=admin 3 email@example.com 4 5 expect -c 'spawn ~/lava-deployment-tool/lava-deployment-tool manage mylava createsuperuser; expect "):"; send "'$adminuser'\r"; expect "address:"; send "'$adminemail'\r"; expect "Password: "; send "'$adminuser'\r"; expect "Password (again): "; send "'$adminpass'\r"; expect #;'
Install lava-tool, create and retrieve your API key
1 # install client tools 2 sudo apt-get install lava-tool -y 3 4 ### This section creates an API key 5 lavaaddr=localhost 6 lavaurl=http://$lavaaddr 7 8 #obtain the csrf token 9 data=$(curl -s -c cookies.txt $lavaurl/accounts/login/ | grep -o "name=['\"]csrfmiddlewaretoken['\"] value=['\"][^'\"]*" | sed -e "s/name='//" -e "s/' value='/=/") 10 11 #login 12 login=$data\&username=$adminuser\&password=$adminpass 13 curl -b cookies.txt -c cookies.txt -d $login -X POST $lavaurl/accounts/login/ 14 15 #create an api key 16 createapi=$data\&description=autogenerated 17 curl -b cookies.txt -c cookies.txt -d $createapi -X POST $lavaurl/api/tokens/create/ 18 19 #get the api key(s) 20 curl -b cookies.txt -c cookies.txt -d $data $lavaurl/api/tokens/ | grep secret 21 22 # authenticate to the API 23
Copy and paste one of the keys (text between <code> and </code>
# IF you are using a desktop Ubuntu installation, python and gnome keyring can cause problems if you execute over ssh. (gnomekeyring.IO error) To get around this you can configure the keyringrc.cfg file to use a file instead.
create a bundle stream
Test your new server
Platform/LAB/Copy-Paste/Deploy-LAVA-Server (last modified 2014-04-23 15:28:05)