With a state machine retry, the method should complete, but the whole state machine will be re-instantiated starting from the retrying method, after the retry interval time period has elapsed.
Here’s an example of a check_completed method:
$evm.log(:info, "In /Stuff/StateMachines/Methods/check_completed")
update_cmdb_request = $evm.vmdb(:miq_request, $evm.get_state_var(:update_cmdb_request_id))
$evm.log(:info, "update_cmdb_request ID = #{update_cmdb_request.id}")
$evm.log(:info, "request state = #{update_cmdb_request.state}")
case update_cmdb_request.state
when "pending", "active"
$evm.log(:info, "Request still active, waiting for 15 seconds...")
$evm.root['ae_retry_interval'] = '15.seconds'
$evm.root['ae_result'] = 'retry'
when "finished"
$evm.log(:info, "Request complete!")
$evm.root['ae_result'] = 'ok'
else
$evm.log(:info, "Not sure what happened")
$evm.root['ae_result'] = 'error'
end
exit MIQ_OK
What did you set as your $evm.root[‘ae_retry_interval’]?
pemcg