mirror of
https://github.com/puppetlabs/vmpooler-provider-vsphere.git
synced 2026-01-25 19:08:41 -05:00
Merge pull request #53 from puppetlabs/RE-15750
(RE-15750) Handle vm no longer existing when attempting to migrate.
This commit is contained in:
commit
c91e62150a
1 changed files with 3 additions and 0 deletions
|
|
@ -1103,6 +1103,9 @@ module Vmpooler
|
||||||
begin
|
begin
|
||||||
connection = ensured_vsphere_connection(pool_object)
|
connection = ensured_vsphere_connection(pool_object)
|
||||||
vm_hash = get_vm_details(pool_name, vm_name, connection)
|
vm_hash = get_vm_details(pool_name, vm_name, connection)
|
||||||
|
|
||||||
|
raise StandardError, 'failed to get vm details. vm is unreachable or no longer exists' if vm_hash.nil?
|
||||||
|
|
||||||
@redis.with_metrics do |redis|
|
@redis.with_metrics do |redis|
|
||||||
redis.hset("vmpooler__vm__#{vm_name}", 'host', vm_hash['host_name'])
|
redis.hset("vmpooler__vm__#{vm_name}", 'host', vm_hash['host_name'])
|
||||||
migration_count = redis.scard('vmpooler__migration')
|
migration_count = redis.scard('vmpooler__migration')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue