Changes between Version 1 and Version 2 of NetPerfExample


Ignore:
Timestamp:
Nov 20, 2007, 1:16:30 AM (16 years ago)
Author:
Bruno Cornec
Comment:

VM setup

Legend:

Unmodified
Added
Removed
Modified
  • NetPerfExample

    v1 v2  
    743743Imagine you want to build the same RPMs for the just issued Fedora 8, instead of your native distribution. First download the ISO image of your distribution and put it where you have space on your disk. Then call pb to help you create a new virtual machine for that distribution:
    744744{{{
    745 $ pb -p pb -r `pwd` -m fedora_8 -i ~/Download/Fedora-8-i386-DVD.iso newvm
    746 Project: pb
     745$ pb -p netperf -r `pwd` -m fedora_8 -i ~/Download/Fedora-8-i386-DVD.iso newvm
     746Project: nerperf
    747747Action: newvm
    748748Creating the QEMU VM... Formating '/users/qemu/fedora_8.qemu', fmt=qcow2, size=5242880 kB
     
    752752}}}
    753753Then the Virtual Machine is launched booting on your CD, and the rest is just a classical installation of a Linux distribution.
    754 
    755 
     754Once your distribution is installed, stop the VM and relaunch it to finish the setup with:
     755{{{
     756$ pb -p netperf -r `pwd` -m fedora_8 launchvm
     757Project: netperf
     758Action: launchvm
     759Launching the VM /users/qemu/fedora_8.qemu... OK
     760Waiting for VM fedora_8 to come up...           
     761}}}
     762I especially disable firewall and SElinux on the VM. At the end of this initial setup phase log as root on your new VM installation. Check that your update mechanism for yum is correct. Allow your local account (the one running the pb commands) to have access through ssh to the VM, and activate ssh if it's not already done:
     763{{{
     764# mkdir .ssh
     765# scp bruno@victoria2.home.musique-ancienne.org:.ssh/id_dsa.pub .ssh//authorized_keys
     766The authenticity of host 'victoria2.home.musique-ancienne.org (192.168.8.28)' can't be established.
     767RSA key fingerprint is 8c:48:e7:a0:23:fe:81:c6:27:a2:d7:e1:7f:00:02:09.
     768Are you sure you want to continue connecting (yes/no)? yes
     769Warning: Permanently added 'victoria2.home.musique-ancienne.org,192.168.8.28' (RSA) to the list of known hosts.
     770bruno@victoria2.home.musique-ancienne.org's password:
     771id_dsa.pub                                    100%  604     0.6KB/s   00:00
     772# chmod 700 .ssh
     773# chmod 600 .ssh//authorized_keys
     774}}}
     775And check that it's working by connecting to your VM (fr that use the port you  put in your netperf.pb configuration file as vmport):
     776{{{
     777ssh root@localhost -p 2225
     778@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
     779@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
     780@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
     781IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
     782Someone could be eavesdropping on you right now (man-in-the-middle attack)!
     783It is also possible that the RSA host key has just been changed.
     784The fingerprint for the RSA key sent by the remote host is
     78583:6f:24:f3:33:db:bf:95:93:79:cf:f4:1f:2a:23:23.
     786Please contact your system administrator.
     787Add correct host key in /users/bruno/.ssh/known_hosts to get rid of this message.
     788Offending key in /users/bruno/.ssh/known_hosts:90
     789Password authentication is disabled to avoid man-in-the-middle attacks.
     790Keyboard-interactive authentication is disabled to avoid man-in-the-middle attacks.
     791Agent forwarding is disabled to avoid man-in-the-middle attacks.
     792X11 forwarding is disabled to avoid man-in-the-middle attacks.
     793#
     794}}}
     795So now you can finish to set up the VM by installing and configuring all what is necessary for pb to work flawlessly. There is a contributed script in Project-Builder that may help you greatly realizing that (Cf: http://trac.project-builder.org/browser/devel/pb/contrib/pbsetupqemu and its launcher http://trac.project-builder.org/browser/devel/pb/contrib/updateqemu). Try launching:
     796{{{
     797$ wget 'http://trac.project-builder.org/browser/devel/pb/contrib/pbsetupqemu?format=raw'
     798--01:08:11--  http://trac.project-builder.org/browser/devel/pb/contrib/pbsetupqemu?format=raw
     799           => `pbsetupqemu?format=raw'
     800Résolution de trac.project-builder.org... 213.30.161.23
     801Connexion vers trac.project-builder.org|213.30.161.23|:80...connecté.
     802requête HTTP transmise, en attente de la réponse...200 OK
     803Longueur: 7,880 (7.7K) [text/plain]
     804
     805100%[=================================================================>] 7,880         --.--K/s
     806
     807
     808$ cat pbsetupqemu* /usr/lib/perl5/vendor_perl/*/ProjectBuilder/Distribution.pm > /tmp/pbscript
     809$ chmod 755 /tmp/pbscript
     810$ pb -p netperf -r `pwd` -a root -m fedora_8 -s /tmp/pbscript script2vm
     811Project: pb
     812Action: script2vm
     813VMs: fedora_8
     814Found an existing VM /users/qemu/fedora_8.qemu (pid 32149)
     815Packages: project-builder
     816Sources handled (Script): /users/bruno/pb/svn/delivery/pbscript
     817Preparing pb/svn/pbrc/src on root@localhost... OK
     818pbscript                                                                   100%   15KB  14.6KB/s   00:00
     819OK
     820Executing pbscript on root@localhost  if needed... distro tuple: fedora,8,rh,rpm,.fc8
     821Cleaning up Everything
     822Setting up Update Process
     823Resolving Dependencies
     824--> Running transaction check
     825---> Package gnome-screensaver.i386 0:2.20.0-10.fc8 set to be updated
     826---> Package slrn.i386 0:0.9.8.1pl1-5.20070716cvs.fc8 set to be updated
     827---> Package perl-Test-Harness.i386 0:2.56-31.fc8 set to be updated
     828[...]
     829}}}
     830