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

Michael Pasternak mpastern at redhat.com
Mon Jul 1 12:38:31 UTC 2013


On 07/01/2013 02:37 PM, Vladimir Vyazmin wrote:
> 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.

cause you don't want to kill all vms running on this host when switching it off,
moving host to the maintenance mode will make them migrating to other host/s in
the cluster,

actually there are much more scenarios where you want to be sure that you can
safely switch off the host.

>>
>> 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
>>
> 


-- 

Michael Pasternak
RedHat, ENG-Virtualization R&D



More information about the Users mailing list