New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
PHP integration of KVM
thesuppOrtGuy2
Member
in Help
Hello All,
I want to manage the KVM operations via PHP but I'm not able to find the way to connect KVM hypervisor to php via libvirt php apis
can anyone suggest any alternative way to do this.
I have tried everything in libvirt php but still it is not able to connect the hypervisor
require('libvirt.php');
$lv = new Libvirt('qemu:///system');
$hn = $lv->get_hostname();
if ($hn == false)
die('Cannot open connection to hypervisor');
$action = array_key_exists('action', $_GET) ? $_GET['action'] : false;
Gives error Cannot open connection to hypervisor
Comments
remove 1 slash from qemu///
I tried removing one / but still no joy
Like this qemu://system
I'm also getting below error when I try this with virsh command
[root@vultr html]# virsh --connect qmeu://system
error: Cannot read CA certificate '/etc/pki/CA/cacert.pem': No such file or directory
error: failed to connect to the hypervisor
it is qemu i think instead of qmeu
add me on skype phoenix.talisman
Have you tried to call libvirt_get_last_error()? But from the error you posted it seems related to a missing SSL certificate.