Closed stephenwilliams closed 4 years ago
@stephenwilliams I haven't tested this yet with Go 1.11.x. If you find the problem, please submit a PR.
Same here
$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.13.4
BuildVersion: 17E199
Tried with go https://golang.org/dl/ versions
$ go version
go version go1.10.5 darwin/amd64$ go get -v github.com/ringods/terraform-provider-xenserver
`github.com/ringods/terraform-provider-xenserver (download) github.com/hashicorp/terraform (download) github.com/terra-farm/terraform-provider-xenserver (download) github.com/terra-farm/go-xen-api-client (download) github.com/amfranz/go-xmlrpc-client (download) github.com/hashicorp/terraform/vendor/google.golang.org/grpc/resolver github.com/hashicorp/terraform/vendor/google.golang.org/grpc/internal github.com/hashicorp/terraform/vendor/github.com/oklog/run github.com/hashicorp/terraform/vendor/github.com/agext/levenshtein github.com/hashicorp/terraform/vendor/github.com/hashicorp/go-hclog github.com/hashicorp/terraform/vendor/golang.org/x/net/context github.com/hashicorp/terraform/vendor/github.com/golang/protobuf/proto github.com/hashicorp/terraform/vendor/golang.org/x/text/transform github.com/hashicorp/terraform/vendor/golang.org/x/text/unicode/bidi github.com/hashicorp/terraform/vendor/golang.org/x/text/unicode/norm github.com/hashicorp/terraform/vendor/golang.org/x/net/http2/hpack github.com/hashicorp/terraform/vendor/golang.org/x/text/secure/bidirule github.com/hashicorp/terraform/vendor/golang.org/x/net/internal/timeseries github.com/hashicorp/terraform/vendor/google.golang.org/grpc/grpclog github.com/hashicorp/terraform/vendor/golang.org/x/net/trace github.com/hashicorp/terraform/vendor/google.golang.org/grpc/connectivity github.com/hashicorp/terraform/vendor/google.golang.org/grpc/codes github.com/hashicorp/terraform/vendor/google.golang.org/grpc/encoding github.com/hashicorp/terraform/vendor/google.golang.org/grpc/internal/grpcrand github.com/hashicorp/terraform/vendor/google.golang.org/grpc/internal/backoff github.com/hashicorp/terraform/vendor/google.golang.org/grpc/internal/envconfig github.com/hashicorp/terraform/vendor/google.golang.org/grpc/keepalive github.com/hashicorp/terraform/vendor/google.golang.org/grpc/metadata github.com/hashicorp/terraform/vendor/google.golang.org/grpc/stats github.com/hashicorp/terraform/vendor/google.golang.org/grpc/tap github.com/hashicorp/terraform/vendor/google.golang.org/grpc/naming github.com/hashicorp/terraform/vendor/golang.org/x/net/idna github.com/hashicorp/terraform/vendor/google.golang.org/grpc/resolver/dns github.com/hashicorp/terraform/vendor/google.golang.org/grpc/resolver/passthrough github.com/hashicorp/terraform/vendor/github.com/hashicorp/yamux github.com/hashicorp/terraform/vendor/github.com/mitchellh/go-testing-interface github.com/hashicorp/terraform/vendor/github.com/hashicorp/errwrap github.com/hashicorp/terraform/vendor/github.com/hashicorp/go-multierror github.com/hashicorp/terraform/vendor/github.com/apparentlymart/go-textseg/textseg github.com/hashicorp/terraform/vendor/github.com/mitchellh/go-wordwrap github.com/hashicorp/terraform/vendor/golang.org/x/net/http/httpguts github.com/hashicorp/terraform/vendor/github.com/zclconf/go-cty/cty/set github.com/hashicorp/terraform/vendor/golang.org/x/net/http2 github.com/hashicorp/terraform/vendor/github.com/zclconf/go-cty/cty github.com/hashicorp/terraform/helper/didyoumean github.com/hashicorp/terraform/vendor/github.com/hashicorp/hil/ast github.com/hashicorp/terraform/vendor/github.com/apparentlymart/go-cidr/cidr github.com/hashicorp/terraform/vendor/github.com/blang/semver github.com/hashicorp/terraform/vendor/github.com/hashicorp/go-uuid github.com/hashicorp/terraform/vendor/github.com/hashicorp/go-version github.com/hashicorp/terraform/vendor/github.com/hashicorp/hcl/hcl/strconv github.com/hashicorp/terraform/vendor/github.com/hashicorp/hcl/hcl/token github.com/hashicorp/terraform/vendor/github.com/zclconf/go-cty/cty/convert github.com/hashicorp/terraform/vendor/github.com/zclconf/go-cty/cty/function github.com/hashicorp/terraform/vendor/google.golang.org/grpc/credentials github.com/hashicorp/terraform/vendor/google.golang.org/grpc/encoding/proto github.com/hashicorp/terraform/vendor/github.com/golang/protobuf/ptypes/any github.com/hashicorp/terraform/vendor/github.com/golang/protobuf/ptypes/duration github.com/hashicorp/terraform/vendor/google.golang.org/genproto/googleapis/rpc/status github.com/hashicorp/terraform/vendor/github.com/golang/protobuf/ptypes/timestamp github.com/hashicorp/terraform/vendor/google.golang.org/grpc/balancer github.com/hashicorp/terraform/vendor/google.golang.org/grpc/internal/channelz github.com/hashicorp/terraform/vendor/google.golang.org/grpc/peer github.com/hashicorp/terraform/vendor/github.com/golang/protobuf/ptypes github.com/hashicorp/terraform/vendor/google.golang.org/grpc/balancer/base github.com/hashicorp/terraform/vendor/google.golang.org/grpc/balancer/roundrobin github.com/hashicorp/terraform/vendor/google.golang.org/grpc/status github.com/hashicorp/terraform/vendor/github.com/hashicorp/hcl2/hcl github.com/hashicorp/terraform/vendor/github.com/zclconf/go-cty/cty/gocty github.com/hashicorp/terraform/vendor/github.com/zclconf/go-cty/cty/json github.com/hashicorp/terraform/vendor/github.com/hashicorp/hcl/hcl/ast github.com/hashicorp/terraform/vendor/github.com/hashicorp/hcl/hcl/scanner github.com/hashicorp/terraform/vendor/github.com/zclconf/go-cty/cty/function/stdlib github.com/hashicorp/terraform/vendor/github.com/hashicorp/hcl2/hcldec github.com/hashicorp/terraform/tfdiags github.com/hashicorp/terraform/vendor/google.golang.org/grpc/internal/transport github.com/hashicorp/terraform/vendor/github.com/hashicorp/hcl/hcl/parser github.com/hashicorp/terraform/vendor/github.com/hashicorp/hcl/json/token github.com/hashicorp/terraform/vendor/github.com/hashicorp/hcl/json/scanner github.com/hashicorp/terraform/vendor/github.com/google/go-cmp/cmp/internal/diff github.com/hashicorp/terraform/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax github.com/hashicorp/terraform/vendor/github.com/hashicorp/hcl/json/parser github.com/hashicorp/terraform/vendor/github.com/google/go-cmp/cmp/internal/function github.com/hashicorp/terraform/vendor/github.com/google/go-cmp/cmp/internal/value github.com/hashicorp/terraform/vendor/github.com/hashicorp/hcl github.com/hashicorp/terraform/vendor/github.com/google/go-cmp/cmp github.com/hashicorp/terraform/vendor/github.com/hashicorp/hil/scanner github.com/hashicorp/terraform/vendor/github.com/hashicorp/hil/parser github.com/hashicorp/terraform/vendor/github.com/mitchellh/mapstructure github.com/hashicorp/terraform/vendor/github.com/mitchellh/reflectwalk github.com/hashicorp/terraform/vendor/github.com/hashicorp/hil github.com/hashicorp/terraform/helper/hilmapstructure github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/aws/awserr github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/internal/ini github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/internal/shareddefaults github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/aws/endpoints github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/aws/credentials github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/internal/sdkio github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/aws/client/metadata github.com/hashicorp/terraform/vendor/google.golang.org/grpc github.com/hashicorp/terraform/vendor/github.com/jmespath/go-jmespath github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/aws/awsutil github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/internal/sdkrand github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/internal/sdkuri github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/aws/credentials/processcreds github.com/hashicorp/terraform/vendor/github.com/bgentry/go-netrc/netrc github.com/hashicorp/terraform/vendor/github.com/hashicorp/go-cleanhttp github.com/hashicorp/terraform/vendor/github.com/hashicorp/go-getter/helper/url github.com/hashicorp/terraform/vendor/github.com/hashicorp/go-safetemp github.com/hashicorp/terraform/configs/configschema github.com/hashicorp/terraform/vendor/github.com/hashicorp/hcl2/hclwrite github.com/hashicorp/terraform/vendor/github.com/hashicorp/go-plugin/internal/proto github.com/hashicorp/terraform/vendor/google.golang.org/grpc/health/grpc_health_v1 github.com/hashicorp/terraform/vendor/google.golang.org/grpc/health github.com/hashicorp/terraform/vendor/github.com/hashicorp/go-plugin github.com/hashicorp/terraform/config/hcl2shim github.com/hashicorp/terraform/vendor/github.com/hashicorp/hcl2/hcl/json github.com/hashicorp/terraform/vendor/github.com/hashicorp/hcl2/gohcl github.com/hashicorp/terraform/vendor/github.com/mitchellh/go-homedir github.com/hashicorp/terraform/vendor/github.com/ulikunitz/xz/internal/xlog github.com/hashicorp/terraform/vendor/github.com/hashicorp/hcl2/hclparse github.com/hashicorp/terraform/vendor/github.com/ulikunitz/xz/internal/hash github.com/hashicorp/terraform/version github.com/hashicorp/terraform/svchost github.com/hashicorp/terraform/httpclient github.com/hashicorp/terraform/vendor/github.com/ulikunitz/xz/lzma github.com/hashicorp/terraform/registry/regsrc github.com/hashicorp/terraform/registry/response github.com/hashicorp/terraform/svchost/auth github.com/hashicorp/terraform/vendor/github.com/armon/go-radix github.com/hashicorp/terraform/vendor/github.com/bgentry/speakeasy github.com/hashicorp/terraform/svchost/disco github.com/hashicorp/terraform/vendor/github.com/mattn/go-isatty github.com/hashicorp/terraform/vendor/github.com/posener/complete/cmd/install github.com/hashicorp/terraform/registry github.com/hashicorp/terraform/vendor/github.com/posener/complete/cmd github.com/hashicorp/terraform/vendor/github.com/posener/complete/match github.com/hashicorp/terraform/vendor/github.com/posener/complete github.com/hashicorp/terraform/vendor/golang.org/x/crypto/openpgp/errors github.com/hashicorp/terraform/vendor/github.com/ulikunitz/xz github.com/hashicorp/terraform/vendor/golang.org/x/crypto/openpgp/armor github.com/hashicorp/terraform/vendor/github.com/mitchellh/cli github.com/hashicorp/terraform/vendor/golang.org/x/crypto/cast5 github.com/hashicorp/terraform/vendor/golang.org/x/crypto/openpgp/elgamal github.com/hashicorp/terraform/vendor/golang.org/x/crypto/openpgp/s2k github.com/hashicorp/terraform/vendor/github.com/mitchellh/copystructure github.com/hashicorp/terraform/vendor/golang.org/x/crypto/openpgp/packet github.com/hashicorp/terraform/vendor/github.com/mitchellh/hashstructure github.com/hashicorp/terraform/vendor/golang.org/x/crypto/blowfish github.com/hashicorp/terraform/helper/hashcode github.com/hashicorp/terraform/addrs github.com/hashicorp/terraform/vendor/golang.org/x/crypto/bcrypt github.com/hashicorp/terraform/dag github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/aws github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/aws/request github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream github.com/hashicorp/terraform/vendor/golang.org/x/crypto/openpgp github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/aws/client github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/aws/corehandlers github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/private/protocol github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/aws/csm github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/aws/credentials/endpointcreds github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/internal/s3err github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/private/protocol/rest github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/private/protocol/query/queryutil github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi github.com/hashicorp/terraform/vendor/github.com/hashicorp/hcl2/ext/typeexpr github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/private/protocol/query github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/aws/signer/v4 github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/aws/defaults github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml github.com/hashicorp/terraform/vendor/github.com/spf13/afero/mem github.com/hashicorp/terraform/flatmap github.com/hashicorp/terraform/vendor/github.com/spf13/afero github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/service/sts github.com/hashicorp/terraform/vendor/github.com/hashicorp/hcl2/ext/dynblock github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/service/s3 github.com/hashicorp/terraform/lang/funcs github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds github.com/hashicorp/terraform/configs github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/aws/session github.com/hashicorp/terraform/states github.com/hashicorp/terraform/lang github.com/hashicorp/terraform/vendor/github.com/vmihailenco/msgpack/codes github.com/hashicorp/terraform/vendor/github.com/vmihailenco/msgpack github.com/hashicorp/terraform/plans/objchange github.com/hashicorp/terraform/provisioners github.com/hashicorp/terraform/states/statefile github.com/hashicorp/terraform/internal/tfplugin5 github.com/hashicorp/terraform/vendor/github.com/zclconf/go-cty/cty/msgpack github.com/amfranz/go-xmlrpc-client github.com/hashicorp/terraform/plans github.com/terra-farm/go-xen-api-client
src/github.com/terra-farm/go-xen-api-client/convert_gen.go:6542:27: cannot assign DomainType to record.DomainType (type DomainType) in multiple assignment
src/github.com/terra-farm/go-xen-api-client/convert_gen.go:6884:114: cannot use record.DomainType (type DomainType) as type DomainType in argument to convertEnumDomainTypeToXen
src/github.com/terra-farm/go-xen-api-client/vm_gen.go:412:59: cannot use value (type DomainType) as type DomainType in argument to convertEnumDomainTypeToXen
src/github.com/terra-farm/go-xen-api-client/vm_gen.go:2957:16: cannot assign DomainType to _retval (type DomainType) in multiple assignment
src/github.com/terra-farm/go-xen-api-client/vm_metrics_gen.go:23:6: DomainType redeclared in this block
previous declaration at src/github.com/terra-farm/go-xen-api-client/vm_gen.go:161:6
src/github.com/terra-farm/go-xen-api-client/vm_metrics_gen.go:27:29: DomainTypeHvm redeclared in this block
previous declaration at src/github.com/terra-farm/go-xen-api-client/vm_gen.go:165:29
src/github.com/terra-farm/go-xen-api-client/vm_metrics_gen.go:29:28: DomainTypePv redeclared in this block
previous declaration at src/github.com/terra-farm/go-xen-api-client/vm_gen.go:167:28
src/github.com/terra-farm/go-xen-api-client/vm_metrics_gen.go:31:33: DomainTypePvInPvh redeclared in this block
previous declaration at src/github.com/terra-farm/go-xen-api-client/vm_gen.go:169:33
src/github.com/terra-farm/go-xen-api-client/vm_metrics_gen.go:33:37: DomainTypeUnspecified redeclared in this block
previous declaration at src/github.com/terra-farm/go-xen-api-client/vm_gen.go:171:37
github.com/hashicorp/terraform/vendor/github.com/hashicorp/go-getter
github.com/hashicorp/terraform/plugin/discovery
github.com/hashicorp/terraform/moduledeps
github.com/hashicorp/terraform/providers
github.com/hashicorp/terraform/config
github.com/hashicorp/terraform/plugin/convert
github.com/hashicorp/terraform/config/module
github.com/hashicorp/terraform/terraform
github.com/hashicorp/terraform/helper/schema
github.com/hashicorp/terraform/helper/plugin
github.com/hashicorp/terraform/plugin
$ go get -v github.com/terra-farm/terraform-provider-xenserver`
`github.com/terra-farm/terraform-provider-xenserver (download) github.com/hashicorp/terraform (download) github.com/terra-farm/go-xen-api-client (download) github.com/amfranz/go-xmlrpc-client (download) github.com/terra-farm/go-xen-api-client
src/github.com/terra-farm/go-xen-api-client/convert_gen.go:6542:27: cannot assign DomainType to record.DomainType (type DomainType) in multiple assignment src/github.com/terra-farm/go-xen-api-client/convert_gen.go:6884:114: cannot use record.DomainType (type DomainType) as type DomainType in argument to convertEnumDomainTypeToXen src/github.com/terra-farm/go-xen-api-client/vm_gen.go:412:59: cannot use value (type DomainType) as type DomainType in argument to convertEnumDomainTypeToXen src/github.com/terra-farm/go-xen-api-client/vm_gen.go:2957:16: cannot assign DomainType to _retval (type DomainType) in multiple assignment src/github.com/terra-farm/go-xen-api-client/vm_metrics_gen.go:23:6: DomainType redeclared in this block previous declaration at src/github.com/terra-farm/go-xen-api-client/vm_gen.go:161:6 src/github.com/terra-farm/go-xen-api-client/vm_metrics_gen.go:27:29: DomainTypeHvm redeclared in this block previous declaration at src/github.com/terra-farm/go-xen-api-client/vm_gen.go:165:29 src/github.com/terra-farm/go-xen-api-client/vm_metrics_gen.go:29:28: DomainTypePv redeclared in this block previous declaration at src/github.com/terra-farm/go-xen-api-client/vm_gen.go:167:28 src/github.com/terra-farm/go-xen-api-client/vm_metrics_gen.go:31:33: DomainTypePvInPvh redeclared in this block previous declaration at src/github.com/terra-farm/go-xen-api-client/vm_gen.go:169:33 src/github.com/terra-farm/go-xen-api-client/vm_metrics_gen.go:33:37: DomainTypeUnspecified redeclared in this block previous declaration at src/github.com/terra-farm/go-xen-api-client/vm_gen.go:171:37 `
We have it working now:
Download terraform [https://releases.hashicorp.com/terraform/]()
chmod +x downloads/terraform
mv downloads/terraform /usr/local/bin/
Download: https://github.com/terra-farm/terraform-provider-xenserver/releases
Save it ... example:
/Users/xxxxxxx/terraform-xxx/providers/
chmod +x /Users/xxxxxxx/terraform-xxx/providers/terraform-provider-xenserver-v0.3.0-darwin-amd64
.terraformrc in HOME directory
$ cat /Users/xxxxxxx/.terraformrc
providers {
xenserver = "/Users/xxxxxxx/terraform-xxx/providers/terraform-provider-xenserver-v0.3.0-darwin-amd64"
}
Test it , for example /Users/xxxxxxx/terraform-xxx/main.tf
`# Configure the XenServer Provider provider "xenserver" { url = "https://xxxxxxxx" username = "xxxxxxx" password = "xxxxxxxx" }
// Create a new virtual machine resource "xenserver_vm" "test-terraform" { base_template_name = "template" name_label = "test-terraform" static_mem_min = 8589934592 static_mem_max = 8589934592 dynamic_mem_min = 8589934592 dynamic_mem_max = 8589934592 vcpus = 2 boot_order = "c"
hard_drive { is_from_template = true user_device = "0" } # Template VM HDD cdrom { is_from_template = true user_device = "3" } network_interface { network_uuid = "02176a36-edd0-3e09-d747-0532b2ce544d" device = 0 mtu = 1500 mac = "" other_config { ethtool-gso = "off" ethtool-ufo = "off" ethtool-tso = "off" ethtool-sg = "off" ethtool-tx = "off" ethtool-rx = "off" } } } ` /Users/xxxxxxx/terraform-xxx/terraform init
/Users/xxxxxxx/terraform-xxx/terraform plan
/Users/xxxxxxx/terraform-xxx/terraform apply
Hope this helps
@githubwtn is there anything different or missing from the setup described in the docs? https://terra-farm.github.io/provider-xenserver/
If so, could you create a pull request on the terraform-provider-xenserver repository against the docs with what is missing?
The compilation issue is resolved, but the tests now fail on Go 1.12 and Go 1.13. I'm looking into it at the moment.
is there any news about working with go 1.12 and 1.13? Thanks!
@eguarc Github Actions hs been set up to verify this code against Go 1.13 & Go 1.14 at the moment. See the builds for more info:
https://github.com/terra-farm/go-xen-api-client/actions/runs/142828718
It may be something I did wrong. I'm getting this when trying to use the latest commit in a project. I do not have this issue if I use d22d1de37b4e743010e0ab53f901ecce1c014c90
I'm using go 1.11.1 on macOS 10.13.6