mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 10:08:40 -05:00
Merge pull request #228 from mattkirby/least_used_host_fixup
Update find_least_used_compatible_host to specify pool
This commit is contained in:
commit
7902769611
2 changed files with 3 additions and 3 deletions
|
|
@ -490,7 +490,7 @@ module Vmpooler
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
$redis.sadd('vmpooler__migration', vm_name)
|
$redis.sadd('vmpooler__migration', vm_name)
|
||||||
host_name = provider.find_least_used_compatible_host(vm_name)
|
host_name = provider.find_least_used_compatible_host(pool_name, vm_name)
|
||||||
if host_name == parent_host_name
|
if host_name == parent_host_name
|
||||||
$logger.log('s', "[ ] [#{pool_name}] No migration required for '#{vm_name}' running on #{parent_host_name}")
|
$logger.log('s', "[ ] [#{pool_name}] No migration required for '#{vm_name}' running on #{parent_host_name}")
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -1619,7 +1619,7 @@ EOT
|
||||||
|
|
||||||
context 'and host to migrate to is the same as the current host' do
|
context 'and host to migrate to is the same as the current host' do
|
||||||
before(:each) do
|
before(:each) do
|
||||||
expect(provider).to receive(:find_least_used_compatible_host).with(vm).and_return(vm_parent_hostname)
|
expect(provider).to receive(:find_least_used_compatible_host).with(pool, vm).and_return(vm_parent_hostname)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should not migrate the VM" do
|
it "should not migrate the VM" do
|
||||||
|
|
@ -1648,7 +1648,7 @@ EOT
|
||||||
context 'and host to migrate to different to the current host' do
|
context 'and host to migrate to different to the current host' do
|
||||||
let(:vm_new_hostname) { 'new_hostname' }
|
let(:vm_new_hostname) { 'new_hostname' }
|
||||||
before(:each) do
|
before(:each) do
|
||||||
expect(provider).to receive(:find_least_used_compatible_host).with(vm).and_return(vm_new_hostname)
|
expect(provider).to receive(:find_least_used_compatible_host).with(pool, vm).and_return(vm_new_hostname)
|
||||||
expect(subject).to receive(:migrate_vm_and_record_timing).with(vm, pool, vm_parent_hostname, vm_new_hostname, provider).and_return('1.00')
|
expect(subject).to receive(:migrate_vm_and_record_timing).with(vm, pool, vm_parent_hostname, vm_new_hostname, provider).and_return('1.00')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue