2012/09/21

Adding KVM guest node with Jenkins

Making Build script with KVM(virtinst)
  • Click to [New Job]
  • Pull down [Add build step]  and enter building virtual guest like..

sudo qemu-img create -f qcow2 /var/lib/libvirt/images/RH62x64.qcow2 60G
sudo virt-install --name=RH62x64 --hvm --connect=qemu:///system \
--disk path=/var/lib/libvirt/images/RH62x64.qcow2,size=60,format=qcow2 \
--disk path=/export/rhel-server-6.2-x86_64-dvd.iso,bus=ide,device=cdrom \
--graphics vnc,keymap=ja --vcpus=2 --ram=2048 --os-type=linux --os-variant=rhel6 \
--extra-args="ks=http://192.168.122.1/ks/anaconda-ks.cfg" --location=http://192.168.122.1/os/RH62/


  • Click to [Save]
  • Click to [Build Now] then you 'll get a kvm guest.


Adding KVM guest with Jenkins
Computer Name -> QEMU
Hypervisor Host -> 127.0.0.1
Username -> root


  • Click to [New Node] and enter node information
Secondary launch method -> Launch slave via execution of command on the Master
Launch command  -> ssh root@192.168.122.XXX exec java -jar slave.jar -jnlpUrl http://192.168.122.1:8080/computer/RH63x64/slave-agent.jnlp

also, you have to make scp files to new added guest root-home.


authorized_keys:  -> root@[guest ip]:/root/.ssh/
[put Jenkins'  RSA pub-key from (/var/lib/jenkins/.ssh/id_rsa.pub)]
/var/run/jenkins/war/WEB-INF/slave.jar: ->  root@[guest ip]:/root/
Making Build script on KVM node
  • Click to [New Job]
  • Choose [Build multi-configuration project]
  • Go to [Configuration Matrix] and select execution nodes.
  • Pull down [Add build step]  and enter building virtual guest like..

0 件のコメント: