wait until instance reports being status ready (aws checks that it is reachable) which fixes a lot of the net:ssh issues for provisioning

This commit is contained in:
Samuel Beaulieu 2022-07-22 13:37:13 -05:00
parent 0d7923ed4d
commit 4e85886da4
No known key found for this signature in database
GPG key ID: 12030F74136D0F34

View file

@ -253,6 +253,15 @@ module Vmpooler
batch_instance = connection.create_instances(config)
instance_id = batch_instance.first.instance_id
connection.client.wait_until(:instance_running, { instance_ids: [instance_id] })
@logger.log('s', "[>] [#{pool_name}] '#{new_vmname}' instance running")
### System status checks
# This check verifies that your instance is reachable. Amazon EC2 tests that network packets can get to your instance.
# If this check fails, there might be an issue with the infrastructure that is hosting your instance (such as AWS power, networking, or software systems). You can restart or replace the instance, wait for Amazon EC2s systems to resolve the issue, or seek technical support.
# This check does not validate that your operating system and applications are accepting traffic.
### Instance status checks
# This check verifies that your instance's operating system is accepting traffic.
connection.client.wait_until(:instance_status_ok, { instance_ids: [instance_id] })
@logger.log('s', "[>] [#{pool_name}] '#{new_vmname}' instance ready to accept traffic")
created_instance = get_vm(pool_name, new_vmname)
# extra setup steps