1 print "XXXX start of control file" 2 3 4 print "XXXX creating RemoteHost object" 5 remote_host= hosts.create_host("192.168.1.1") 6 7 8 print "XXXX installing KVM" 9 kvm_on_remote_host= kvm.KVM(remote_host) 10 11 kvm_on_remote_host.get("/var/local/kvm-33.tar.gz") 12 addresses= [{"mac": "02:00:00:00:00:%02x" % (num,), "ip" : "10.0.0.%d" % (num,)} for num in range(1, 16)] 13 kvm_on_remote_host.install(addresses) 14 15 16 print "XXXX starting guest with default kernel" 17 qemu_options= "-m 256 -hda /var/local/vdisk.img -snapshot" 18 19 g= hosts.KVMGuest(kvm_on_remote_host, qemu_options) 20 g.wait_up() 21 22 print g.run('uname -a').stdout.strip() 23 24 25 print "XXXX starting guest with custom kernel" 26 kernel= deb_kernel.DEBKernel() 27 kernel.get("/home/foo/linux-2.6.21.3-6_2.6.21.3-6_amd64-version2.deb") 28 kernel_dir= kernel.extract(remote_host) 29 30 qemu_options= '-m 256 -hda /var/local/vdisk.img -snapshot -kernel "%s" -append "%s"' % (sh_escape(os.path.join(kernel_dir, kernel.get_image_name()[1:])), sh_escape("root=/dev/hda1 ro console=tty0 console=ttyS0,9600"),) 31 32 g= hosts.KVMGuest(kvm_on_remote_host, qemu_options) 33 g.wait_up() 34 35 print g.run('uname -a').stdout.strip() 36 37 38 print "XXXX end of control file" 39