fog / fog-xenserver

Module for the 'fog' gem to support XENSERVER
MIT License
16 stars 22 forks source link

VM affinity not working #53

Closed hanej closed 8 years ago

hanej commented 8 years ago

We're using the foreman-xen plugin (which uses this under the covers) for The Foreman to build VMs on multiple Xen clusters. It seems the affinity is not working correctly and always builds on the master node. No matter what slave the affinity is set to it seems to be ignored. Have you experienced this problem?

When using the Java API years ago we had the same issue so I don't think it's specific to your code, just hoping you've come across this and had an answer.

plribeiro3000 commented 8 years ago

Hey @hanej . I never had this problem so far.

Just looked at the code and could not find anything that could replicate this behaviour. Perhaps it is XEN related?

Thanks!

hanej commented 8 years ago

Thank you for checking. I posted this question on the XenServer discussion forums too. Hopefully we figure it out.

Very nice library though! It works well.

plribeiro3000 commented 8 years ago

Thank you @hanej . Thats awesome to have feedback. Could you post the link of the forum here plz?

Thanks!

hanej commented 8 years ago

The link is

http://discussions.citrix.com/topic/373231-vm-affinity-not-working/

fernandes commented 8 years ago

@hanej this weekend playing with xenserver 6.5 I got the same thing as you mentioned

as Tobias mentioned on the forum, you need to set the affinity for the vm being created, so this will work:

template.class
# => Fog::Compute::XenServer::Models::Server
template.affinity = conn.hosts[0]
template.save
# true

hope this may help you