<div dir="ltr"><font face="monospace">Despite great success at using php-libvirt with other functions, I have been entirely unsuccessful in getting it to create a new domain/machine. Any time I do, and with virtually anything I try, I get the above error message. <br><br>Running PHP 7.4 (remi) on otherwise stock AlmaLinux. <br><b>[root@sb4 html]# cat /etc/redhat-release <br>AlmaLinux release 8.5 (Arctic Sphynx<br></b></font><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0)"><font face="monospace"><b><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">[root@sb4 html]# rpm -qa php php-fpm php-libvirt nginx<br>php-7.4.28-1.el8.remi.x86_64<br>nginx-1.14.1-9.module_el8.3.0+2165+af250afe.alma.x86_64<br>php-fpm-7.4.28-1.el8.remi.x86_64<br>php-libvirt-0.5.5-1.el8.remi.7.4.x86_64<br>12 XEON </span><span style="font-variant-ligatures:no-common-ligatures">E312xx cores, 24 w/HT, 192GB RAM, etc. </span></b></font></p><font face="monospace"><br>When I run it, I find in php-fpm www.error-log: <br></font><div><font face="monospace"><br>





</font><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="monospace"><b>[24-Mar-2022 20:05:51 UTC] PHP Warning:<span class="gmail-Apple-converted-space">  </span>libvirt_domain_new(): Cannot get installation XML in /var/www/html/manage.php on line 190</b><br><br>Matching message onscreen: <b>Warning: libvirt_domain_new(): Cannot get installation XML in /var/www/html/manage.php on line 191</b><br><br>Here's the offending code: <br><br>





</font></span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;color:rgb(56,185,199)"><font face="monospace"><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures">$networks</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> = [</span></font></p><p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0)"><font face="monospace"><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">    </span></span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(170,171,37)"><b>'mac'</b></span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures"> => '</span>52:54:00:06:a7:df'<span style="font-variant-ligatures:no-common-ligatures">,</span></font></p><p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0)"><font face="monospace"><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">    </span></span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(170,171,37)"><b>'network'</b></span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures"> => 'default',</span></font></p><p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;color:rgb(170,171,37)"><font face="monospace"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"><span class="gmail-Apple-converted-space">    </span></span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures"><b>'model'</b></span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> =><span class="gmail-Apple-converted-space">  </span></span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures"><b>'e1000'</b></span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">,</span></font></p><p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0)"><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures"><font face="monospace"><span class="gmail-Apple-converted-space">    </span>];</font></span></p><p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0)"><font face="monospace"><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(56,185,199)">$disks</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures"> = [</span></font></p><p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;color:rgb(170,171,37)"><font face="monospace"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"><span class="gmail-Apple-converted-space">    </span></span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures"><b>'path'</b></span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> => </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures"><b>"/var/lib/libvirt/images/myvm.qcow2"</b></span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">,</span></font></p><p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;color:rgb(170,171,37)"><font face="monospace"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"><span class="gmail-Apple-converted-space">    </span></span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures"><b>'driver'</b></span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> => </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures"><b>'qcow2'</b></span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">,</span></font></p><p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;color:rgb(170,171,37)"><font face="monospace"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"><span class="gmail-Apple-converted-space">    </span></span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures"><b>'bus'</b></span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> => </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures"><b>'ide'</b></span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">,</span></font></p><p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;color:rgb(170,171,37)"><font face="monospace"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"><span class="gmail-Apple-converted-space">    </span></span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures"><b>'dev'</b></span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> => </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures"><b>'hda'</b></span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">,</span></font></p><p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;color:rgb(170,171,37)"><font face="monospace"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"><span class="gmail-Apple-converted-space">    </span></span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures"><b>'size'</b></span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> => </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures"><b>'40G'</b></span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">,</span></font></p><p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0)"><font face="monospace"><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">    </span></span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(170,171,37)"><b>'flags'</b></span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures"> => null,</span></font></p><p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0)"><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures"><font face="monospace"><span class="gmail-Apple-converted-space">    </span>];</font></span></p>





<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0)"><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(56,185,199)"><font face="monospace"><span class="gmail-s1" style="color:rgb(0,0,0)"><span class="gmail-Apple-converted-space">  </span></span><span class="gmail-s2" style="color:rgb(199,199,199)">error_reporting(</span><span class="gmail-s1" style="color:rgb(0,0,0)">-1);</span></font></span></p><p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0)"><font face="monospace"><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(56,185,199)">$result</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> = </span><span class="gmail-s3" style="color:rgb(199,199,199);font-variant-ligatures:no-common-ligatures">libvirt_domain_new(</span></font></p><p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0)"><font face="monospace"><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">    </span></span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(56,185,199)">$conn</span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures">,</span></font></p><p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><font face="monospace"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space" style=""><font color="#000000">    </font><font color="#38b9c7">'myvm'</font></span></span><span class="gmail-s1" style="color:rgb(0,0,0);font-variant-ligatures:no-common-ligatures">,</span><span class="gmail-s3" style="color:rgb(86,32,244);font-variant-ligatures:no-common-ligatures"><b> // name of the new domain</b></span></font></p><p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;color:rgb(86,32,244)"><font face="monospace"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"><span class="gmail-Apple-converted-space">    </span>null,</span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures"><b> // optional architecture string, can be NULL to get default (or false)</b></span></font></p><p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;color:rgb(86,32,244)"><font face="monospace"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"><span class="gmail-Apple-converted-space">    </span>2048,</span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures"><b> // number of megabytes of RAM to be allocated for domain</b></span></font></p><p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;color:rgb(86,32,244)"><font face="monospace"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"><span class="gmail-Apple-converted-space">    </span>8192,</span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures"><b> // maximum number of megabytes of RAM to be allocated for domain</b></span></font></p><p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;color:rgb(86,32,244)"><font face="monospace"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"><span class="gmail-Apple-converted-space">    </span>2,</span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures"><b> // number of VCPUs to be allocated to domain</b></span></font></p><p class="gmail-p4" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;color:rgb(170,171,37)"><font face="monospace"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"><span class="gmail-Apple-converted-space">    </span></span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures"><b>'/var/www/html/AlmaLinux-8.4-x86_64-dvd.iso'</b></span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">,</span><span class="gmail-s5" style="font-variant-ligatures:no-common-ligatures;color:rgb(86,32,244)"><b> // installation ISO image for</b></span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">$</span></font></p><p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;color:rgb(86,32,244)"><font face="monospace"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"><span class="gmail-Apple-converted-space">    </span></span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(56,185,199)">$disks</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">,</span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures"><b> // array of disk devices for domain</b></span></font></p><p class="gmail-p5" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;color:rgb(56,185,199)"><font face="monospace"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"><span class="gmail-Apple-converted-space">    </span></span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures">$networks</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">,</span></font></p><p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0)"><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures"><font face="monospace"><span class="gmail-Apple-converted-space">    </span>null</font></span></p><p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0)"><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures"><font face="monospace">










