From amedeo at oscert.net Thu Oct 30 15:23:36 2014 Content-Type: multipart/mixed; boundary="===============6524873262985589502==" MIME-Version: 1.0 From: Amedeo Salvati To: users at ovirt.org Subject: [ovirt-users] Simple script to split VMs on different host - No affinity group Date: Thu, 30 Oct 2014 20:23:27 +0100 Message-ID: <5452902F.3040901@oscert.net> --===============6524873262985589502== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable This is a multi-part message in MIME format. --------------040404050008060004030301 Content-Type: text/plain; charset=3Diso-8859-15; format=3Dflowed Content-Transfer-Encoding: 7bit hello guys, if you are interested, I wrote a simple python script to balance VMs on different host/hypervisor, logic is simple and will search for same couple of vm name and number suffix, odd and even, and it will try to migrate even VM, if it resides on same host where resides the odd VM. For example if VMPROJ1PROD01 and VMPROJ1PROD02 resides on same host, then, the script will migrate only VMPROJ1PROD02. url of script and rpms are on github: http://github.com/amedeos/ovirt-BalanceVMOnDifferentHost and feel free to suggest new patch, enhancement, create a fork... p.s. I haven't use affinity groups, because maintenance of them will become a struggle, and I want *only* to run same project/application VMs with same name on different hypervisor. Best regards Amedeo Salvati --------------040404050008060004030301 Content-Type: text/html; charset=3Diso-8859-15 Content-Transfer-Encoding: 7bit hello guys,

if you are interested, I wrote a simple python script to balance VMs on
different host/hypervisor, logic is simple and will search for same
couple of vm name and number suffix, odd and even, and it will try to
migrate even VM, if it resides on same host where resides the odd VM.

For example if VMPROJ1PROD01 and VMPROJ1PROD02 resides on same host,
then, the script will migrate only VMPROJ1PROD02.

url of script and rpms are on github:

htt= p://github.com/amedeos/ovirt-BalanceVMOnDifferentHost

and feel free to suggest new patch, enhancement, create a fork...

p.s. I haven't use affinity groups, because maintenance of them will
become a struggle, and I want *only* to run same project/application VMs
with same name on different hypervisor.

