Hello to everybody,
I have started to use the PHP Api in order to give access to our customers to their VPS with KVM. We have seen that stopping and starting the virtual machine is really easy, and we will create 2 buttons that will stop or start the machine. We have tried that and is working properly.
The problem comes when we try to link our customer panel with the VPS console.
For that we have tried this way:
$nodename: Is the name of the node that we connect to
$vmid: Is an integer refering to the ID service or virtual machine
$ip: Is the IP of the server when Proxmox is, and the one used to login.
$pve2 = new PVE2_API($hostname, $username, $realm, $password);
if ($pve2->constructor_success()) {
if ($pve2->login()) {
echo "Login!"
$parameters = array("node" => $nodename,"vmid" => $vmid);
$response = $pve2->post("/nodes/$nodename/qemu/$vmid/vncproxy",$parameters);
var_dump($response);
echo "<br>";
echo "<a href='https://$ip:$port/?console=kvm&vmid=$vmid&vmname=&node=$nodename'>" . _("Open console") . "</a>";
}
}
We get Login! and then a false in var_dump($response). We would like that when opening the link, the console will appear to the user and he/she just could connect to his VPS, not see the rest of VPS in the server, etc...
Now when the click is made the Proxmox Console appears, but it asks again the login, password and the realm in order to login. In the top left we can read also Error No ticket($vmid) when $vmid is the ID of the virtual machine.
We have ensured that the machine is running.
I will much appreciate any help you can offer me.
Thanks in advance,
Gald
I have started to use the PHP Api in order to give access to our customers to their VPS with KVM. We have seen that stopping and starting the virtual machine is really easy, and we will create 2 buttons that will stop or start the machine. We have tried that and is working properly.
The problem comes when we try to link our customer panel with the VPS console.
For that we have tried this way:
$nodename: Is the name of the node that we connect to
$vmid: Is an integer refering to the ID service or virtual machine
$ip: Is the IP of the server when Proxmox is, and the one used to login.
$pve2 = new PVE2_API($hostname, $username, $realm, $password);
if ($pve2->constructor_success()) {
if ($pve2->login()) {
echo "Login!"
$parameters = array("node" => $nodename,"vmid" => $vmid);
$response = $pve2->post("/nodes/$nodename/qemu/$vmid/vncproxy",$parameters);
var_dump($response);
echo "<br>";
echo "<a href='https://$ip:$port/?console=kvm&vmid=$vmid&vmname=&node=$nodename'>" . _("Open console") . "</a>";
}
}
We get Login! and then a false in var_dump($response). We would like that when opening the link, the console will appear to the user and he/she just could connect to his VPS, not see the rest of VPS in the server, etc...
Now when the click is made the Proxmox Console appears, but it asks again the login, password and the realm in order to login. In the top left we can read also Error No ticket($vmid) when $vmid is the ID of the virtual machine.
We have ensured that the machine is running.
I will much appreciate any help you can offer me.
Thanks in advance,
Gald