testdrive calls kvm-img to create disk image on trusty, command doesn't exist
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
TestDrive |
In Progress
|
Medium
|
pawciobiel |
Bug Description
While using Testdrive on Trusty to run the required iso test case of i386 and amd64 Trusty server installers for qa-tracker, I reach the following error:
'[!] Detect disks No disk drive was detected. If you know the name of the driver needed by your disk drive, you can select it from the list.'
The Testdrive script is calling the kvm-img command to create a qcow2 file prior to invoking a new virtual machine instance, however kvm-img doesn't exist. The qemu-img tool from the qemu-utils package is present and would work to create the qcow2 disk image file if called.
After the disk image creation fails, Testdrive proceeds anyway, which results in a 0kb raw disk image being created by qemu.
Additionally, Trusty incorrectly advises the following, which does not install kvm-img:
rbeisner@bcu:~$ kvm-img
The program 'kvm-img' is currently not installed. You can install it by typing:
sudo apt-get install qemu-utils
Libvirt, KVM and qemu are otherwise normal and functional on the host box ("bcu") with other unrelated VMs in place.
To confirm, I created a new pristine Trusty VM from ISO ("nest"), then installed Testdrive per qa-tracker iso guide. Same result: kvm-img command is absent.
The impact is that community members who help out in Trusty iso qa testing may not be able to complete the test cases.
As a test/work-around, I created a sym link of qemu-img to kvm-img. Testdrive was then able to create the qcow2 and spawn the test VM with a virtual disk present as originally expected.
Old/Related bugs:
https:/
rbeisner@bcu:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu Trusty Tahr (development branch)
Release: 14.04
Codename: trusty
rbeisner@bcu:~$ uname -a
Linux bcu 3.13.0-18-generic #38-Ubuntu SMP Mon Mar 17 21:40:06 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
rbeisner@bcu:~$ kvm-ok
INFO: /dev/kvm exists
KVM acceleration can be used
rbeisner@
[sudo] password for rbeisner:
INFO: version passed: False
INFO: config passed: None
INFO: Trying config in /etc/testdriverc
INFO: Using configuration in /etc/testdriverc
INFO: Trying config in /home/rbeisner/
INFO: Using configuration in /home/rbeisner/
INFO: Trying config in /home/rbeisner/
INFO: Using KVM for virtual machine hosting...
INFO: Retrieving the Ubuntu ISO list from cache...
Welcome to Testdrive!
1. Ubuntu Desktop (trusty-amd64)
2. Ubuntu Desktop (trusty-i386)
3. Ubuntu Server (trusty-amd64)
+-cache--> [2014-03-18 11:47:52] trusty-
4. Ubuntu Server (trusty-i386)
5. Other (prompt for ISO URL)
Select an image to testdrive [1]: 3
INFO: Syncing the specified ISO...
rsync:
receiving incremental file list
trusty-
584,056,832 100% 2.83MB/s 0:03:16 (xfr#1, to-chk=0/1)
INFO: Validating Virtualization Method....
INFO: Setting up Virtual Machine...
INFO: Creating disk image [/home/
sh: 1: kvm-img: not found
ERROR: Command failed
`kvm-img create -f qcow2 /home/rbeisner/
INFO: Launching Virtual Machine...
INFO: Running the Virtual Machine...
rbeisner@bcu:~$ dpkg -l | egrep 'qemu|kvm|
ii ipxe-qemu 1.0.0+git-
ii libvirt0 1.2.2-0ubuntu5 amd64 library for interfacing with different virtualization systems
ii libvirt-bin 1.2.2-0ubuntu5 amd64 programs for the libvirt library
ii python-libvirt 1.2.2-0ubuntu1 amd64 libvirt Python bindings
ii qemu-common 1.7.0+dfsg-3ubuntu7 all dummy transitional package from qemu-common to qemu-keymaps
ii qemu-keymaps 1.7.0+dfsg-3ubuntu7 all QEMU keyboard maps
ii qemu-kvm 1.7.0+dfsg-3ubuntu7 amd64 QEMU Full virtualization on x86 hardware (transitional package)
ii qemu-system-common 1.7.0+dfsg-3ubuntu7 amd64 QEMU full system emulation binaries (common files)
ii qemu-system-x86 1.7.0+dfsg-3ubuntu7 amd64 QEMU full system emulation binaries (x86)
ii qemu-utils 1.7.0+dfsg-3ubuntu7 amd64 QEMU utilities
ii testdrive 3.26-0ubuntu1 all run the daily Ubuntu ISO in a virtual machine (meta-package)
ii testdrive-cli 3.26-0ubuntu1 all run the daily Ubuntu ISO in a virtual machine (command line)
ii testdrive-common 3.26-0ubuntu1 all run the daily Ubuntu ISO in a virtual machine (common files)
ii testdrive-gtk 3.26-0ubuntu1 all run the daily Ubuntu ISO in a virtual machine (GTK Front-end)
rbeisner@bcu:~$ sudo qemu-img info /home/rbeisner/
image: /home/rbeisner/
file format: raw
virtual size: 0 (0 bytes)
disk size: 0
rbeisner@bcu:~$
rbeisner@bcu:~$ ls /home/rbeisner/
total 8.0K
drwx------ 2 rbeisner rbeisner 4.0K Mar 24 10:37 .
drwx------ 4 rbeisner rbeisner 4.0K Mar 18 11:46 ..
-rw------- 1 root root 0 Mar 24 10:37 testdrive-
Related branches
- Andres Rodriguez: Approve
-
Diff: 345 lines (+108/-56)7 files modifiedbin/testdrive (+14/-9)
bin/testdrive-gtk (+18/-13)
testdrive/virt/base.py (+16/-0)
testdrive/virt/kvm.py (+24/-10)
testdrive/virt/parallels.py (+12/-10)
testdrive/virt/virtualbox.py (+23/-13)
testdrivegtk/PreferencesTestdrivegtkDialog.py (+1/-1)
Changed in testdrive: | |
assignee: | nobody → pawciobiel (pawciobiel) |
Changed in testdrive: | |
status: | Triaged → In Progress |
tags: | added: utopic |
The hacky workaround confirmation (sym linking qemu-img to kvm-img):
rbeisner@bcu:~$ sudo testdrive .testdriverc .testdriverc .config/ testdrive/ testdriverc
[sudo] password for rbeisner:
INFO: version passed: False
INFO: config passed: None
INFO: Trying config in /etc/testdriverc
INFO: Using configuration in /etc/testdriverc
INFO: Trying config in /home/rbeisner/
INFO: Using configuration in /home/rbeisner/
INFO: Trying config in /home/rbeisner/
INFO: Using KVM for virtual machine hosting...
INFO: Retrieving the Ubuntu ISO list from cache...
Welcome to Testdrive!
1. Ubuntu Desktop (trusty-amd64) server- amd64.iso
2. Ubuntu Desktop (trusty-i386)
3. Ubuntu Server (trusty-amd64)
+-cache--> [2014-03-25 02:08:50] trusty-
4. Ubuntu Server (trusty-i386)
5. Other (prompt for ISO URL)
Select an image to testdrive [1]: 3 //cdimage. ubuntu. com/cdimage/ ubuntu- server/ daily/current/ trusty- server- amd64.iso
INFO: Syncing the specified ISO...
rsync:
receiving incremental file list rbeisner/ .cache/ testdrive/ img/testdrive- disk-MXKnPn. img]... rbeisner/ .cache/ testdrive/ img/testdrive- disk-MXKnPn. img', fmt=qcow2 size=6442450944 encryption=off cluster_size=65536 lazy_refcounts=off
qemu-system- x86_64 -uuid 28bccc39- f725-4a0e- 9f9e-e4d613b36f 2b -m 2048 -smp 6 -cdrom /home/rbeisner/ .cache/ testdrive/ iso/ubuntu_ trusty- server- amd64.iso -drive file=/home/ rbeisner/ .cache/ testdrive/ img/testdrive- disk-MXKnPn. img,if= virtio, cache=writeback ,index= 0 -usb -usbdevice tablet -net nic,model=virtio -net user -soundhw es1370 -vga cirrus -enable-kvm
INFO: Validating Virtualization Method....
INFO: Setting up Virtual Machine...
INFO: Creating disk image [/home/
Formatting '/home/
INFO: Launching Virtual Machine...
INFO: Running the Virtual Machine...
rbeisner@ bcu:~/. cache/testdrive /img$ sudo qemu-img info testdrive- disk-MXKnPn. img disk-MXKnPn. img
[sudo] password for rbeisner:
image: testdrive-
file format: qcow2
virtual size: 6.0G (6442450944 bytes)
disk size: 1.1G
cluster_size: 65536
Format specific information:
compat: 1.1
lazy refcounts: false