title: R Google Compute Engine create cluster error
body: <p>I'm trying to create an R cluster comprised on VMs on GCE. I've followed the example from <a href="https://cran.r-project.org/web/packages/googleComputeEngineR/vignettes/massive-parallel.html" rel="nofollow noreferrer">googleComputeEngineR</a>. I've pasted the code below. </p>
  
  <pre><code>######
  vm_names &lt;- paste0("cpu",1:2)
  
  ## specify the cheapest VMs that may get turned off
  preemptible = list(preemptible = TRUE)
  
  ## start up 2 VMs with R base on them (can also customise via Dockerfiles using gce_vm_template instead)
  fiftyvms &lt;- lapply(vm_names, gce_vm, predefined_type = "n1-standard-1",
                     template = "r-base", scheduling = preemptible)
  
  ## add any ssh details, username etc.
  fiftyvms &lt;- lapply(fiftyvms, gce_ssh_setup)
  
  ## once all launched, add to cluster
  plan(cluster, workers = as.cluster(fiftyvms))
  </code></pre>
  
  <p>Basically, I can create the VMs and establish SSH access to them, but the socketConnection keeps timing out. Any thoughts on what might be wrong?</p>
  
  <p>This is the output I get:</p>
  
  <blockquote>
    <p>2018-10-10 20:27:20> Creating template VM</p>
    
    <p>2018-10-10 20:27:22> Checking operation...PENDING</p>
    
    <p>2018-10-10 20:27:33> Operation running...</p>
    
    <p>2018-10-10 20:27:53> Operation complete in 17 secs</p>
    
    <p>2018-10-10 20:27:53> External IP for instance cpu1 : 35.240.99.251</p>
    
    <p>2018-10-10 20:27:53> ## VM r-base running at 35.240.99.251</p>
    
    <p>2018-10-10 20:27:53> Wait a few minutes for inital docker container to 
                download and install before logging in.</p>
    
    <p>2018-10-10 20:27:54> VM running</p>
    
    <p>2018-10-10 20:27:59> Creating template VM</p>
    
    <p>2018-10-10 20:28:01> Checking operation...PENDING</p>
    
    <p>2018-10-10 20:28:21> Operation complete in 5 secs</p>
    
    <p>2018-10-10 20:28:22> External IP for instance cpu2 : 35.205.28.126</p>
    
    <p>2018-10-10 20:28:22> ## VM r-base running at 35.205.28.126</p>
    
    <p>2018-10-10 20:28:22> Wait a few minutes for inital docker container to 
                download and install before logging in.</p>
    
    <p>2018-10-10 20:28:23> VM running</p>
  </blockquote>
  
  <pre><code> ## add any ssh details, username etc.
   fiftyvms &lt;- lapply(fiftyvms, gce_ssh_setup)
  </code></pre>
  
  <blockquote>
    <p>2018-10-10 20:28:30> Public SSH key uploaded to instance</p>
    
    <p>2018-10-10 20:28:38> Public SSH key uploaded to instance</p>
  </blockquote>
  
  <pre><code>## once all launched, add to cluster
  plan(cluster, workers = as.cluster(fiftyvms))
  </code></pre>
  
  <blockquote>
    <p>2018-10-10 20:28:59> External IP for instance cpu1 : 35.240.99.251</p>
    
    <p>Error in socketConnection("localhost", port = port, server = TRUE, blocking = 
      TRUE,  : </p>
    
    <p>reached elapsed time limit</p>
  </blockquote>