</font></span></p><p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0)"><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures"><font face="monospace"><span class="gmail-Apple-converted-space">    </span>);<br><br>I've tried various values for $disks and $networks, setting error reporting to -1 (display anything and everything), journalctl -f on both the webserver and the virt host, etc but was never able to see any error other than this one. </font></span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="monospace">











<br>I've also been looking in the source code file for anything obvious, and I've been utterly unsuccessful in changing the error message. For example, inserting an invalid path for the ISO image doesn't result in an error message that it *looks* like it should be throwing errors about invalid ISO image. </font></span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="monospace"><br></font></span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="color:rgb(0,0,0);font-variant-ligatures:no-common-ligatures"><font face="monospace">In fact, I've even tried passing ALL NULL/EMPTY VALUES and with the exception of the $conn connection variable, I only get this "Cannot get installation XML" error message: <br><br>$result = libvirt_domain_new(<br>    $conn,<br>    null,<br>    null,<br>    null,<br>    null,<br>    null,<br>    null,<br>    [],<br>    []<br>    );</font></span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><span class="gmail-s1" style="color:rgb(0,0,0);font-variant-ligatures:no-common-ligatures"><font face="monospace"><br></font></span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal"><font face="monospace"><span class="gmail-s1" style="color:rgb(0,0,0);font-variant-ligatures:no-common-ligatures">Shouldn't I at least be seeing a message like "</span><span style="color:rgb(10,48,105);white-space:pre">Name is '</span><span style="white-space:pre">myvm</span><span style="color:rgb(10,48,105);white-space:pre">', memMB is 2048</span><span style="color:rgb(10,48,105);white-space:pre">, maxmemMB is </span><span style="white-space:pre">8192<font color="#0a3069">" ? </font></span></font></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="monospace" style=""><br><a href="https://github.com/php/pecl-virtualization-libvirt/blob/master/src/libvirt-php.c">https://github.com/php/pecl-virtualization-libvirt/blob/master/src/libvirt-php.c</a></font><br></span></p></div></div>