In the days I started working on a VM manager platform, it works with virt-manager, KVM and PhP 7.2. In form.html should specify the values that kvm2.php can run the VM create command.
The problem is that I give the values well and fill the fields, kvm2.php (libvirt) writes this error message continuously:
"ERROR
--name is required
--memory amount in MiB is required"
What have I done wrong?
Thank you in advance for your answers,
Erik
Screenshots:
https://i.stack.imgur.com/oKXiS.jpg
form.html:
<form action="kvm2.php" method="get">
VM name: <input type="text" name="VMname" id="VMname" required><br>
vCPU number(s): <input type="text" name="VMvCPU" id="VMvCPU" required><br>
Memory (in MB): <input type="text" name="VMmem" id="VMmem" required><br>
Disk size (in GB): <input type="text" name="VMdisk" id="VMdisk" required><br>
<input type="submit" name="submit">
</form>
kvm2.php:
<?php
$output=shell_exec("virt-install --connect qemu:///system --name=$VMname --vcpus=$VMvCPU --memory=$VMmem --disk size=$VMdisk --cdrom=/home/erik/Letöltések/debian.iso --os-type linux --vnc --network=bridge:br0 2>&1");
echo "<pre>$output</pre>";
?>
EDIT:
The current code is:
$output=shell_exec("sudo virt-install --connect qemu:///system --name=$_GET["VMname"]; --vcpus=$_GET["VMvCPU"]; --memory=$_GET["VMmem"]; --disk size=$_GET["VMdisk"]; 2>&1");
As requested, I turned on display errors:
Parse error: syntax error, unexpected '"', expecting '-' or identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) on line 2