nova/doc/source/devref/cloudpipe.rst

4.2 KiB

Cloudpipe -- Per Project Vpns

Cloudpipe is a method for connecting end users to their project instances in vlan mode.

Overview

The support code for cloudpipe implements admin commands (via nova-manage) to automatically create a vm for a project that allows users to vpn into the private network of their project. Access to this vpn is provided through a public port on the network host for the project. This allows users to have free access to the virtual machines in their project without exposing those machines to the public internet.

Cloudpipe Image

The cloudpipe image is basically just a linux instance with openvpn installed. It needs a simple script to grab user data from the metadata server, b64 decode it into a zip file, and run the autorun.sh script from inside the zip. The autorun script will configure and run openvpn to run using the data from nova.

It is also useful to have a cron script that will periodically redownload the metadata and copy the new crl. This will keep revoked users from connecting and will disconnect any users that are connected with revoked certificates when their connection is renegotiated (every hour).

Cloudpipe Launch

When you use nova-manage to launch a cloudpipe for a user, it goes through the following process:

  1. creates a keypair called <project_id>-vpn and saves it in the keys directory
  2. creates a security group <project_id>-vpn and opens up 1194 and icmp
  3. creates a cert and private key for the vpn instance and saves it in the CA/projects/<project_id>/ directory
  4. zips up the info and puts it b64 encoded as user data
  5. launches an m1.tiny instance with the above settings using the flag-specified vpn image

Vpn Access

In vlan networking mode, the second ip in each private network is reserved for the cloudpipe instance. This gives a consistent ip to the instance so that nova-network can create forwarding rules for access from the outside world. The network for each project is given a specific high-numbered port on the public ip of the network host. This port is automatically forwarded to 1194 on the vpn instance.

If specific high numbered ports do not work for your users, you can always allocate and associate a public ip to the instance, and then change the vpn_public_ip and vpn_public_port in the database. This will be turned into a nova-manage command or a flag soon.

Certificates and Revocation

If the use_project_ca flag is set (required to for cloudpipes to work securely), then each project has its own ca. This ca is used to sign the certificate for the vpn, and is also passed to the user for bundling images. When a certificate is revoked using nova-manage, a new Certificate Revocation List (crl) is generated. As long as cloudpipe has an updated crl, it will block revoked users from connecting to the vpn.

The nova.cloudpipe.pipelib Module

nova.cloudpipe.pipelib

The nova.api.cloudpipe Module

nova.api.cloudpipe

The nova.crypto Module

nova.crypto