Merge pull request #53 from puppetlabs/RE-15750

(RE-15750) Handle vm no longer existing when attempting to migrate.
This commit is contained in:
isaac-hammes 2023-09-07 15:07:44 -07:00 committed by GitHub
commit c91e62150a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1103,6 +1103,9 @@ module Vmpooler
begin
connection = ensured_vsphere_connection(pool_object)
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.hset("vmpooler__vm__#{vm_name}", 'host', vm_hash['host_name'])
migration_count = redis.scard('vmpooler__migration')