← Back to team overview

cloud-init-dev team mailing list archive

Re: [Merge] ~powersj/cloud-init:cii-restructure-ssh into cloud-init:master

 


Diff comments:

> diff --git a/tests/cloud_tests/platforms/instances.py b/tests/cloud_tests/platforms/instances.py
> index 3bad021..fa392b7 100644
> --- a/tests/cloud_tests/platforms/instances.py
> +++ b/tests/cloud_tests/platforms/instances.py
> @@ -98,21 +103,21 @@ class Instance(TargetBase):
>          client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
>          private_key = paramiko.RSAKey.from_private_key_file(self.ssh_key_file)
>  
> -        retries = 30
> +        retries = 3
>          while retries:
>              try:
>                  client.connect(username=self.ssh_username,
>                                 hostname=self.ssh_ip, port=self.ssh_port,
> -                               pkey=private_key, banner_timeout=30)

My change would make this unset and would not have a timeout as there is no default.

> +                               pkey=private_key)
>                  self._ssh_client = client
>                  return client
>              except (ConnectionRefusedError, AuthenticationException,
>                      BadHostKeyException, ConnectionResetError, SSHException,
> -                    OSError) as e:
> +                    OSError):
>                  retries -= 1
> -                time.sleep(10)
> +                time.sleep(3)

It is an arbitrary change, much like how 10 seconds was arbitrarily was used when creating the nocloud-kvm backend. My objective is to make the SSH timeout much shorter and prevent the massive 1 hour retry loop we have now, down to less than 30 seconds. This comes based on the assumption that if we can't SSH to a node after 30 seconds, then it is either unreachable or dead.

>  
> -        ssh_cmd = 'Failed ssh connection to %s@%s:%s after 300 seconds' % (
> +        ssh_cmd = 'Failed ssh connection to %s@%s:%s after 3 retries' % (
>              self.ssh_username, self.ssh_ip, self.ssh_port
>          )
>          raise util.InTargetExecuteError(b'', b'', 1, ssh_cmd, 'ssh')


-- 
https://code.launchpad.net/~powersj/cloud-init/+git/cloud-init/+merge/342010
Your team cloud-init commiters is requested to review the proposed merge of ~powersj/cloud-init:cii-restructure-ssh into cloud-init:master.


References