Description of problem: It would be nice if Python-SDK allowed specifying the shutdown reason using the .shutdown() call of Connection.system_service().vms_service().vm_service() Currently this is not implemented.
In order to have this in the Python SDK (and in all the other SDKs) we need to add it to the specification of the API, and then implement it in the API itself, so I am moving to the API component. Once it is implemented in the API the SDKs will automatically reflect it.
This should be added also to the 'stop' operation. We already have a 'stop_reason' attribute in the VM type, so I think this could be implemented copying the reason provided by the user into that attribute, both for the 'shutodwn' and 'stop' operations. I'd suggest to define it as follows: POST /ovirt-engine/api/vms/123/shutdown?reason=My%20reason In the Python SDK it will then be used like this: vm_service = ... vm_service.shutdown( reason='My reason' ) Same for 'stop'.
This will not be addressed in a reasonable timeframe. Please re-open if it's still important.
Even if not implemented in a short timefrime, it's still important to us... It allows to automatize tasks from the Python-SDK API and let the users know why the VMs were shut down.
*** Bug 1751734 has been marked as a duplicate of this bug. ***
Let's also fix the other half (shutdown/stop reason propagation from the admin portal) in this bug
Verified on: ovirt-engine-4.4.0-0.25.master.el8ev.noarch Steps: 1. # curl -X POST -H "Content-type: application/xml" -u admin@internal:<password> --insecure https://<engine-fqdn>/ovirt-engine/api/v4/vms/<vm-id>/stop -d'<action><reason>why not</reason></action>' 2. On engine: # grep "why not" /var/log/ovirt-engine/engine.log 3. Checked the Events Tab in the engine GUI Results: Vm successfully stopped with reason message "why not" showing in the logs and in the events tab
This bugzilla is included in oVirt 4.4.0 release, published on May 20th 2020. Since the problem described in this bug report should be resolved in oVirt 4.4.0 release, it has been closed with a resolution of CURRENT RELEASE. If the solution does not work for you, please open a new bug report.