[Users] Putting the host in maintenance mode via python SDK

Vladimir Vyazmin vvyazmin at redhat.com
Mon Jul 1 11:37:00 UTC 2013


Hi,

There is any a via pythonSDK to put the host in maintenance mode:

hostObject = API.hosts.get(fakeHostNames)

turboMaintenanceHost(hostObject)

##### Turbo Maintenance Host #####
def turboMaintenanceHost(vmObject):
    """ maintenance Host"""
    if vmObject.status.state == 'up':
        vmObject.deactivate()
        LOGGER.info(TimestampScale() + "Object '%s' maintenance." % vmObject.name)
    else:
        LOGGER.warning(TimestampScale() + "Failed maintenance '%s' Object." % vmObject.name)
    return True





----- Original Message -----
> From: "Deepthi Dharwar" <deepthi at linux.vnet.ibm.com>
> To: users at ovirt.org, "Michael Pasternak" <mpastern at redhat.com>
> Sent: Monday, July 1, 2013 2:13:09 PM
> Subject: [Users] Putting the host in maintenance mode via python SDK
> 
> Hi,
> 
> I am trying to switch off Hosts in DC which are idle.
> 
> I wanted to know as to why start/stop of hosts options are enabled in
> Power Mgmt tab only when the host is in Maintenance mode and not otherwise.
> 
> Also, is there any way via pythonSDK to put the host in maintenance mode ?
> 
> Regards,
> Deepthi
> 
> _______________________________________________
> Users mailing list
> Users at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/users
> 

-- 

Have a nice day ☺☻☺☻☺!
Thank you and best regards

Vladimir Vyazmin
Mobile:  +972 (0) 50 277 2707
Phone:   +972 (0) 9 769 2346
Email:   vvyazmin at redhat.com



More information about the Users mailing list