[libvirt] [libvirt-php] libvirt_domain_new Create a slow vm

Hi, I've tested this script on centos 6.5 (libvirt-0.10.2, qemu-kvm-0.12.1.2) and ubuntu server 14.04 (libvirt 1.2.2, qemu-kvm 2.0.0) with the same result. The created vm is very slow compared to the vm created with virt-manager, with the same features/devices on the same host. Can you suggest any configuration that can avoid that slowness? With regards Mario D. <?php $conn = libvirt_connect('null', false); $name="testvm"; $arch="x86_64"; $memMB=1024; $maxmemMB=1536; $vcpus=1; $iso_image="/home/iso/CentOS-6.5-x86_64-minimal.iso"; $disk1 = array( "path" => "/home/vm/centos-script.raw", "driver" => "raw", "bus" => "virtio", "dev" => "hda", "size" => "6G", "flags" => VIR_DOMAIN_DISK_FILE | VIR_DOMAIN_DISK_ACCESS_ALL ); $disks = array( $disk1 ); $network1 = array( 'mac' => '00:11:22:33:44:55', 'network' => 'default', 'model' => 'e1000' ); $networks = array( $network1 ); $flags=VIR_DOMAIN_FLAG_FEATURE_ACPI; $newdom=libvirt_domain_new($conn, $name, $arch, $memMB, $maxmemMB, $vcpus, $iso_image, $disks, $networks, $flags); print_r($newdom); ?>

On 06/02/2014 09:17 AM, Mario Di Ture wrote:
Hi,
I've tested this script on centos 6.5 (libvirt-0.10.2, qemu-kvm-0.12.1.2) and ubuntu server 14.04 (libvirt 1.2.2, qemu-kvm 2.0.0) with the same result. The created vm is very slow compared to the vm created with virt-manager, with the same features/devices on the same host. Can you suggest any configuration that can avoid that slowness?
Can you compare the output of 'virsh dumpxml' for the fast and the slow domain? My guess is that you forgot to request KVM hardware acceleration for the slow domain. Look for '<domain type='kvm'> as well as for the right <emulator> binary. 'However, I'm not familiar enough with the libvirt-php bindings to suggest what to add to your code to get the correct XML. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

2014-06-02 17:35 GMT+02:00 Eric Blake <eblake@redhat.com>:
On 06/02/2014 09:17 AM, Mario Di Ture wrote:
Hi,
I've tested this script on centos 6.5 (libvirt-0.10.2, qemu-kvm-0.12.1.2) and ubuntu server 14.04 (libvirt 1.2.2, qemu-kvm 2.0.0) with the same result. The created vm is very slow compared to the vm created with virt-manager, with the same features/devices on the same host. Can you suggest any configuration that can avoid that slowness?
Can you compare the output of 'virsh dumpxml' for the fast and the slow domain? My guess is that you forgot to request KVM hardware acceleration for the slow domain. Look for '<domain type='kvm'> as well as for the right <emulator> binary. 'However, I'm not familiar enough with the libvirt-php bindings to suggest what to add to your code to get the correct XML.
That's right Eric, the setting is <domain type='kvm'> on the fast, and <domain type='qemu'> on the slow domain. It seems that the parameter cannot be passed with the libvirt_domain_new function...looking for an alternative... Thanks for the tip!
participants (2)
-
Eric Blake
-
Mario Di Ture