ovirtsdk4 python - global maintenance

Hi! I know how to set global maintenance mode using python SDK, something like vms_service.vm_service(vm.id).maintenance(maintenance_enabled=True) on HostedEngine. But now I try to find if global maintenance is enabled. And I'm going to give up - I can't find how to do it in documentation... Is there a way to get this info? Regards!

Hi, To enable global maintenance using Python SDK you need to fetch hosted engine VM and then call maintenance method on it: https://ovirt.github.io/python-ovirt-engine-sdk4/4.5/services.m.html#ovirtsd... Regards, Martin On Fri, Jan 20, 2023 at 6:27 AM <yevhen.kyrylchenko@gmail.com> wrote:
Hi!
I know how to set global maintenance mode using python SDK, something like
vms_service.vm_service(vm.id).maintenance(maintenance_enabled=True)
on HostedEngine.
But now I try to find if global maintenance is enabled. And I'm going to give up - I can't find how to do it in documentation...
Is there a way to get this info?
Regards! _______________________________________________ Users mailing list -- users@ovirt.org To unsubscribe send an email to users-leave@ovirt.org Privacy Statement: https://www.ovirt.org/privacy-policy.html oVirt Code of Conduct: https://www.ovirt.org/community/about/community-guidelines/ List Archives: https://lists.ovirt.org/archives/list/users@ovirt.org/message/U4RVWMBDCWECKP...
-- Martin Perina Manager, Software Engineering Red Hat Czech s.r.o.

Hi,
To enable global maintenance using Python SDK you need to fetch hosted engine VM and then call maintenance method on it:
Thanks, but, as I wrote - I know how to enable it. My question was - how can I discover if global maintenance enabled. So far I got around this problem - I just call hosted-engine --vm-status --json on one of my hosts and check output. I didn't find how to solve it with Ovirt Python SDK. Regard!
participants (2)
-
Martin Perina
-
yevhen.kyrylchenko@gmail.com