mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 10:08:40 -05:00
(POOLER-26) Fix lost VMs getting stuck in pending
This commit updates vmpooler to understand how to resolve a situation where a pending VM does not exist. Without this change a pending VM that does not exist in vmware inventory gets stuck in the pending state, preventing the pool from ever reaching its target capacity. As a part of this change the find_vm method is updated to perform a light, then heavy search each time find_vm is called and all usage of find_vm || find_vm_heavy is replaced. This makes find_vm usage consistent across pool_manager. Additionally, open_socket method is updated to resolve an incorrect reference to the host name.
This commit is contained in:
parent
a6c8c76d31
commit
02327dfcd6
4 changed files with 19 additions and 18 deletions
|
|
@ -40,7 +40,6 @@ describe 'Pool Manager' do
|
|||
create_migrating_vm vm['name'], pool, redis
|
||||
allow(vsphere).to receive(:find_vm).and_return(vm)
|
||||
allow(pooler).to receive(:get_vm_host_info).and_return([{'name' => 'host1'}, 'host1'])
|
||||
expect(vsphere).to receive(:find_vm).with(vm['name'])
|
||||
end
|
||||
|
||||
it 'logs VM host when migration is disabled' do
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ describe 'Pool Manager' do
|
|||
it 'calls fail_pending_vm' do
|
||||
allow(vsphere).to receive(:find_vm).and_return(nil)
|
||||
allow(redis).to receive(:hget)
|
||||
expect(redis).to receive(:hget).with(String, 'clone').once
|
||||
subject._check_pending_vm(vm, pool, timeout, vsphere)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue