terra-farm / terraform-provider-xenserver

XenServer provider for Terraform
https://terra-farm.github.io/provider-xenserver/
MIT License
72 stars 36 forks source link

netrpc: connect: no such file or directory #15

Closed leva0887 closed 6 years ago

leva0887 commented 6 years ago

I am trying to use this provider. Here are details:

[root@centos7 terraform]# ls -la
total 50396
drwxr-xr-x  3 root root       84 Nov 28 16:48 .
drwxr-xr-x. 6 root root       94 Nov 28 14:49 ..
-rwxrwxr-x  1 root root 51546560 Aug  3 00:06 terraform
drwxr-xr-x  3 root root       40 Nov 28 16:45 .terraform
-rw-r--r--  1 root root    50965 Nov 28 16:45 terraform.log
-rw-r--r--  1 root root     1035 Nov 28 15:41 xen_vm_test.tf

[root@centos7 terraform]# cat xen_vm_test.tf
provider "xenserver" {
  url = "https://10.1.127.170"
  username = ""
  password = ""
}

resource "xenserver_vdi" "vdi" {
  sr_uuid = "c5ca8524-a155-472b-b26e-5fb0da998afb"
  name_label = "test vdi"
  size = 10737418240 # 1GB
}

#resource "xenserver_network" "net" {
#  name_label = "vm only network"
#  bridge = "xapi1"
#  description = "this will create VM-only network"
#}

#resource "xenserver_vm" "web" {
#    name_label = "web"
#    base_template_name = "ol73-min"
#    static_mem_min = 2147483648 # 2GB
#    static_mem_max = 2147483648
#    dynamic_mem_min = 2147483648
#    dynamic_mem_max = 2147483648
#    boot_order = "cdn"
#    network_interface {
#        network_uuid = "1bc106b4-9764-decc-14b3-d6bb61b375f7"
#        mac = "b4:b5:2f:52:83:bc"
#        mtu = 1500
#        device = 0
#    }
#    network_interface {
#        network_uuid = "${xenserver_network.net.id}"
#        mtu = 1500
#        device = 1
#    }
#    vcpus = 2
#
#    hard_drive {
#      vdi_uuid = "${xenserver_vdi.vdi.id}"
#    }
#
#}

[root@centos7 terraform]# ls -la .terraform/plugins/linux_amd64/
total 29968
drwxr-xr-x 2 root root       59 Nov 28 16:40 .
drwxr-xr-x 3 root root       25 Nov 28 15:39 ..
-rwxr-xr-x 1 root root       85 Nov 28 16:45 lock.json
-rwxr-xr-x 1 root root 30682388 Nov 28 15:38 terraform-provider-xenserver

[root@centos7 terraform]# ./terraform init -plugin-dir=/usr/src/terraform/.terraform/plugins/linux_amd64/

Initializing provider plugins...

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.

[root@centos7 terraform]# ./terraform plan
Error asking for user input: 1 error(s) occurred:

* provider.xenserver: dial unix /tmp/plugin271598033|netrpc: connect: no such file or directory

Please help to understand what is wrong

ringods commented 6 years ago

@leva0887 does this help?

https://github.com/ringods/terraform-provider-xenserver/blob/master/website/docs/index.html.markdown#installation

leva0887 commented 6 years ago

I tried new instruction and still no result. The same error is persist.

leva0887 commented 6 years ago

Also I have debug log. Maybe it can help to understand what is wrong

2017/11/28 17:10:58 [DEBUG] plugin: starting plugin: /usr/src/terraform/.terraform/plugins/linux_amd64/terraform-provider-xenserver/terraform-provider-xenserver []string{"/usr/src/terraform/.terraform/plugins/linux_amd64/terraform-provider-xenserver/terraform-provider-xenserver"}
2017/11/28 17:10:58 [DEBUG] plugin: waiting for RPC address for: /usr/src/terraform/.terraform/plugins/linux_amd64/terraform-provider-xenserver/terraform-provider-xenserver
2017/11/28 17:10:58 [ERROR] root: eval: *terraform.EvalInitProvider, err: dial unix /tmp/plugin855433688|netrpc: connect: no such file or directory
2017/11/28 17:10:58 [ERROR] root: eval: *terraform.EvalSequence, err: dial unix /tmp/plugin855433688|netrpc: connect: no such file or directory
2017/11/28 17:10:58 [DEBUG] dag/walk: upstream errored, not walking "meta.count-boundary (count boundary fixup)"
2017/11/28 17:10:58 [DEBUG] plugin: terraform-provider-xenserver: {"@level":"debug","@message":"plugin address","@timestamp":"2017-11-28T17:10:58.480330+02:00","address":"/tmp/plugin855433688","network":"unix"}
2017/11/28 17:10:58 [DEBUG] dag/walk: upstream errored, not walking "provider.xenserver (close)"
2017/11/28 17:10:58 [DEBUG] dag/walk: upstream errored, not walking "root"
2017/11/28 17:10:58 [DEBUG] plugin: waiting for all plugin processes to complete...
2017/11/28 17:10:58 [DEBUG] plugin: /usr/src/terraform/.terraform/plugins/linux_amd64/terraform-provider-xenserver/terraform-provider-xenserver: plugin process exite`
leva0887 commented 6 years ago

Also double checked the version of terraform

[root@centos7 terraform]# ./terraform version
Terraform v0.10.0

Your version of Terraform is out of date! The latest version
is 0.11.0. You can update by downloading from www.terraform.io
mborodin commented 6 years ago

Hi, Terraform version 0.10.7 is used to compile plugin. Does update of terraform to 0.10.7 solves your problem?

ringods commented 6 years ago

@leva0887 I made a local build of commit 614328e444ad7d8da3856448b0a19fe80f378539. As @mborodin mentioned, the dependency on the Terraform sources to compile against is 0.10.7.

On my Mac, I am using the binary terraform-provider-xenserver against a normal install of 0.10.8. It is configured in ~/.terraformrc like this:

providers {
  xenserver = "/Users/ringods/Projects/golang/bin/terraform-provider-xenserver"
}

I just ran the examples/datasource_pifs against my local xenserver and it worked fine. It fetched the UUIDs from the 4 ethernet cards and dropped them in the JSON file.

Can you test again against Terraform 0.10.7 or 0.10.8? Version 0.11.0 and up is untested at this moment.

leva0887 commented 6 years ago

Issue fixed