On 07/02/2013 07:38 AM, Deepthi Dharwar wrote:
On 07/01/2013 06:08 PM, Michael Pasternak wrote:
> 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
>>
Thanks for this piece of code. Shall give it a try.
>>
>>
>>
>> ----- Original Message -----
>>> From: "Deepthi Dharwar" <deepthi(a)linux.vnet.ibm.com>
>>> To: users(a)ovirt.org, "Michael Pasternak"
<mpastern(a)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.
So as I understand, issuing a STOP just halts the host but not migrate
VMs . This needs to be done by putting the host in the maintenance mode
where all the VMs running are migrated. Host is disconnected from the
storage pool after which one can shut-down the system.
Maintenance is per-requisite mode where u explicitly tell the engine
to migrate the VMs and disconnect host from storage and not done as part
of integral shutdown process.
correct.
>>>
>>> Also, is there any way via pythonSDK to put the host in maintenance mode ?
>>>
>>> Regards,
>>> Deepthi
>>>
>>> _______________________________________________
>>> Users mailing list
>>> Users(a)ovirt.org
>>>
http://lists.ovirt.org/mailman/listinfo/users
>>>
>>
>
>
--
Michael Pasternak
RedHat, ENG-Virtualization R&D