Closed lamw closed 5 years ago
Hi @lamw from the output it looks like you're trying to run the connector in the vcsim folder which is why you see the error.
After the first step then do this:
cd $GOPATH/src/github.com/openfaas-incubator/vcenter-connector/
go build
./vcenter-connector
Does that help?
Alex
( I've updated the instructions too )
Looks like the instructions for vcenter connector is missing from the README ...
Currently it just says:
export OPENFAAS_URL=http://127.0.0.1:31112
go run main.go -vcenter-url="http://user:pass@127.0.0.1:8989/sdk" -insecure
it should be
go get -u -d github.com/openfaas-incubator/vcenter-connector
cd $GOPATH/src/github.com/openfaas-incubator/vcenter-connector/
go build
./vcenter-connector -vcenter-url="http://user:pass@127.0.0.1:8989/sdk" -insecure
When I try to launch vCenter Connector, I get a new error:
root@photon-machine [ ~/go/src/github.com/openfaas-incubator/vcenter-connector ]# ./vcenter-connector -vcenter-url="http://user:pass@127.0.0.1:8989/sdk" -insecure
2019/01/25 20:49:27 Get http://127.0.0.1:31112/system/functions: dial tcp 127.0.0.1:31112: connect: connection refused
I did verify using curl -k http://user:pass@127.0.0.1:8989/about
works, so govcsim is responding
Do you have OpenFaaS deployed anywhere? That's what the URL is 127.0.0.1:31112
Oh, no. I had assumed the README was starting from scratch where you don't have anything running ...
Let me add that too..
Thanks! I've got OpenFaaS Cluster deployed (reachable to Admin UI)
I'm now getting error running:
root@photon-machine [ ~/echo-fn ]# faas-cli template store pull golang-http
Fetch templates from repository: https://github.com/openfaas-incubator/golang-http-template at master
2019/01/25 23:06:00 Attempting to expand templates from https://github.com/openfaas-incubator/golang-http-template
2019/01/25 23:06:01 Cannot overwrite the following 4 template(s): [golang-http golang-http-armhf golang-middleware golang-middleware-armhf]
2019/01/25 23:06:01 Fetched 0 template(s) : [] from https://github.com/openfaas-incubator/golang-http-template
I'm able to curl https://github.com/openfaas (so I know system can reach internet)
You can skip this command if you already ran it and go onto faas-cli deploy
@lamw can you please follow the steps described in this PR I created last night? https://github.com/openfaas-incubator/vcenter-connector/pull/17
This has all the bits and details to do correct event forwarding, incl. an example. If everything is up and running you can get some inspiration here (the Python example is also used in the README in the PR):
@embano1
Ran into an issue w/Step 5 ...
I'm able to reach OpenFaaS UI, so I assume OpenFaaS is working
root@photon-machine [ ~/pytagfn ]# faas-cli deploy -f stack.yml
Deploying: pytag-fn.
Is FaaS deployed? Do you need to specify the --gateway flag?
Put http://127.0.0.1:31112/system/functions: dial tcp 127.0.0.1:31112: connect: connection refused
Function 'pytag-fn' failed to deploy with status code: 500
BTW - On Step 4, its not exactly clear to me if you want both Tag ID (URN) and if so, is it separated by comma or space, would be good to clarify that detail
The function won't deploy so this is an issue with faas-cli not being able to connect to openfaas. Is the IP:Port correct for OpenFaaS? Can you please paste the stack.yaml?
Here's a working example regarding TAGURN:
provider:
name: faas
gateway: http://127.0.0.1:8080 # <- make sure this is correct for your environment
functions:
pytag-fn:
lang: python3
handler: ./pytag-fn
image: embano1/pytag-fn:0.1
environment:
VC: 192.168.178.72
VCUSERNAME: user@vsphere.local
VCPASSWORD: PassW0rd!
TAGURN: urn:vmomi:InventoryServiceTag:019c0a9e-0672-48f5-ac2a-e394669e2916:GLOBAL
TAGACTION: attach
write_debug: true
read_debug: true
annotations:
topic: vm.powered.on
I've got OpenFaaS running locally via Docker Swarm:
root@photon-machine [ ~/pytagfn ]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
7c4fbc2aa6a0 openfaas/queue-worker:0.5.4 "./app" 2 minutes ago Up 2 minutes 8080/tcp func_queue-worker.1.vxhl4bug2f1inr3yqn520gbpn
1137dc89ae53 nats-streaming:0.11.2 "/nats-streaming-s..." 2 minutes ago Up 2 minutes 4222/tcp, 8222/tcp func_nats.1.2cslkdahup5bf2pkdeoak3v1l
faca04565e9c openfaas/faas-swarm:0.6.1 "./faas-swarm" 2 minutes ago Up 2 minutes 8080/tcp func_faas-swarm.1.yh4u8jlz2am7gg4p4m1kcp76o
04a8e28434f6 openfaas/gateway:0.9.14 "./gateway" 2 minutes ago Up 2 minutes 8080/tcp func_gateway.1.n7ffxeggh62k8wymeksbdsqwr
8732cd93ee95 prom/alertmanager:v0.15.0 "/bin/alertmanager..." 3 minutes ago Up 2 minutes 9093/tcp func_alertmanager.1.qp74l2tlliqodu7d7kvt52ity
0ee490e3ea96 prom/prometheus:v2.3.1 "/bin/prometheus -..." 3 minutes ago Up 3 minutes 9090/tcp func_prometheus.1.huy6bgbh2npnadfg664agdhza
I'm able to the UI which is published externally on 8080 (http://34.208.71.1:8080), so not sure how else to verify/check. Also, this is my first time really using OpenFaaS, so I could be missing something.
Here's my stack.yaml
provider:
name: faas
gateway: http://127.0.0.1:8080
functions:
pytag-fn:
lang: python3
handler: ./pytag-fn
image: embano1/pytag-fn:0.1
environment:
VC: 127.0.0.1:8989
VCUSERNAME: u
VCPASSWORD: p
TAGURN: urn:vmomi:InventoryServiceTag:9d65bea5-f476-4c25-a8bd-0a7e2d051968:GLOBAL
TAGACTION: attach
annotations:
topic: vm.powered.on
As this related to troubleshooting to openfaas/CLI, it would be better to use Slack for this because we're off-topic here.
It looks like faas-cli is not able to connect to openfaas when deploying the function. Using localhost
only works if openfaas gateway is also reachable on that address. According to your description, the gateway is at http://34.208.71.1:8080
so try changing the gateway address in stack.yaml to this.
To be honest, I also wonder why faas-cli uses this address/port Put http://127.0.0.1:31112/system/functions: dial tcp 127.0.0.1:31112
? Where does 31112 come from? Is there a local redirect happening or old env var hanging around?
I'll reach out offline, I'm able to proceed a bit further but running into some other issues. I think it's due to the assumption of the instructions and depending on your experience and tools you're using.
Received flag provided but not defined: -vcenter-url error message when trying to start the connector based on the README instructions