P proxmox_larry Member Nov 7, 2019 32 0 6 44 Feb 3, 2020 #1 Hey guys, I can't access the Proxmox API from the VM, only from my host... How can that be changed? Thanks!
Hey guys, I can't access the Proxmox API from the VM, only from my host... How can that be changed? Thanks!
oguz Proxmox Retired Staff Retired Staff Nov 19, 2018 5,207 803 118 Feb 3, 2020 #2 hi, try to see if you can access it with curl from inside the VM. use the -v flag for verbose info (to see what's going on) use the IP of the PVE host, and don't forget the port 8006
hi, try to see if you can access it with curl from inside the VM. use the -v flag for verbose info (to see what's going on) use the IP of the PVE host, and don't forget the port 8006
P proxmox_larry Member Nov 7, 2019 32 0 6 44 Feb 3, 2020 #3 Is it possible to save the value that is being returned by pvesh in a variable ?
oguz Proxmox Retired Staff Retired Staff Nov 19, 2018 5,207 803 118 Feb 3, 2020 #4 use --output-format=json or json-pretty with your pvesh command. afterwards you can parse the json with whatever you like
use --output-format=json or json-pretty with your pvesh command. afterwards you can parse the json with whatever you like
P proxmox_larry Member Nov 7, 2019 32 0 6 44 Feb 3, 2020 #5 Do you have an example how I could possibly use the returned json? Especially for pvesh get /cluster/ressources to store the value on which host the vm is running in a variable.
Do you have an example how I could possibly use the returned json? Especially for pvesh get /cluster/ressources to store the value on which host the vm is running in a variable.
oguz Proxmox Retired Staff Retired Staff Nov 19, 2018 5,207 803 118 Feb 3, 2020 #6 you can use jq for example. see the manual[0] [0]: https://stedolan.github.io/jq/manual/