[libvirt] Need Help To Destroy Virtual Machines

Ali Raza Memon raza.memon at live.com
Tue Apr 3 14:42:40 UTC 2012


Hello...! 
I am using libvirt-php for controlling my xen virtual machines. For this I have installed libvirt-php along with xampp server.
Now I need to create a web based controll panel application which shows me running vms, and some options like Shutdown, Pause, Create, Destroy. My aim is, when I click Destroy button the selected vm should be destroyed. For this I have used the following php-script:

<?php 
    
    $conn=libvirt_connect("xen:///"); 
    $name=libvirt_domain_lookup_by_id($conn,4); // Here '4' is the id of my running vm
    $dest=libvirt_domain_destroy($name);
    echo $dest; 

?>  


When I execute this it shows me following warning:

Warning: libvirt_domain_destroy() [function.libvirt-domain-destroy]: operation virDomainDestroy forbidden for read only access in /opt/lampp/htdocs/xampp/xen/test.php on line 5


So, Could you please help me to solve this? 

! Thank You !

 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120403/06af41e2/attachment-0001.htm>


More information about the libvir-list mailing list