split proxy on vsphere provider #1676

Open
cnf opened this Issue Feb 22, 2017 · 4 comments

Comments

Projects
None yet
4 participants

cnf commented Feb 22, 2017

In order to reach my vsphere API, I need to go through a proxy. To reach http://cloud-images.ubuntu.com/releases/streams/v1/index.sjson however, I need to connect directly to the internet.

I have a pac config to do this in my browser, but this obviously doesn't work with the juju command.

When I follow the documentation at https://jujucharms.com/docs/stable/help-vmware I get the following error:

$ juju bootstrap myvscloud myvscontroller
Creating Juju controller "myvscontroller" on myvscloud/dc0
ERROR error cleaning up: destroying instances: Post https://<vsphereip>/sdk: unexpected EOF
ERROR invalid URL "http://cloud-images.ubuntu.com/releases/streams/v1/index.sjson" not found
$ juju --version
2.0.3-sierra-amd64

The documentation is unclear how to solve this. Download the image manually, and place it at a set location maybe?

logged here at @chuckbutler request on irc

Collaborator

chuckbutler commented Feb 22, 2017

@cnf - i did a little bit of digging on my own before forwarding this over to the core devs. I think this can be worked around with passing proxy config to the bootstrap command

--config http-proxy=http://<ip address>:<port>
--config https-proxy=http://<ip address>:<port>

It's not as automagic as a pac file, however, if you can extract the information for the proxy into those config flags during the bootstrap process, I do believe this will work (presuming the proxy doesn't have URL filters / capacity to reach those endpoints)

juju bootstrap vpower vsphere --config http-proxy=http://5.5.5.5:5555 --config https-proxy=http://5.5.5.5:5555

Can you give that a go and let me know if this resolves the issue? If not, we'll need to dig deeper and see what else might unblock this.

-- edit --

Per the vmware docs, it does appear that there is an image fetch locally. We might be able to also stub that with a local image path. I'm unsure if that's supported at this time. I suspect that if this fails, that's where it would fall over.

Member

kwmonroe commented Feb 22, 2017

Drive by comment to build on what @chuckbutler said -- there are 2 places to configure proxies during bootstrap. One is for the bootstrap machine itself (using --config as mentioned above).

The other is for the models that you'll create after bootstrapping. This can be set with --model-defaults during bootstrap and may be needed if charms you plan to deploy need to be proxied. For example, some charms fetch stuff from pypi, so they'll need internet access.

To handle both of these, I do the following on my juju client (my laptop):

### On my laptop, in my .bashrc:
...
# no proxy for localhost, my eth0 ip address, and a subnet which i do not want proxied
export no_proxy=`echo localhost 10.245.67.130 10.44.139.{1..255} | sed 's/ /,/g'`
export http_proxy=http://squid.internal:3128
export https_proxy=http://squid.internal:3128
...

And now, the bootstrap command I run, again on my laptop:

$ juju bootstrap \
--config http-proxy=$http_proxy \
--config https-proxy=$https_proxy \
--config no-proxy=$no_proxy \
--model-default http-proxy=$http_proxy \
--model-default https-proxy=$https_proxy \
--model-default no-proxy=$no_proxy \
<cloud> <name>

cnf commented Feb 22, 2017

Thanks @kwmonroe, I have set http_proxy on my client.

The problem is that I MUST go through the proxy to get to the vsphere API. And I MUST NOT go through that proxy to get to http://cloud-images.ubuntu.com.

So when I have http_proxy set, I can not download the cloud image, and when I unset it, I can't access the vsphere api.

Owner

jameinel commented Feb 23, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment