nanovms / ops

ops - build and run nanos unikernels
https://ops.city
MIT License
1.27k stars 132 forks source link

add shutdown support for proxmox #1361

Closed eyberg closed 1 year ago

eyberg commented 2 years ago

right now you need to use 'stop' - prob need some nanos support here

francescolavra commented 1 year ago

It works for me (I'm using Proxmox Virtual Environment 7.2-3, with nested virtualization).

francesco@ubuntu:~$ ops instance list -t proxmox
+-----+------+--------+---------+---------+
| ID  | NAME | MAINIP | STATUS  | IMAGEID |
+-----+------+--------+---------+---------+
| 100 | webg |        | running |         |
+-----+------+--------+---------+---------+
francesco@ubuntu:~$ ops instance stop 100 -t proxmox
francesco@ubuntu:~$ ops instance list -t proxmox
+-----+------+--------+---------+---------+
| ID  | NAME | MAINIP | STATUS  | IMAGEID |
+-----+------+--------+---------+---------+
| 100 | webg |        | stopped |         |
+-----+------+--------+---------+---------+

Note that you have to use the instance ID (in this example, 100), not the instance name (webg). The ops instance stop command force-stops the VM (like pressing CTRL-C with Qemu), so the instance is stopped immediately regardless of whether the kernel handles the shutdown signal. The Proxmox API contains an endpoint to do a graceful shutdown (https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/qemu/{vmid}/status/shutdown), which is not being used by ops. I verified, by issuing a shutdown command from the Proxmox web interface, that the kernel handles correctly the shutdown signal and powers down the VM.

eyberg commented 1 year ago

hrm - i just tried again and both stop and shutdown from gui seem to work for me too, closing