Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

My code is:

$name="TestMachine";
$arch="x86_64";
$memMB=200;
$maxmemMB=500;
$vcpus=2;
$iso_image="/root/centos5-img/centos.5-10.x86.20131020.img";
$disk1 = array(
                "path" => "/var/lib/libvirt/images/MyNewVM.img",
                "driver" => "raw",
                "bus" => "ide",
                "dev" => "hdc",
                "size" => "500M"
        );
$disks = array( $disk1 );
$network1 = array(
                'mac' => '00:11:22:33:44:55',
                'network' => 'default'
        );
$networks = array( $network1 );
$flags=VIR_DOMAIN_DISK_ACCESS_ALL;

if(libvirt_domain_new($conn, $name, $arch, $memMB, $maxmemMB, $vcpus, $iso_image, $disks, $networks,$flags))
       echo "Success";
else
        echo "Failed - ".libvirt_get_last_error()."<br />";

Output :

Failed - Cannot get installation XML

Am new to php-libvirt. Kindly say the solution to solve it. Thanks in advance.

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.