Hi Shani,

Thanks for your reply. I’m aware for how to set it in the UI.
Note that because the VM is defined with Affinity label, I must first remove 
the affinity label from the VM and only than to choose a different host as you 
specified below (via the UI).
But my question is for how to set a different host using Python SDK API.

I tried/plan this via Python SDK API:

- Stop the VM.
- Remove its Affinity label.
- Update its host to the target host.
- Start the VM.

But the result is that the VM is always keep starting on its current host.
For updating the VM host, I used few ways as:
vm_service.update( types.Vm( host=types.Host( id=host_id ), ) )

Or:

vm_service.update( types.Vm( host=types.Host( name=host_name ), ) )

Then started the VM using:
vm_service.start()

or using:
vm_service.start( vm=types.Vm( host=types.Host( name=host_name ), ) )
vm_service.start( vm=types.Vm( host=types.Host( id=host_id ), ) )

I get no errors, but VM keeps starting on the current host and not on the new 
target host.
BTW - in case it would start on the target host, the plan is to add affinity 
label back just after.

Thanks,
Lavi Buchnik

From: Shani Leviim <[email protected]>
Sent: Monday, March 08, 2021 2:36 PM
To: Lavi Buchnik <[email protected]>
Cc: devel <[email protected]>
Subject: Re: [ovirt-devel] Re: Starting a defined VM on a different host

CAUTION: EXTERNAL Email.
Hi,
You can set this one from the UI:
VM > Edit > Show advanced options (bottom left button) > host > Start running 
on > specific host

[cid:[email protected]]
Regards,
Shani Leviim


On Mon, Mar 8, 2021 at 10:33 AM Lavi.Buchnik--- via Devel 
<[email protected]<mailto:[email protected]>> wrote:
Hi,

Can anyone help here?

Thanks,
Lavi
_______________________________________________
Devel mailing list -- [email protected]<mailto:[email protected]>
To unsubscribe send an email to 
[email protected]<mailto:[email protected]>
Privacy Statement: 
https://www.ovirt.org/privacy-policy.html<https://urldefense.com/v3/__https:/www.ovirt.org/privacy-policy.html__;!!NkSChLMW7qAT!oXo9NzJpksnp57RWmELqGqJO2uxOMPVtcOrXvjqi3jw_Wsx1O7hcPG7oUJoHY3TW-2oazAUO$>
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/<https://urldefense.com/v3/__https:/www.ovirt.org/community/about/community-guidelines/__;!!NkSChLMW7qAT!oXo9NzJpksnp57RWmELqGqJO2uxOMPVtcOrXvjqi3jw_Wsx1O7hcPG7oUJoHY3TW-7jzCg5C$>
List Archives: 
https://lists.ovirt.org/archives/list/[email protected]/message/ZPB676EUPWZWE3N2YX7WCCMCJ7FUMN4R/<https://urldefense.com/v3/__https:/lists.ovirt.org/archives/list/[email protected]/message/ZPB676EUPWZWE3N2YX7WCCMCJ7FUMN4R/__;!!NkSChLMW7qAT!oXo9NzJpksnp57RWmELqGqJO2uxOMPVtcOrXvjqi3jw_Wsx1O7hcPG7oUJoHY3TW-w_4vllb$>
_______________________________________________
Devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]
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/[email protected]/message/S4DZTJCLKILITXQ2XVYKHK2FNCSSTQ3J/

Reply via email to