Guest hookscript is only firing 'post-stop'. The rest of them ('pre-stop', 'pre-start', 'post-start') never fires, even if the commands are from the UI panel. Neither post-start fires, which i was supposed to fire when the machine is on. Checked that by printing the args and checking daemon.log, only the post-stop event is printed.
Edit: It seems that they are printed inside the task history of that VM. However, I don't seem to be able to create a file inside a guest hookscript, is there any way to communicate between phases? Example, I want to save something on the pre-stop and work with it on the post-stop.
Edit 2: After some more debugging, it seems I am able to create/delete the file successfully, however where it fails it is when calling the post-stop if the vm shutdown from inside (pressing the windows power off button within the VM).
This is the log of a shutdown from the proxmox panel:
And this is the log of a shutdown from inside the VM itself:
It doesn't finishes the cleanup as it says "vm still running" even tho the VM actually is shutdown
Edit: It seems that they are printed inside the task history of that VM. However, I don't seem to be able to create a file inside a guest hookscript, is there any way to communicate between phases? Example, I want to save something on the pre-stop and work with it on the post-stop.
Edit 2: After some more debugging, it seems I am able to create/delete the file successfully, however where it fails it is when calling the post-stop if the vm shutdown from inside (pressing the windows power off button within the VM).
This is the log of a shutdown from the proxmox panel:
Code:
Jul 14 23:46:53 proxmox qmeventd[1170]: Starting cleanup for 100
Jul 14 23:46:53 proxmox qmeventd[1170]: trying to acquire lock...
Jul 14 23:46:55 proxmox qmeventd[1170]: OK
Jul 14 23:46:55 proxmox qmeventd[1170]: GUEST HOOK: 100 post-stop
Jul 14 23:46:55 proxmox qmeventd[1170]: GUEST HOOK -> post-stop -> File is existent!Finished cleanup for 100
And this is the log of a shutdown from inside the VM itself:
Code:
Jul 14 23:51:18 proxmox qmeventd[1170]: Starting cleanup for 100
Jul 14 23:51:18 proxmox qmeventd[1170]: vm still running
It doesn't finishes the cleanup as it says "vm still running" even tho the VM actually is shutdown
Last edited: