mistio / mist-ce

Mist is an open source, multicloud management platform
https://mist.io
Apache License 2.0
1.87k stars 315 forks source link

Servers in a VPN - SSH access? #291

Open Jaykah opened 10 years ago

Jaykah commented 10 years ago

Hi,

I have just tried Mist.io for the first time, and I could not find any information about running it for servers closed off behind a VPN. None of my servers have public SSH endpoints, and trying to access them via the "Shell" feature is just attempting an SSH connection via the server's public IP (which fails, obviously)

1) Is it possible to connect to SSH using a local IP (if self-hosted and the node is part of the network)? 2) I want to be able to deploy a server that will be added to a VPN instead of a region (I am using Azure). I saw no such functionality - but I don't mind contributing - can you please point me in the right direction as to where I can start?

mgogoulos commented 10 years ago

Hi Jaykah,

if you setup your own instance of mist.io inside the VPN, this will be the machine that probes the nodes. So if it can reach them, it will be able to establish ssh connections as well.

Regarding the ability to provide the network while deploying nodes, it is something we are looking at. We only recently added Azure support and it is not fully featured yet. We do have however on our short term schedule the listing of networks, plus the ability to specify the network name, and deploy the VMs there.

If you are in the mood of contributing, please have a look at files src/mist/io/views.py and methods.py

On create_machine (view.py) you would specify the network id. Then on _create_machine_azure (methods.py) you'll also pass this id. The last function calls create_node on src/libcloud/libcloud/compute/drivers/azure.py (which is the driver for Azure). There you can pass the network id as ex_virtual_network=None on the function's arguments, and set ex_virtual_network instead of the last argument None, on AzureXmlSerializer.virtual_machine_deployment_to_xml. This is the place for the network to be specified, according to Azure API's documentation, on http://msdn.microsoft.com/en-us/library/azure/jj157194.aspx. You would still need to specify the region (location on mist.io's terminology) if I understand well, because it is needed for the storage creation and some other things needed while deploying any Azure node.

You can give it a try, but as I've written this is already on our short term dev, so it will soon be implemented both on mist.io's backend and the UI.

Best regards, Markos