25 hours ago
can anybody help me to display details about the VM using PHP code. am using Ubuntu server and used KVM as hypervisor. Am trying to display cores, ram, memory alloted each VM.
i have tried all the shell commands in php using shell_exec and exec.
Without installing any tool.
29 hours ago
You can install libvirt php extension to communicate wit libvirtd. See the instructions here.
http://libvirt.org/compiling.html
Once installed you can tryout some sample examples like :
<?php print_r( libvirt_version() ); ?>
Sample Output of above code will be something like:
Array ( [libvirt.release] => 0 [libvirt.minor] => 0 [libvirt.major] => 1 [connector.version] => 0.4.5 [connector.major] => 0 [connector.minor] => 4 [connector.release] => 5 ) php
Refer http://libvirt.org/php/examples.html for more examples.
The complete API reference can be found here: http://libvirt.org/php/api-reference.html
Hope this helps