Best regards
Amedeo Salvati --------------040404050008060004030301-- --===============6524873262985589502== Content-Type: multipart/alternative MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.bin" VGhpcyBp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ZmVyZW50IGh5cGVydmlzb3IuCiAgICA8YnI+CiAgICA8YnI+CiAgICBCZXN0 IHJlZ2FyZHMKICAgIDxicj4KICAgIEFtZWRlbyBTYWx2YXRpCiAgPC9ib2R5Pgo8L2h0bWw+Cgot LS0tLS0tLS0tLS0tLTA0MDQwNDA1MDAwODA2MDAwNDAzMDMwMS0tCg== --===============6524873262985589502==-- From iheim at redhat.com Fri Oct 31 07:51:39 2014 Content-Type: multipart/mixed; boundary="===============3245997143361674919==" MIME-Version: 1.0 From: Itamar Heim To: users at ovirt.org Subject: Re: [ovirt-users] Simple script to split VMs on different host - No affinity group Date: Fri, 31 Oct 2014 13:51:12 +0200 Message-ID: <545377B0.3090104@redhat.com> In-Reply-To: 5452902F.3040901@oscert.net --===============3245997143361674919== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On 10/30/2014 09:23 PM, Amedeo Salvati wrote: > hello guys, > > if you are interested, I wrote a simple python script to balance VMs on > different host/hypervisor, logic is simple and will search for same > couple of vm name and number suffix, odd and even, and it will try to > migrate even VM, if it resides on same host where resides the odd VM. > > For example if VMPROJ1PROD01 and VMPROJ1PROD02 resides on same host, > then, the script will migrate only VMPROJ1PROD02. > > url of script and rpms are on github: > > http://github.com/amedeos/ovirt-BalanceVMOnDifferentHost > > and feel free to suggest new patch, enhancement, create a fork... > > p.s. I haven't use affinity groups, because maintenance of them will > become a struggle, and I want *only* to run same project/application VMs > with same name on different hypervisor. > > Best regards > Amedeo Salvati > > > _______________________________________________ > Users mailing list > Users(a)ovirt.org > http://lists.ovirt.org/mailman/listinfo/users > just a thought - you can implement this in a more integrated mannger as = part of the pluggable scheduler? --===============3245997143361674919==-- From amedeo at oscert.net Sun Nov 2 08:33:39 2014 Content-Type: multipart/mixed; boundary="===============6716982424466623917==" MIME-Version: 1.0 From: Amedeo Salvati To: users at ovirt.org Subject: Re: [ovirt-users] Simple script to split VMs on different host - No affinity group Date: Sun, 02 Nov 2014 14:33:32 +0100 Message-ID: <545632AC.7040202@oscert.net> In-Reply-To: 545377B0.3090104@redhat.com --===============6716982424466623917== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable yea, if I have the time I will integrate on a new scheduler best regards a Il 31/10/2014 12:51, Itamar Heim ha scritto: > On 10/30/2014 09:23 PM, Amedeo Salvati wrote: >> hello guys, >> >> if you are interested, I wrote a simple python script to balance VMs on >> different host/hypervisor, logic is simple and will search for same >> couple of vm name and number suffix, odd and even, and it will try to >> migrate even VM, if it resides on same host where resides the odd VM. >> >> For example if VMPROJ1PROD01 and VMPROJ1PROD02 resides on same host, >> then, the script will migrate only VMPROJ1PROD02. >> >> url of script and rpms are on github: >> >> http://github.com/amedeos/ovirt-BalanceVMOnDifferentHost >> >> and feel free to suggest new patch, enhancement, create a fork... >> >> p.s. I haven't use affinity groups, because maintenance of them will >> become a struggle, and I want *only* to run same project/application VMs >> with same name on different hypervisor. >> >> Best regards >> Amedeo Salvati >> >> >> _______________________________________________ >> Users mailing list >> Users(a)ovirt.org >> http://lists.ovirt.org/mailman/listinfo/users >> > > just a thought - you can implement this in a more integrated mannger = > as part of the pluggable scheduler? > --===============6716982424466623917==-- From dfediuck at redhat.com Sun Nov 2 15:15:55 2014 Content-Type: multipart/mixed; boundary="===============6954083158063245116==" MIME-Version: 1.0 From: Doron Fediuck To: users at ovirt.org Subject: Re: [ovirt-users] Simple script to split VMs on different host - No affinity group Date: Sun, 02 Nov 2014 15:15:49 -0500 Message-ID: <952172317.5781122.1414959349757.JavaMail.zimbra@redhat.com> In-Reply-To: 545632AC.7040202@oscert.net --===============6954083158063245116== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable ----- Original Message ----- > From: "Amedeo Salvati" > To: "Itamar Heim" , users(a)ovirt.org > Cc: "df >> Doron Fediuck" > Sent: Sunday, November 2, 2014 3:33:32 PM > Subject: Re: [ovirt-users] Simple script to split VMs on different host -= No affinity group > = > yea, if I have the time I will integrate on a new scheduler > = > best regards > a > = > Il 31/10/2014 12:51, Itamar Heim ha scritto: > > On 10/30/2014 09:23 PM, Amedeo Salvati wrote: > >> hello guys, > >> > >> if you are interested, I wrote a simple python script to balance VMs on > >> different host/hypervisor, logic is simple and will search for same > >> couple of vm name and number suffix, odd and even, and it will try to > >> migrate even VM, if it resides on same host where resides the odd VM. > >> > >> For example if VMPROJ1PROD01 and VMPROJ1PROD02 resides on same host, > >> then, the script will migrate only VMPROJ1PROD02. > >> > >> url of script and rpms are on github: > >> > >> http://github.com/amedeos/ovirt-BalanceVMOnDifferentHost > >> > >> and feel free to suggest new patch, enhancement, create a fork... > >> > >> p.s. I haven't use affinity groups, because maintenance of them will > >> become a struggle, and I want *only* to run same project/application V= Ms > >> with same name on different hypervisor. > >> > >> Best regards > >> Amedeo Salvati > >> > >> > >> _______________________________________________ > >> Users mailing list > >> Users(a)ovirt.org > >> http://lists.ovirt.org/mailman/listinfo/users > >> > > > > just a thought - you can implement this in a more integrated mannger > > as part of the pluggable scheduler? > > > = > = Very nice! You can see examples to integration with the scheduler here: https://github.com/oVirt/ovirt-scheduler-proxy/tree/master/doc/plugin_sampl= es And some explanations here: http://www.ovirt.org/External_Scheduler_Samples --===============6954083158063245116==--