I want to change via the windows vm gest method
I have this command which works on my proxmox shell ssh:
qm guest exec 112 cmd.exe /c "powershell New-NetIPAddress -InterfaceAlias Ethernet -IPAddress 196.50.63.101 -PrefixLength 24 -DefaultGateway 196.50.63.1"
on the other hand I wanted to use the proxmox API like this:
function setVMIP($node, $vmid, $ip) {
connectToProxmox();
$data = array('command' => ('cmd.exe /c "powershell New-NetIPAddress -InterfaceAlias Ethernet -IPAddress 196.50.63.101 -PrefixLength 24 -DefaultGateway 196.50.63.1"'),
// 'input-data' => '/c "powershell New-NetIPAddress -InterfaceAlias Ethernet -IPAddress 196.50.63.101 -PrefixLength 24 -DefaultGateway 196.50.63.1"',
'node' => $node,
'vmid' => $vmid
);
return Nodes::setIP($node, $vmid, $data);
}
Is there anyone who has worked with this method or has another solution to change the IP of a Windows VM on proxmox?
I have this command which works on my proxmox shell ssh:
qm guest exec 112 cmd.exe /c "powershell New-NetIPAddress -InterfaceAlias Ethernet -IPAddress 196.50.63.101 -PrefixLength 24 -DefaultGateway 196.50.63.1"
on the other hand I wanted to use the proxmox API like this:
function setVMIP($node, $vmid, $ip) {
connectToProxmox();
$data = array('command' => ('cmd.exe /c "powershell New-NetIPAddress -InterfaceAlias Ethernet -IPAddress 196.50.63.101 -PrefixLength 24 -DefaultGateway 196.50.63.1"'),
// 'input-data' => '/c "powershell New-NetIPAddress -InterfaceAlias Ethernet -IPAddress 196.50.63.101 -PrefixLength 24 -DefaultGateway 196.50.63.1"',
'node' => $node,
'vmid' => $vmid
);
return Nodes::setIP($node, $vmid, $data);
}
Is there anyone who has worked with this method or has another solution to change the IP of a Windows VM on proxmox?