remote command exited without exit status or exit signal

2,317 views
Skip to first unread message

andr...@gmail.com

unread,
Apr 5, 2018, 6:55:59 PM4/5/18
to Terraform
Hello,

after updating to v0.11.5 of terraform I started getting this error:

Errror: Error applying plan:
1 error(s) occurred:
* module.abigar2.vsphere_virtual_machine.docker-node: Remote command exited with error: wait: remote command exited without exit status or exit signal

It used to work before.

I had a few reboots in the provisioners like this:


  provisioner "remote-exec" {
    inline = [
      # Docker may be not up immediately after reboot
      "sleep 15",
      "sudo ros config set hostname ${var.node_name}",
      # This pluging only works in the swarm mode
      # "docker plugin install --grant-all-permissions --alias vfile vmware/vfile:latest",
      "docker plugin install --grant-all-permissions --alias vsphere vmware/vsphere-storage-for-docker:latest",
      "sudo wget -q -O /var/lib/rancher/conf/volume-cifs2.yml https://minio.barfoot.co.nz/installs/volume-cifs2.yml",
      "sudo ros service enable /var/lib/rancher/conf/volume-cifs2.yml",
      "sudo reboot > /dev/null",
    ]
  }
  provisioner "remote-exec" {
    inline = [
      # Docker may be not up immediately after reboot
      "sleep 15",
      "${var.ssh_authorized_keys}",
      "${local.rancher_registration}",
      "sudo ros config set rancher.network.interfaces.eth0.address ${var.ip}/24",
      "sudo ros config set rancher.network.interfaces.eth0.gateway ${var.gateway_admin}",
      "sudo ros config set rancher.network.interfaces.eth0.dhcp false",
      "sudo ros config set rancher.network.interfaces.eth1.address ${var.ip_dmz}/24",
      "sudo ros config set rancher.network.interfaces.eth1.gateway ${var.gateway_dmz}",
      "sudo ros config set rancher.network.interfaces.eth1.dhcp false",
      "sudo ros config set rancher.network.interfaces.eth2.address ${var.ip_dmz_be}/24",
      "sudo ros config set rancher.network.interfaces.eth2.gateway ${var.gateway_dmz_be}",
      "sudo ros config set rancher.network.interfaces.eth2.dhcp false",
      "sudo ros config set rancher.network.dns.nameservers \"${var.dns}\"",
      "sudo reboot > /dev/null",
    ]
  }

Now it seems to error out upon reboot. How do I make it work again?

andr...@gmail.com

unread,
Apr 5, 2018, 6:56:50 PM4/5/18
to Terraform
Forgot to add this is vSphere provider (provider.vsphere v1.3.3)

andr...@gmail.com

unread,
Apr 5, 2018, 9:20:17 PM4/5/18
to Terraform
Here is more generic question:

How, after changes introduced in 0.11.5, does one perform a VM reboot and wait for it to come out of reboot?

Running the reboot command in a "remote-exec" used to work before this version but it does not work any more. What is the alternative?

andr...@gmail.com

unread,
Apr 5, 2018, 9:29:26 PM4/5/18
to Terraform
Correction, 0.11.4 gives the same error. 0.11.3 works.

Dani García

unread,
Apr 20, 2018, 1:55:57 AM4/20/18
to Terraform
Hi,

I have the same problem after upgrading to 0.11.7. You can workaround it using this command instead of "reboot": "sudo shutdown -r +1". The problem is you have to wait 1 min before the reboot.

Hope this helps.

Regards,

Dani
Reply all
Reply to author
Forward
0 new messages